-# Copyright (C) 2015-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2015-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
OPTION(MEDCOUPLING_BUILD_TESTS "Build MED tests." ON)
OPTION(MEDCOUPLING_BUILD_DOC "Build MED doc." ON)
OPTION(MEDCOUPLING_BUILD_STATIC "Build MEDCoupling library in static mode." OFF)
+OPTION(MEDCOUPLING_USE_64BIT_IDS "Size of IDs to refer cells and nodes. 32 bits when OFF (default), 64 bits when ON. Not implemented yet for 64 bits." OFF)
IF(${MEDCOUPLING_USE_MPI})
SET(USE_METIS_NOT_PARMETIS OFF)
ELSE()
# Set list of prerequisites
# =========================
+IF(MEDCOUPLING_USE_64BIT_IDS)
+ ADD_DEFINITIONS("-DMEDCOUPLING_USE_64BIT_IDS")
+ENDIF(MEDCOUPLING_USE_64BIT_IDS)
+
IF(NOT MEDCOUPLING_MICROMED)
FIND_PACKAGE(SalomeHDF5 REQUIRED)
FIND_PACKAGE(SalomeMEDFile REQUIRED)
IF(MEDCOUPLING_USE_MPI)
FIND_PACKAGE(SalomeMPI REQUIRED)
ADD_DEFINITIONS("-DHAVE_MPI")
+ SALOME_ADD_MPI_TO_HDF5()
IF(MEDCOUPLING_PARTITIONER_PARMETIS)
FIND_PACKAGE(SalomeParMetis)
SALOME_LOG_OPTIONAL_PACKAGE(ParMetis MEDCOUPLING_PARTITIONER_PARMETIS)
#
###############################################################
-# Copyright (C) 2013-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2013-2019 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2015-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2015-2019 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-# Copyright (C) 2012-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-# Copyright (C) 2012-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-# Copyright (C) 2012-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-dnl Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2019 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-dnl Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2019 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-dnl Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2019 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-# Copyright (C) 2012-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-# Copyright (C) 2012-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#!/usr/bin/env python
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-# Copyright (C) 2012-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
# Doxyfile 0.1
#---------------------------------------------------------------------------
# General configuration options
\end{tabular}\right]
\f]
-\subsection TableNatureOfFieldExampleConservVol Conservative volumic case
+\subsection TableNatureOfFieldExampleConservVol IntensiveMaximum case
-If we apply the formula \ref TableNatureOfField "above" it leads to the following \f$ M_{Conservative Volumic} \f$ matrix :
+If we apply the formula \ref TableNatureOfField "above" it leads to the following \f$ M_{IntensiveMaximum} \f$ matrix :
\f[
- M_{Conservative Volumic}=\left[\begin{tabular}{cc}
+ M_{IntensiveMaximum}=\left[\begin{tabular}{cc}
$\displaystyle{\frac{0.125}{0.125+0.75}}$ &
$\displaystyle{\frac{0.75}{0.125+0.75}}$ \\
\end{tabular}\right]=\left[\begin{tabular}{cc}
In the particular case treated \ref TableNatureOfFieldEx1 "here", it means that only a power of 25.055 W is intercepted by the target cell !
So from the 104 W of the source field \f$ FS \f$, only 25.055 W are transmitted in the target field using this nature of field.
-In order to treat differently a power field, another policy, \ref TableNatureOfFieldExampleIntegralGlobConstraint "integral global constraint nature" is available.
+In order to treat differently a power field, another policy, \ref TableNatureOfFieldExampleIntegralGlobConstraint "Extensive Conservation" is available.
-\subsection TableNatureOfFieldExampleIntegralGlobConstraint ExtensiveMaximum with global constraints case
+\subsection TableNatureOfFieldExampleIntegralGlobConstraint ExtensiveConservation case
If we apply the formula \ref TableNatureOfField "above" it leads to the following \f$ M_{ExtensiveConservation} \f$ matrix :
\b BUT, As we can see here, the maximum principle is \b not respected here, because the target cell #0 has a value higher than the two
intercepted source cells.
-\subsection TableNatureOfFieldExampleRevIntegral Reverse integral case
+\subsection TableNatureOfFieldExampleRevIntegral IntensiveConservation case
If we apply the formula \ref TableNatureOfField "above" it leads to the following \f$ M_{IntensiveConservation} \f$ matrix :
This type of nature is particularly recommended to interpolate an intensive \b density
field (moderator density, power density).
-The difference with \ref TableNatureOfFieldExampleConservVol "conservative volumic" seen above is that here the
+The difference with \ref TableNatureOfFieldExampleConservVol "Intensive Maximum" seen above is that here the
target field is homogenized to the \b whole target cell. It explains why this nature of field does not follow the maximum principle.
To illustrate the case, let's consider that \f$ FS \f$ is a power density field in \f$ W/m^2 \f$.
-# Copyright (C) 2012-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2013-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2013-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2013-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2013-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2013-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2013-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
// This file contains some code used only for
// * generation of documentation for inline methods of MEDCouplingUMesh class,
// * groupping methods into "Basic API", "Advanced" and "Others..." sections
-// Copyright (C) 2013-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2013-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2013-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
<ul>
$navpath
<li class="footer">
- Copyright © 2007-2017 CEA/DEN, EDF R&D, OPEN CASCADE<br>
+ Copyright © 2007-2019 CEA/DEN, EDF R&D, OPEN CASCADE<br>
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS<br>
</li>
</ul>
-# Copyright (C) 2012-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-# Copyright (C) 2012-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
{%- block footer %}
<div class="footer">
- © Copyright 2007-2017, CEA/DEN, EDF R&D, OPEN CASCADE
+ Copyright © 2007-2019 CEA/DEN, EDF R&D, OPEN CASCADE
<br>
- © Copyright 2003-2007, OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS.
+ Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS.
</div>
{{ super() }}
{%- endblock %}
-# Copyright (C) 2012-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
portico_3subs.sauv
agitateur.med
test_MED_MAIL.sauv
+ castem17_result_xdr.sauv
+ castem17_result_ascii.sauv
)
SET(MED_RESOURCES_FILES ${MED_test_fig_files})
--- /dev/null
+ ENREGISTREMENT DE TYPE 4
+ NIVEAU 19 NIVEAU ERREUR 0 DIMENSION 3
+ DENSITE 0.00000E+00
+ ENREGISTREMENT DE TYPE 7
+ NOMBRE INFO CASTEM2000 8
+ IFOUR 2 NIFOUR 0 IFOMOD 2 ILGNI 10 IIMPI 0 IOSPI 0 ISOTYP 1
+ NSDPGE 0
+ ENREGISTREMENT DE TYPE 8
+ 4 64
+ UX UY UZ RX RY RZ UR UT RT LX ALFABETAFBETP PI T RR TIN
+ FTSUPTH FC IUX IUY IUZ IRX IRY IRZ IUR IUT IRT PQ TP IP IPI AX AY
+ AZ B1X B1Y B1Z C1X C1Y C1Z D1X D1Y D1Z E1X E1Y E1Z B2X B2Y B2Z C2X C
+ 2Y C2Z D2X D2Y D2Z E2X E2Y E2Z PG PC VEL
+ 4 64
+ FX FY FZ MX MY MZ FR FT MT FLX FALFFBETBETAFP FPI Q MR QIN
+ FQSUPFLUXED IFX IFY IFZ IMX IMY IMZ IFR IFT IMT FPQ FTP IFP IFPIFAX FA
+ Y FAZ FB1XFB1YFB1ZFC1XFC1YFC1ZFD1XFD1YFD1ZFE1XFE1YFE1ZFB2XFB2YFB2ZFC2XF
+ C2YFC2ZFD2XFD2YFD2ZFE2XFE2YFE2ZQG QC QEL
+ ENREGISTREMENT DE TYPE 2
+ PILE NUMERO 1NBRE OBJETS NOMMES 6NBRE OBJETS 12
+ ENTREE NOT_I001 NOT_I002 NOT_I003 PIECE SORTIE
+ 2 4 6 8 10 11
+ 1 0 0 1 12
+ 0 0 0 0 0 0 0 0 0 0
+ 0 0
+ 1 2 3 4 5 6 7 8 9 10
+ 11 12
+ 0 1 0 0 0
+ 3
+ 8 0 0 4 1
+ 0
+ 3 4 2 1
+ 0 1 0 0 0
+ 5
+ 2 0 0 2 16
+ 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0
+ 3 8 8 10 10 9 4 7 7 9
+ 3 4 1 5 5 11 11 12 2 6
+ 6 12 1 2 3 1 10 11 4 2
+ 9 12
+ 0 1 0 0 0
+ 7
+ 8 0 0 4 8
+ 0 0 0 0 0 0 0 0
+ 3 8 7 4 8 10 9 7 11 5
+ 6 12 5 1 2 6 3 1 5 8
+ 8 5 11 10 2 4 7 6 6 7
+ 9 12
+ 0 1 0 0 0
+ 9
+ 14 0 0 8 2
+ 0 0
+ 10 9 7 8 11 12 6 5 8 7
+ 4 3 5 6 2 1
+ 0 1 0 0 0
+ 9
+ 0 1 0 0 0
+ 12
+ 8 0 0 4 1
+ 0
+ 9 10 11 12
+ ENREGISTREMENT DE TYPE 2
+ PILE NUMERO 2NBRE OBJETS NOMMES 1NBRE OBJETS 1
+ TEMP1
+ 1
+ 1 1 2 2
+ -1 12 1
+ SCAL
+ 0
+ SCAL AIRE chp oint cre e pa r EX COMP
+
+ 1 0
+ 2.38461538461538E+02 2.38461538461539E+02 2.38461538461539E+02
+ 2.38461538461538E+02 1.69230769230769E+02 1.69230769230769E+02
+ 1.69230769230769E+02 1.69230769230769E+02 1.00000000000000E+02
+ 1.00000000000000E+02 1.00000000000000E+02 1.00000000000000E+02
+ ENREGISTREMENT DE TYPE 2
+ PILE NUMERO 32NBRE OBJETS NOMMES 0NBRE OBJETS 12
+ 12
+ 6 8 2 4 11 12 10 9 3 1
+ 5 7
+ ENREGISTREMENT DE TYPE 2
+ PILE NUMERO 33NBRE OBJETS NOMMES 0NBRE OBJETS 1
+ 64
+ 0.00000000000000E+00 0.00000000000000E+00 2.00000000000000E+00
+ 0.00000000000000E+00 0.00000000000000E+00 0.00000000000000E+00
+ 0.00000000000000E+00 0.00000000000000E+00 0.00000000000000E+00
+ 1.00000000000000E+00 2.00000000000000E+00 0.00000000000000E+00
+ 0.00000000000000E+00 1.00000000000000E+00 0.00000000000000E+00
+ 0.00000000000000E+00 1.00000000000000E+00 0.00000000000000E+00
+ 2.00000000000000E+00 0.00000000000000E+00 1.00000000000000E+00
+ 0.00000000000000E+00 0.00000000000000E+00 0.00000000000000E+00
+ 1.00000000000000E+00 1.00000000000000E+00 2.00000000000000E+00
+ 0.00000000000000E+00 1.00000000000000E+00 1.00000000000000E+00
+ 0.00000000000000E+00 0.00000000000000E+00 0.00000000000000E+00
+ 0.00000000000000E+00 1.00000000000000E+00 0.00000000000000E+00
+ 0.00000000000000E+00 1.00000000000000E+00 1.00000000000000E+00
+ 0.00000000000000E+00 1.00000000000000E+00 0.00000000000000E+00
+ 1.00000000000000E+00 0.00000000000000E+00 1.00000000000000E+00
+ 1.00000000000000E+00 1.00000000000000E+00 0.00000000000000E+00
+ 0.00000000000000E+00 1.00000000000000E+00 2.00000000000000E+00
+ 0.00000000000000E+00 0.00000000000000E+00 0.00000000000000E+00
+ 2.00000000000000E+00 0.00000000000000E+00 1.00000000000000E+00
+ 0.00000000000000E+00 2.00000000000000E+00 0.00000000000000E+00
+ 1.00000000000000E+00 1.00000000000000E+00 2.00000000000000E+00
+ 0.00000000000000E+00
+ ENREGISTREMENT DE TYPE 5
+LABEL_AUTOMATIQUE_1
--- /dev/null
+#
+# SWIG suppressions for MEDCoupling
+#
+
+{
+ <malloc>
+ Memcheck:Leak
+ fun:malloc
+ fun:PyObject_Malloc
+}
+
+{
+ <realloc_unicode>
+ Memcheck:Leak
+ fun:*alloc
+ ...
+ fun:PyUnicode_*
+}
+
+{
+ <swig_py_client_data>
+ Memcheck:Leak
+ match-leak-kinds: definite
+ fun:malloc
+ fun:SwigPyClientData_New
+}
+
+{
+ <dic2>
+ Memcheck:Leak
+ fun:malloc
+ ...
+ fun:*PyDict_*
+}
+
+{
+ <py_gc>
+ Memcheck:Leak
+ fun:realloc
+ fun:_PyObject_GC_Resize
+}
+{
+ <call>
+ Memcheck:Leak
+ fun:malloc
+ ...
+ fun:PyObject_Call
+}
+{
+ <load_mod>
+ Memcheck:Leak
+ fun:*alloc
+ ...
+ fun:_PyImport_LoadDynamicModule
+}
+
+{
+ <load_mod>
+ Memcheck:Leak
+ fun:*alloc
+ ...
+ fun:*PyInit*
+}
+
+
+
-# Copyright (C) 2015-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2015-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-# Copyright (C) 2015-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2015-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2018 CEA/DEN, EDF R&D
+// Copyright (C) 2018-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2001-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2001-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+// Copyright (C) 2001, 2002, 2004, 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2001-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-# Copyright (C) 2012-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2009-2016 OPEN CASCADE
+// Copyright (C) 2009-2019 OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2009-2016 OPEN CASCADE
+// Copyright (C) 2009-2019 OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-# Copyright (C) 2007-2017 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
# Author : Anthony Geay (EDF R&D)
import re
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
}
}
+/*!
+ * Erase current element and place iterator onto the PREVIOUS element (eventually looping)
+ */
+void IteratorOnComposedEdge::eraseCurrent()
+{
+ delete(*_deep_it);
+ _deep_it = _list_handle->erase(_deep_it);
+ // By default erase place the iterator after the removed element:
+ previousLoop();
+}
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
INTERPKERNEL_EXPORT ElementaryEdge *current() { return *_deep_it; }
INTERPKERNEL_EXPORT void assignMySelfToAllElems(ComposedEdge *elems);
INTERPKERNEL_EXPORT void insertElemEdges(ComposedEdge *elems, bool changeMySelf);
+ INTERPKERNEL_EXPORT void eraseCurrent();
private:
std::list<ElementaryEdge *>::iterator _deep_it;
std::list<ElementaryEdge *>* _list_handle;
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
(*iter)->dumpInXfigFile(stream,resolution,box);
}
+void ComposedEdge::dumpToCout(const std::map<INTERP_KERNEL::Node *,int>& mapp) const
+{
+ int i=0;
+ for(std::list<ElementaryEdge *>::const_iterator iter=_sub_edges.begin();iter!=_sub_edges.end();iter++, i++)
+ (*iter)->dumpToCout(mapp, i);
+ std::cout << std::endl;
+}
+
Node *ComposedEdge::getEndNode() const
{
return _sub_edges.back()->getEndNode();
if(val)
{
Edge *e=val->getPtr();
- std::auto_ptr<EdgeIntersector> intersc(Edge::BuildIntersectorWith(e1,e));
+ std::unique_ptr<EdgeIntersector> intersc(Edge::BuildIntersectorWith(e1,e));
bool obviousNoIntersection,areOverlapped;
- intersc->areOverlappedOrOnlyColinears(0,obviousNoIntersection,areOverlapped); // first parameter never used
+ intersc->areOverlappedOrOnlyColinears(obviousNoIntersection,areOverlapped);
if(obviousNoIntersection)
{
continue;
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
INTERPKERNEL_EXPORT bool changeEndNodeWith(Node *node) const;
INTERPKERNEL_EXPORT bool changeStartNodeWith(Node *node) const;
INTERPKERNEL_EXPORT void dumpInXfigFile(std::ostream& stream, int resolution, const Bounds& box) const;
+ INTERPKERNEL_EXPORT void dumpToCout(const std::map<INTERP_KERNEL::Node *,int>& mapp) const;
INTERPKERNEL_EXPORT bool isInOrOut(Node *nodeToTest) const;
INTERPKERNEL_EXPORT bool isInOrOut2(Node *nodeToTest) const;
INTERPKERNEL_EXPORT bool getDirection() const;
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
return _e1.isIn(_chararct_val_for_e1) && _e2.isIn(_chararct_val_for_e2);
}
-bool EdgeIntersector::intersect(const Bounds *whereToFind, std::vector<Node *>& newNodes, bool& order, MergePoints& commonNode)
+bool EdgeIntersector::intersect(std::vector<Node *>& newNodes, bool& order, MergePoints& commonNode)
{
std::list< IntersectElement > listOfIntesc=getIntersectionsCharacteristicVal();
std::list< IntersectElement >::iterator iter;
return true;
}
+/*! If the 2 edges share one extremity, we can optimize since we already know where is the intersection.
+ * In the case of ArcCSegIntersector, this also helps avoid degenerated cases.
+ */
+void EdgeIntersector::identifyEarlyIntersection(bool& i1S2S, bool& i1E2S, bool& i1S2E, bool& i1E2E)
+{
+ i1S2S = _e1.getStartNode() == _e2.getStartNode();
+ i1E2S = _e1.getEndNode() == _e2.getStartNode();
+ i1S2E = _e1.getStartNode() == _e2.getEndNode();
+ i1E2E = _e1.getEndNode() == _e2.getEndNode();
+ if (i1S2S || i1E2S || i1S2E || i1E2E)
+ {
+ Node * node;
+ bool i_1S(false),i_1E(false),i_2S(false),i_2E(false);
+ if (i1S2S || i1E2S) // Common node is e2 start
+ {
+ node = _e2.getStartNode();
+ i_1S = i1S2S; i_2S = true;
+ i_1E = i1E2S; i_2E = false;
+ }
+ else // Common node is e2 end
+ {
+ node = _e2.getEndNode();
+ i_1S = i1S2E; i_2S = false;
+ i_1E = i1E2E; i_2E = true;
+ }
+ node->incrRef();
+ _earlyInter = new IntersectElement(_e1.getCharactValue(*node), _e2.getCharactValue(*node),
+ i_1S,i_1E,i_2S,i_2E,node,_e1,_e2,keepOrder());
+ }
+}
+
/*!
* Locates 'node' regarding edge this->_e1. If node is located close to (with distant lt epsilon) start or end point of _e1,
* 'node' takes its place. In this case 'obvious' is set to true and 'commonNode' stores information of merge point and finally 'where' is set.
delete merge;
merge=0;
EdgeIntersector *intersector=BuildIntersectorWith(this,other);
- ret=Intersect(this,other,intersector,merge,commonNode,outVal1,outVal2);
+ ret=Intersect(this,other,intersector,commonNode,outVal1,outVal2);
delete intersector;
return ret;
}
ComposedEdge *f2=new ComposedEdge;
SegSegIntersector inters(*e1,*e2);
bool b1,b2;
- inters.areOverlappedOrOnlyColinears(0,b1,b2);
+ inters.areOverlappedOrOnlyColinears(b1,b2);
if(IntersectOverlapped(e1,e2,&inters,commonNode,*f1,*f2))
{
result[i][j]=f1->getCommonLengthWith(*f2)/e1->getCurveLength();
return getMiddleOfPoints(p1, p2, mid);
}
-bool Edge::Intersect(const Edge *f1, const Edge *f2, EdgeIntersector *intersector, const Bounds *whereToFind, MergePoints& commonNode,
+bool Edge::Intersect(const Edge *f1, const Edge *f2, EdgeIntersector *intersector, MergePoints& commonNode,
ComposedEdge& outValForF1, ComposedEdge& outValForF2)
{
bool obviousNoIntersection;
bool areOverlapped;
- intersector->areOverlappedOrOnlyColinears(whereToFind,obviousNoIntersection,areOverlapped);
+ intersector->areOverlappedOrOnlyColinears(obviousNoIntersection,areOverlapped);
if(areOverlapped)
return IntersectOverlapped(f1,f2,intersector,commonNode,outValForF1,outValForF2);
if(obviousNoIntersection)
return false;
std::vector<Node *> newNodes;
bool order;
- if(intersector->intersect(whereToFind,newNodes,order,commonNode))
+ if(intersector->intersect(newNodes,order,commonNode))
{
if(newNodes.empty())
throw Exception("Internal error occurred - error in intersector implementation!");// This case should never happen
}
return true;
}
- else//no intersection inside whereToFind
+ else
return false;
}
}
}
+void Edge::dumpToCout(const std::map<INTERP_KERNEL::Node *,int>& mapp, int index) const
+{
+ auto sI(mapp.find(getStartNode())), eI(mapp.find(getEndNode()));
+ int start = (sI == mapp.end() ? -1 : sI->second), end = (eI == mapp.end() ? -1 : eI->second);
+ std::string locs;
+ switch (getLoc())
+ {
+ case FULL_IN_1: locs="FULL_IN_1"; break;
+ case FULL_ON_1: locs="FULL_ON_1"; break;
+ case FULL_OUT_1: locs="FULL_OUT_1"; break;
+ case FULL_UNKNOWN: locs="FULL_UNKNOWN"; break;
+ default: locs="oh my God! This is so wrong.";
+ }
+ std::cout << "Edge [" << index << "] : ("<< std::hex << this << std::dec << ") -> (" << start << ", " << end << ")\t" << locs << std::endl;
+}
+
bool Edge::isEqual(const Edge& other) const
{
return _start->isEqual(*other._start) && _end->isEqual(*other._end);
for(std::vector< std::pair<double,Node *> >::const_iterator it=an2.begin();it!=an2.end();it++)
{
int idd=(*mapp2.find((*it).second)).second;
- if((*it).first<QuadraticPlanarPrecision::getPrecision())
- {
- startId=idd;
- continue;
- }
- if((*it).first>1-QuadraticPlanarPrecision::getPrecision())
- {
- endId=idd;
- continue;
- }
tmpp.push_back(idd);
}
std::vector<int> tmpp2(tmpp.size()+2);
edgesThis.push_back(tmpp2[i+1]);
}
}
+
+void Edge::fillGlobalInfoAbs(bool direction, const std::map<INTERP_KERNEL::Node *,int>& mapThis, const std::map<INTERP_KERNEL::Node *,int>& mapOther, int offset1, int offset2, double fact, double baryX, double baryY,
+ std::vector<int>& edgesThis, std::vector<double>& addCoo, std::map<INTERP_KERNEL::Node *,int> mapAddCoo) const
+{
+ int tmp[2];
+ _start->fillGlobalInfoAbs(mapThis,mapOther,offset1,offset2,fact,baryX,baryY,addCoo,mapAddCoo,tmp);
+ _end->fillGlobalInfoAbs(mapThis,mapOther,offset1,offset2,fact,baryX,baryY,addCoo,mapAddCoo,tmp+1);
+ if(direction)
+ {
+ edgesThis.push_back(tmp[0]);
+ edgesThis.push_back(tmp[1]);
+ }
+ else
+ {
+ edgesThis.push_back(tmp[1]);
+ edgesThis.push_back(tmp[0]);
+ }
+}
+
+void Edge::fillGlobalInfoAbs2(const std::map<INTERP_KERNEL::Node *,int>& mapThis, const std::map<INTERP_KERNEL::Node *,int>& mapOther, int offset1, int offset2, double fact, double baryX, double baryY,
+ short skipStartOrEnd,
+ std::vector<int>& edgesOther, std::vector<double>& addCoo, std::map<INTERP_KERNEL::Node *,int>& mapAddCoo) const
+{
+ if (skipStartOrEnd != -1) // see meaning in splitAbs()
+ _start->fillGlobalInfoAbs2(mapThis,mapOther,offset1,offset2,fact,baryX,baryY,addCoo,mapAddCoo,edgesOther);
+ if (skipStartOrEnd != 1)
+ _end->fillGlobalInfoAbs2(mapThis,mapOther,offset1,offset2,fact,baryX,baryY,addCoo,mapAddCoo,edgesOther);
+}
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
{
protected:
//! All non symmetric methods are relative to 'e1'.
- EdgeIntersector(const Edge& e1, const Edge& e2):_e1(e1),_e2(e2) { }
+ EdgeIntersector(const Edge& e1, const Edge& e2):_e1(e1),_e2(e2), _earlyInter(0) { }
public:
- virtual ~EdgeIntersector() { }
+ virtual ~EdgeIntersector() { if(_earlyInter) delete(_earlyInter); }
virtual bool keepOrder() const = 0;
virtual bool areColinears() const = 0;
//!to call only if 'areOverlapped' have been set to true when areOverlappedOrOnlyColinears was called
//!to call only if 'areOverlapped' have been set to true when areOverlappedOrOnlyColinears was called
virtual void getPlacements(Node *start, Node *end, TypeOfLocInEdge& whereStart, TypeOfLocInEdge& whereEnd, MergePoints& commonNode) const = 0;
//! When true is returned, newNodes should contains at least 1 element. All merging nodes betw _e1 and _e2 extremities must be done.
- bool intersect(const Bounds *whereToFind, std::vector<Node *>& newNodes, bool& order, MergePoints& commonNode);
+ bool intersect(std::vector<Node *>& newNodes, bool& order, MergePoints& commonNode);
//! Should be called only once per association.
- virtual void areOverlappedOrOnlyColinears(const Bounds *whereToFind, bool& obviousNoIntersection, bool& areOverlapped) = 0;
+ virtual void areOverlappedOrOnlyColinears(bool& obviousNoIntersection, bool& areOverlapped) = 0;
//! The size of returned vector is equal to number of potential intersections point. The values are so that their are interpretable by virtual Edge::isIn method.
virtual std::list< IntersectElement > getIntersectionsCharacteristicVal() const = 0;
protected:
void obviousCaseForCurvAbscisse(Node *node, TypeOfLocInEdge& where, MergePoints& commonNode, bool& obvious) const;
+ virtual void identifyEarlyIntersection(bool& , bool&, bool&, bool&);
protected:
const Edge& _e1;
const Edge& _e2;
+ IntersectElement *_earlyInter; // Non null if the intersection can be determined early -> see areOverlappedOrOnlyColinears()
};
class INTERPKERNEL_EXPORT SameTypeEdgeIntersector : public EdgeIntersector
static void Interpolate1DLin(const std::vector<double>& distrib1, const std::vector<double>& distrib2,
std::map<int, std::map<int,double> >& result);
virtual void dumpInXfigFile(std::ostream& stream, bool direction, int resolution, const Bounds& box) const = 0;
+ void dumpToCout(const std::map<INTERP_KERNEL::Node *,int>& mapp, int index) const;
bool isEqual(const Edge& other) const;
public:
bool sortSubNodesAbs(const double *coo, std::vector<int>& subNodes);
void sortIdsAbs(const std::vector<INTERP_KERNEL::Node *>& addNodes, const std::map<INTERP_KERNEL::Node *, int>& mapp1, const std::map<INTERP_KERNEL::Node *, int>& mapp2, std::vector<int>& edgesThis);
- virtual void fillGlobalInfoAbs(bool direction, const std::map<INTERP_KERNEL::Node *,int>& mapThis, const std::map<INTERP_KERNEL::Node *,int>& mapOther, int offset1, int offset2, double fact, double baryX, double baryY,
- std::vector<int>& edgesThis, std::vector<double>& addCoo, std::map<INTERP_KERNEL::Node *,int> mapAddCoo) const = 0;
- virtual void fillGlobalInfoAbs2(const std::map<INTERP_KERNEL::Node *,int>& mapThis, const std::map<INTERP_KERNEL::Node *,int>& mapOther, int offset1, int offset2, double fact, double baryX, double baryY,
- std::vector<int>& edgesOther, std::vector<double>& addCoo, std::map<INTERP_KERNEL::Node *,int>& mapAddCoo) const = 0;
virtual Edge *buildEdgeLyingOnMe(Node *start, Node *end, bool direction=true) const = 0;
+ void fillGlobalInfoAbs(bool direction, const std::map<INTERP_KERNEL::Node *,int>& mapThis, const std::map<INTERP_KERNEL::Node *,int>& mapOther, int offset1, int offset2, double fact, double baryX, double baryY,
+ std::vector<int>& edgesThis, std::vector<double>& addCoo, std::map<INTERP_KERNEL::Node *,int> mapAddCoo) const;
+ void fillGlobalInfoAbs2(const std::map<INTERP_KERNEL::Node *,int>& mapThis, const std::map<INTERP_KERNEL::Node *,int>& mapOther, int offset1, int offset2, double fact, double baryX, double baryY,
+ short skipStartOrEnd,
+ std::vector<int>& edgesOther, std::vector<double>& addCoo, std::map<INTERP_KERNEL::Node *,int>& mapAddCoo) const;
+
protected:
Edge():_cnt(1),_loc(FULL_UNKNOWN),_start(0),_end(0) { }
virtual ~Edge();
static int CombineCodes(TypeOfLocInEdge code1, TypeOfLocInEdge code2);
- static bool Intersect(const Edge *f1, const Edge *f2, EdgeIntersector *intersector, const Bounds *whereToFind, MergePoints& commonNode,
+ static bool Intersect(const Edge *f1, const Edge *f2, EdgeIntersector *intersector, MergePoints& commonNode,
ComposedEdge& outValForF1, ComposedEdge& outValForF2);
//! The code 'code' is built by method combineCodes
static bool SplitOverlappedEdges(const Edge *e1, const Edge *e2, Node *nS, Node *nE, bool direction, int code,
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
return Node::areDoubleEqualsWPRight(a,1.,2.);
}
-void ArcCArcCIntersector::areOverlappedOrOnlyColinears(const Bounds *whereToFind, bool& obviousNoIntersection, bool& areOverlapped)
+void ArcCArcCIntersector::areOverlappedOrOnlyColinears(bool& obviousNoIntersection, bool& areOverlapped)
{
_dist=Node::distanceBtw2Pt(getE1().getCenter(),getE2().getCenter());
double radius1=getE1().getRadius(); double radius2=getE2().getRadius();
}
return ret;*/
-ArcCSegIntersector::ArcCSegIntersector(const EdgeArcCircle& e1, const EdgeLin& e2, bool reverse):CrossTypeEdgeIntersector(e1,e2,reverse)
+ArcCSegIntersector::ArcCSegIntersector(const EdgeArcCircle& e1, const EdgeLin& e2, bool reverse):
+ CrossTypeEdgeIntersector(e1,e2,reverse),
+ _deltaRoot_div_dr(0.),
+ _i1S2E(false),_i1E2E(false)
{
+ const double *center=getE1().getCenter();
+ _dx=(*(_e2.getEndNode()))[0]-(*(_e2.getStartNode()))[0];
+ _dy=(*(_e2.getEndNode()))[1]-(*(_e2.getStartNode()))[1];
+ _drSq=_dx*_dx+_dy*_dy;
+ _cross=
+ ((*(_e2.getStartNode()))[0]-center[0])*((*(_e2.getEndNode()))[1]-center[1])-
+ ((*(_e2.getStartNode()))[1]-center[1])*((*(_e2.getEndNode()))[0]-center[0]);
}
/**
See http://mathworld.wolfram.com/Circle-LineIntersection.html
- _cross is 'D', the computation is done with the translation to put back the circle at the origin.s
+ _cross is 'D', the computation is done with the translation to put back the circle at the origin
*/
-void ArcCSegIntersector::areOverlappedOrOnlyColinears(const Bounds *whereToFind, bool& obviousNoIntersection, bool& areOverlapped)
+void ArcCSegIntersector::areOverlappedOrOnlyColinears(bool& obviousNoIntersection, bool& areOverlapped)
{
areOverlapped=false;//No overlapping by construction
- const double *center=getE1().getCenter();
+
+ // Similar optimisation than SegSegIntersector::areOverlappedOrOnlyColinears()
+ bool dnu1, dnu2;
+ identifyEarlyIntersection(dnu1, dnu2, _i1S2E, _i1E2E);
+
const double R = getE1().getRadius();
- _dx=(*(_e2.getEndNode()))[0]-(*(_e2.getStartNode()))[0];
- _dy=(*(_e2.getEndNode()))[1]-(*(_e2.getStartNode()))[1];
- _drSq=_dx*_dx+_dy*_dy;
- _cross=
- ((*(_e2.getStartNode()))[0]-center[0])*((*(_e2.getEndNode()))[1]-center[1])-
- ((*(_e2.getStartNode()))[1]-center[1])*((*(_e2.getEndNode()))[0]-center[0]);
// We need to compute d = R*R-_cross*_cross/_drSq
// In terms of numerical precision, this can trigger 'catastrophic cancellation' and is hence better expressed as:
double d = add*diff;
// Compute deltaRoot_div_dr := sqrt(delta)/dr, where delta has the meaning of Wolfram.
// Then 2*deltaRoot_div_dr is the distance between the two intersection points of the line with the circle. This is what we compare to eps.
- // We compute it in such a way that it can be used in tests too (a very negative value means we're far apart from intersection)
+ // We compute it in such a way that it can be used in boolean tests too (a very negative value means we're far apart from intersection)
_deltaRoot_div_dr = Node::sign(d)*sqrt(fabs(d));
if( 2*_deltaRoot_div_dr > -QuadraticPlanarPrecision::getPrecision())
std::list< IntersectElement > ret;
const double *center=getE1().getCenter();
if(!(2*fabs(_deltaRoot_div_dr) < QuadraticPlanarPrecision::getPrecision())) // see comments in areOverlappedOrOnlyColinears()
- {
+ { // Two intersection nodes
+ // -> if a common node found, there is a chance that this is the only one (i.e. second intersection point is outside e1 and e2)
+ if(_earlyInter)
+ {
+ // Check tangent vector of the arc circle at the common node with the linear segment.
+ // There we can tell if the arc of circle is 'moving away' from the seg, or if it might intersect it twice
+ const Node &n(*_earlyInter->getNodeOnly());
+ const double * center(getE1().getCenter());
+
+ double tang[2] = {-(n[1]-center[1]), n[0]-center[0]}; // (-y, x) is the tangent vector in the trigo direction with (x,y) = (center->node)
+ bool invSeg = _i1S2E || _i1E2E;
+ double linEdge[2] = {invSeg ? (-_dx) : _dx, invSeg ? (-_dy) : _dy};
+ if(tang[1]*linEdge[0]-tang[0]*linEdge[1] < 0)
+ {
+ ret.push_back(*_earlyInter);
+ return ret;
+ }
+ }
+
double determinant=fabs(_deltaRoot_div_dr)/sqrt(_drSq);
double x1=(_cross*_dy/_drSq+Node::sign(_dy)*_dx*determinant)+center[0];
double y1=(-_cross*_dx/_drSq+fabs(_dy)*determinant)+center[1];
Node *intersect1=new Node(x1,y1); intersect1->declareOn();
- bool i1_1S=_e1.getStartNode()->isEqual(*intersect1);
- bool i1_1E=_e1.getEndNode()->isEqual(*intersect1);
- bool i1_2S=_e2.getStartNode()->isEqual(*intersect1);
- bool i1_2E=_e2.getEndNode()->isEqual(*intersect1);
- ret.push_back(IntersectElement(getE1().getCharactValue(*intersect1),getE2().getCharactValue(*intersect1),i1_1S,i1_1E,i1_2S,i1_2E,intersect1,_e1,_e2,keepOrder()));
- //
double x2=(_cross*_dy/_drSq-Node::sign(_dy)*_dx*determinant)+center[0];
double y2=(-_cross*_dx/_drSq-fabs(_dy)*determinant)+center[1];
Node *intersect2=new Node(x2,y2); intersect2->declareOn();
- bool i2_1S=_e1.getStartNode()->isEqual(*intersect2);
- bool i2_1E=_e1.getEndNode()->isEqual(*intersect2);
- bool i2_2S=_e2.getStartNode()->isEqual(*intersect2);
- bool i2_2E=_e2.getEndNode()->isEqual(*intersect2);
- ret.push_back(IntersectElement(getE1().getCharactValue(*intersect2),getE2().getCharactValue(*intersect2),i2_1S,i2_1E,i2_2S,i2_2E,intersect2,_e1,_e2,keepOrder()));
+
+ bool isN1(false), isN2(false);
+ if (_earlyInter)
+ {
+ // Which node do we actually already found? Assume this is the closest ...
+ const Node &iN = *(_earlyInter->getNodeOnly());
+ const Node &n1(*intersect1), &n2(*intersect2);
+ double d1 = std::max(fabs(iN[0]-n1[0]), fabs(iN[1]-n1[1]));
+ double d2 = std::max(fabs(iN[0]-n2[0]), fabs(iN[1]-n2[1]));
+ isN1 = d1 < d2; isN2 = !isN1;
+ if (isN1) intersect1->decrRef();
+ if (isN2) intersect2->decrRef();
+ ret.push_back(*_earlyInter);
+ }
+ if (!isN1)
+ {
+ bool i1_1S=_e1.getStartNode()->isEqual(*intersect1);
+ bool i1_1E=_e1.getEndNode()->isEqual(*intersect1);
+ bool i1_2S=_e2.getStartNode()->isEqual(*intersect1);
+ bool i1_2E=_e2.getEndNode()->isEqual(*intersect1);
+ ret.push_back(IntersectElement(getE1().getCharactValue(*intersect1),getE2().getCharactValue(*intersect1),i1_1S,i1_1E,i1_2S,i1_2E,intersect1,_e1,_e2,keepOrder()));
+ }
+ if(!isN2)
+ {
+ bool i2_1S=_e1.getStartNode()->isEqual(*intersect2);
+ bool i2_1E=_e1.getEndNode()->isEqual(*intersect2);
+ bool i2_2S=_e2.getStartNode()->isEqual(*intersect2);
+ bool i2_2E=_e2.getEndNode()->isEqual(*intersect2);
+ ret.push_back(IntersectElement(getE1().getCharactValue(*intersect2),getE2().getCharactValue(*intersect2),i2_1S,i2_1E,i2_2S,i2_2E,intersect2,_e1,_e2,keepOrder()));
+ }
}
else//tangent intersection
{
+ if (_earlyInter)
+ {
+ ret.push_back(*_earlyInter);
+ return ret;
+ }
double x=(_cross*_dy)/_drSq+center[0];
double y=(-_cross*_dx)/_drSq+center[1];
Node *intersect3=new Node(x,y); intersect3->declareOnTangent();
if(IsIn2Pi(_angle0,_angle,M_PI))
_bounds[0]=_center[0]-_radius;
}
-
-void EdgeArcCircle::fillGlobalInfoAbs(bool direction, const std::map<INTERP_KERNEL::Node *,int>& mapThis, const std::map<INTERP_KERNEL::Node *,int>& mapOther, int offset1, int offset2, double fact, double baryX, double baryY,
- std::vector<int>& edgesThis, std::vector<double>& addCoo, std::map<INTERP_KERNEL::Node *,int> mapAddCoo) const
-{
- int tmp[2];
- _start->fillGlobalInfoAbs(mapThis,mapOther,offset1,offset2,fact,baryX,baryY,addCoo,mapAddCoo,tmp);
- _end->fillGlobalInfoAbs(mapThis,mapOther,offset1,offset2,fact,baryX,baryY,addCoo,mapAddCoo,tmp+1);
- if(direction)
- {
- edgesThis.push_back(tmp[0]);
- edgesThis.push_back(tmp[1]);
- }
- else
- {
- edgesThis.push_back(tmp[1]);
- edgesThis.push_back(tmp[0]);
- }
-}
-
-void EdgeArcCircle::fillGlobalInfoAbs2(const std::map<INTERP_KERNEL::Node *,int>& mapThis, const std::map<INTERP_KERNEL::Node *,int>& mapOther, int offset1, int offset2, double fact, double baryX, double baryY,
- std::vector<int>& edgesOther, std::vector<double>& addCoo, std::map<INTERP_KERNEL::Node *,int>& mapAddCoo) const
-{
- _start->fillGlobalInfoAbs2(mapThis,mapOther,offset1,offset2,fact,baryX,baryY,addCoo,mapAddCoo,edgesOther);
- _end->fillGlobalInfoAbs2(mapThis,mapOther,offset1,offset2,fact,baryX,baryY,addCoo,mapAddCoo,edgesOther);
-}
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
bool haveTheySameDirection() const;
bool areColinears() const;
void getPlacements(Node *start, Node *end, TypeOfLocInEdge& whereStart, TypeOfLocInEdge& whereEnd, MergePoints& commonNode) const;
- void areOverlappedOrOnlyColinears(const Bounds *whereToFind, bool& obviousNoIntersection, bool& areOverlapped);
+ void areOverlappedOrOnlyColinears(bool& obviousNoIntersection, bool& areOverlapped);
std::list< IntersectElement > getIntersectionsCharacteristicVal() const;
private:
//! return angle in ]-Pi;Pi[ - 'node' must be on curve of '_e1'
const EdgeArcCircle& getE1() const { return (const EdgeArcCircle&)_e1; }
const EdgeArcCircle& getE2() const { return (const EdgeArcCircle&)_e2; }
private:
- double _dist;
+ double _dist; // distance between the two arc centers
};
/**
//virtual overloading
bool areColinears() const;
void getPlacements(Node *start, Node *end, TypeOfLocInEdge& whereStart, TypeOfLocInEdge& whereEnd, MergePoints& commonNode) const;
- void areOverlappedOrOnlyColinears(const Bounds *whereToFind, bool& obviousNoIntersection, bool& areOverlapped);
+ void areOverlappedOrOnlyColinears(bool& obviousNoIntersection, bool& areOverlapped);
std::list< IntersectElement > getIntersectionsCharacteristicVal() const;
private:
const EdgeArcCircle& getE1() const { return (const EdgeArcCircle&)_e1; }
double _drSq; //!< Square of the norm of the seg
double _cross; //!< See areOverlappedOrOnlyColinears()
double _deltaRoot_div_dr; //!< See areOverlappedOrOnlyColinears()
+ bool _i1S2E,_i1E2E;
};
class INTERPKERNEL_EXPORT EdgeArcCircle : public Edge
protected:
void updateBounds();
Edge *buildEdgeLyingOnMe(Node *start, Node *end, bool direction=true) const;
- void fillGlobalInfoAbs(bool direction, const std::map<INTERP_KERNEL::Node *,int>& mapThis, const std::map<INTERP_KERNEL::Node *,int>& mapOther, int offset1, int offset2, double fact, double baryX, double baryY,
- std::vector<int>& edgesThis, std::vector<double>& addCoo, std::map<INTERP_KERNEL::Node *,int> mapAddCoo) const;
- void fillGlobalInfoAbs2(const std::map<INTERP_KERNEL::Node *,int>& mapThis, const std::map<INTERP_KERNEL::Node *,int>& mapOther, int offset1, int offset2, double fact, double baryX, double baryY,
- std::vector<int>& edgesOther, std::vector<double>& addCoo, std::map<INTERP_KERNEL::Node *,int>& mapAddCoo) const;
+
protected:
//! Absolute angle where the arc starts. Value between -Pi and Pi
double _angle0;
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
extern const unsigned MAX_SIZE_OF_LINE_XFIG_FILE=1024;
}
-SegSegIntersector::SegSegIntersector(const EdgeLin& e1, const EdgeLin& e2):SameTypeEdgeIntersector(e1,e2)
+SegSegIntersector::SegSegIntersector(const EdgeLin& e1, const EdgeLin& e2):
+ SameTypeEdgeIntersector(e1,e2)
{
- _matrix[0]=(*(e2.getStartNode()))[0]-(*(e2.getEndNode()))[0];
- _matrix[1]=(*(e1.getEndNode()))[0]-(*(e1.getStartNode()))[0];
- _matrix[2]=(*(e2.getStartNode()))[1]-(*(e2.getEndNode()))[1];
- _matrix[3]=(*(e1.getEndNode()))[1]-(*(e1.getStartNode()))[1];
- _col[0]=_matrix[3]*(*(e1.getStartNode()))[0]-_matrix[1]*(*(e1.getStartNode()))[1];
- _col[1]=-_matrix[2]*(*(e2.getStartNode()))[0]+_matrix[0]*(*(e2.getStartNode()))[1];
+ _matrix[0]=(*(e1.getEndNode()))[0]-(*(e1.getStartNode()))[0];
+ _matrix[1]=(*(e1.getEndNode()))[1]-(*(e1.getStartNode()))[1];
+ _matrix[2]=(*(e2.getEndNode()))[0]-(*(e2.getStartNode()))[0];
+ _matrix[3]=(*(e2.getEndNode()))[1]-(*(e2.getStartNode()))[1];
+
+ _determinant=_matrix[0]*_matrix[3]-_matrix[1]*_matrix[2];
+
+ _col[0]=_matrix[1]*(*(e1.getStartNode()))[0]-_matrix[0]*(*(e1.getStartNode()))[1];
+ _col[1]=_matrix[3]*(*(e2.getStartNode()))[0]-_matrix[2]*(*(e2.getStartNode()))[1];
+
//Little trick to avoid problems if 'e1' and 'e2' are colinears and along Ox or Oy axes.
- if(fabs(_matrix[3])>fabs(_matrix[1]))
+ if(fabs(_matrix[1])>fabs(_matrix[0]))
_ind=0;
else
_ind=1;
/*!
* Must be called when 'this' and 'other' have been detected to be at least colinear. Typically they are overlapped.
- * Must be called after call of areOverlappedOrOnlyColinears.
*/
bool SegSegIntersector::haveTheySameDirection() const
{
- return (_matrix[3]*_matrix[1]+_matrix[2]*_matrix[0])>0.;
- //return (_matrix[_ind?1:0]>0. && _matrix[_ind?3:2]>0.) || (_matrix[_ind?1:0]<0. && _matrix[_ind?3:2]<0.);
+ return (_matrix[0]*_matrix[2]+_matrix[1]*_matrix[3])>0.;
}
/*!
std::list< IntersectElement > SegSegIntersector::getIntersectionsCharacteristicVal() const
{
std::list< IntersectElement > ret;
- double x=_matrix[0]*_col[0]+_matrix[1]*_col[1];
- double y=_matrix[2]*_col[0]+_matrix[3]*_col[1];
+ if (_earlyInter)
+ {
+ // Intersection was already found: it is a common node shared by _e1 and _e2 - see areOverlappedOrOnlyColinears()
+ ret.push_back(*_earlyInter);
+ return ret;
+ }
+
+ double x= (-_matrix[2]*_col[0]+_matrix[0]*_col[1]) / _determinant;
+ double y= (-_matrix[3]*_col[0]+_matrix[1]*_col[1]) / _determinant;
//Only one intersect point possible
Node *node=new Node(x,y);
node->declareOn();
*/
bool SegSegIntersector::areColinears() const
{
- Bounds b;
- b.prepareForAggregation();
- b.aggregate(_e1.getBounds());
- b.aggregate(_e2.getBounds());
- double determinant=_matrix[0]*_matrix[3]-_matrix[1]*_matrix[2];
- double dimChar=b.getCaracteristicDim();
-
- return fabs(determinant)< 2.*dimChar*QuadraticPlanarPrecision::getPrecision(); // same criteria as in areOverlappedOrOnlyColinears, see comment below
+ Bounds b1, b2;
+ b1.prepareForAggregation();
+ b2.prepareForAggregation();
+ b1.aggregate(_e1.getBounds());
+ b2.aggregate(_e2.getBounds());
+ double dimCharE1(b1.getCaracteristicDim()) ,dimCharE2(b2.getCaracteristicDim());
+
+ // same criteria as in areOverlappedOrOnlyColinears, see comment below
+ return fabs(_determinant)<dimCharE1*dimCharE2*QuadraticPlanarPrecision::getPrecision();
}
/*!
* \param areOverlapped if colinearity if true, this parameter looks if e1 and e2 are overlapped, i.e. is they lie on the same line (= this is different from
* a true intersection, two segments can be in "overlap" mode, without intersecting)
*/
-void SegSegIntersector::areOverlappedOrOnlyColinears(const Bounds *whereToFind, bool& obviousNoIntersection, bool& areOverlapped)
+void SegSegIntersector::areOverlappedOrOnlyColinears(bool& obviousNoIntersection, bool& areOverlapped)
{
- double determinant=_matrix[0]*_matrix[3]-_matrix[1]*_matrix[2];
- Bounds b;
- b.prepareForAggregation();
- b.aggregate(_e1.getBounds());
- b.aggregate(_e2.getBounds());
- double dimChar=b.getCaracteristicDim();
+ Bounds b1, b2;
+ b1.prepareForAggregation();
+ b2.prepareForAggregation();
+ b1.aggregate(_e1.getBounds());
+ b2.aggregate(_e2.getBounds());
+ double dimCharE1(b1.getCaracteristicDim()) ,dimCharE2(b2.getCaracteristicDim());
// Same criteria as in areColinears(), see doc.
- // [ABN] the 2 is not really justified, but the initial tests from Tony were written so closely to precision that I can't bother to change all of them ...
- if(fabs(determinant)>2.*dimChar*QuadraticPlanarPrecision::getPrecision())
+ if(fabs(_determinant)>dimCharE1*dimCharE2*QuadraticPlanarPrecision::getPrecision()) // Non colinear vectors
{
- obviousNoIntersection=false; areOverlapped=false;
- _matrix[0]/=determinant; _matrix[1]/=determinant; _matrix[2]/=determinant; _matrix[3]/=determinant;
+ areOverlapped=false;
+ obviousNoIntersection=false;
+
+ // If they share one extremity, we can optimize since we already know where is the intersection:
+ bool a,b,c,d;
+ identifyEarlyIntersection(a,b,c,d);
}
- else // colinear vectors
+ else // Colinear vectors
{
- //retrieving initial matrix and shuffling it (will be used in getIntersectionsCharacteristicVal())
- double tmp=_matrix[0]; _matrix[0]=_matrix[3]; _matrix[3]=tmp;
- _matrix[1]=-_matrix[1]; _matrix[2]=-_matrix[2];
- //
- double x=(*(_e1.getStartNode()))[0]-(*(_e2.getStartNode()))[0];
- double y=(*(_e1.getStartNode()))[1]-(*(_e2.getStartNode()))[1]; // (x,y) is the vector between the two start points of e1 and e2
- areOverlapped = fabs(_matrix[1]*y+_matrix[0]*x) < dimChar*QuadraticPlanarPrecision::getPrecision(); // test colinearity of (x,y) with e1
-
+ // Compute vectors joining tips of e1 and e2
+ double xS=(*(_e1.getStartNode()))[0]-(*(_e2.getStartNode()))[0];
+ double yS=(*(_e1.getStartNode()))[1]-(*(_e2.getStartNode()))[1];
+ double xE=(*(_e1.getEndNode()))[0]-(*(_e2.getEndNode()))[0];
+ double yE=(*(_e1.getEndNode()))[1]-(*(_e2.getEndNode()))[1];
+ double maxDimS(std::max(fabs(xS),fabs(yS))), maxDimE(std::max(fabs(xE), fabs(yE)));
+ bool isS = (maxDimS > maxDimE), isE1 = (dimCharE1 >= dimCharE2);
+ double x = isS ? xS : xE;
+ double y = isS ? yS : yE;
+ unsigned shift = isE1 ? 0 : 2;
+ // test colinearity of the greatest tip-joining vector and greatest vector among {e1, e2}
+ areOverlapped = fabs(x*_matrix[1+shift]-y*_matrix[0+shift]) < dimCharE1*dimCharE2*QuadraticPlanarPrecision::getPrecision();
// explanation: if areOverlapped is true, we don't know yet if there will be an intersection (see meaning of areOverlapped in method doxy above)
// if areOverlapped is false, we have two colinear vectors, not lying on the same line, so we're sure there is no intersec
obviousNoIntersection = !areOverlapped;
double car1_1y=node[1]-(*(_start))[1]; double car1_2y=(*(_end))[1]-(*(_start))[1];
return (car1_1x*car1_2x+car1_1y*car1_2y)/(car1_2x*car1_2x+car1_2y*car1_2y);
}
-
-void EdgeLin::fillGlobalInfoAbs(bool direction, const std::map<INTERP_KERNEL::Node *,int>& mapThis, const std::map<INTERP_KERNEL::Node *,int>& mapOther, int offset1, int offset2, double fact, double baryX, double baryY,
- std::vector<int>& edgesThis, std::vector<double>& addCoo, std::map<INTERP_KERNEL::Node *,int> mapAddCoo) const
-{
- int tmp[2];
- _start->fillGlobalInfoAbs(mapThis,mapOther,offset1,offset2,fact,baryX,baryY,addCoo,mapAddCoo,tmp);
- _end->fillGlobalInfoAbs(mapThis,mapOther,offset1,offset2,fact,baryX,baryY,addCoo,mapAddCoo,tmp+1);
- if(direction)
- {
- edgesThis.push_back(tmp[0]);
- edgesThis.push_back(tmp[1]);
- }
- else
- {
- edgesThis.push_back(tmp[1]);
- edgesThis.push_back(tmp[0]);
- }
-}
-
-void EdgeLin::fillGlobalInfoAbs2(const std::map<INTERP_KERNEL::Node *,int>& mapThis, const std::map<INTERP_KERNEL::Node *,int>& mapOther, int offset1, int offset2, double fact, double baryX, double baryY,
- std::vector<int>& edgesOther, std::vector<double>& addCoo, std::map<INTERP_KERNEL::Node *,int>& mapAddCoo) const
-{
- _start->fillGlobalInfoAbs2(mapThis,mapOther,offset1,offset2,fact,baryX,baryY,addCoo,mapAddCoo,edgesOther);
- _end->fillGlobalInfoAbs2(mapThis,mapOther,offset1,offset2,fact,baryX,baryY,addCoo,mapAddCoo,edgesOther);
-}
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
bool areColinears() const;
bool haveTheySameDirection() const;
void getPlacements(Node *start, Node *end, TypeOfLocInEdge& whereStart, TypeOfLocInEdge& whereEnd, MergePoints& commonNode) const;
- void areOverlappedOrOnlyColinears(const Bounds *whereToFind, bool& obviousNoIntersection, bool& areOverlapped);
+ void areOverlappedOrOnlyColinears(bool& obviousNoIntersection, bool& areOverlapped);
std::list< IntersectElement > getIntersectionsCharacteristicVal() const;
private:
void getCurveAbscisse(Node *node, TypeOfLocInEdge& where, MergePoints& commonNode) const;
//! index on which all single index op will be performed. Filled in case colinearity is equal to true.
int _ind;
double _col[2];
- double _matrix[4];//SPACEDIM*SPACEDIM
+ double _matrix[4]; //SPACEDIM*SPACEDIM = [e1_x, e1_y, e2_x, e2_y]
+ double _determinant;
};
class INTERPKERNEL_EXPORT EdgeLin : public Edge
EdgeLin() { }
void updateBounds();
Edge *buildEdgeLyingOnMe(Node *start, Node *end, bool direction) const;
- void fillGlobalInfoAbs(bool direction, const std::map<INTERP_KERNEL::Node *,int>& mapThis, const std::map<INTERP_KERNEL::Node *,int>& mapOther, int offset1, int offset2, double fact, double baryX, double baryY,
- std::vector<int>& edgesThis, std::vector<double>& addCoo, std::map<INTERP_KERNEL::Node *,int> mapAddCoo) const;
- void fillGlobalInfoAbs2(const std::map<INTERP_KERNEL::Node *,int>& mapThis, const std::map<INTERP_KERNEL::Node *,int>& mapOther, int offset1, int offset2, double fact, double baryX, double baryY,
- std::vector<int>& edgesOther, std::vector<double>& addCoo, std::map<INTERP_KERNEL::Node *,int>& mapAddCoo) const;
};
}
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
output.insert(_ptr->getEndNode());
}
+bool ElementaryEdge::hasSameExtremities(const ElementaryEdge& other) const
+{
+ std::set<Node *> s1, s2;
+ getAllNodes(s1);
+ other.getAllNodes(s2);
+ return (s1 == s2);
+}
+
void ElementaryEdge::getBarycenter(double *bary, double& weigh) const
{
_ptr->getBarycenter(bary);
_ptr->dumpInXfigFile(stream,_direction,resolution,box);
}
+void ElementaryEdge::dumpToCout(const std::map<INTERP_KERNEL::Node *,int>& mapp, int index) const
+{
+ _ptr->dumpToCout(mapp, index);
+}
+
bool ElementaryEdge::intresicEqual(const ElementaryEdge *other) const
{
return _ptr==other->_ptr;
* unsorted because the "other" mesh is not subdivided yet.
*/
void ElementaryEdge::fillGlobalInfoAbs2(const std::map<INTERP_KERNEL::Node *,int>& mapThis, const std::map<INTERP_KERNEL::Node *,int>& mapOther, int offset1, int offset2, double fact, double baryX, double baryY,
+ short skipStartOrEnd,
std::vector<int>& edgesOther, std::vector<double>& addCoo, std::map<INTERP_KERNEL::Node *,int>& mapAddCoo) const
{
- _ptr->fillGlobalInfoAbs2(mapThis,mapOther,offset1,offset2,fact,baryX,baryY,edgesOther,addCoo,mapAddCoo);
+ if (!_direction)
+ skipStartOrEnd *= -1; // invert value - see QuadraticPolygon::splitAbs()
+ _ptr->fillGlobalInfoAbs2(mapThis,mapOther,offset1,offset2,fact,baryX,baryY,skipStartOrEnd,edgesOther,addCoo,mapAddCoo);
}
/*!
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
INTERPKERNEL_EXPORT void applySimilarity(double xBary, double yBary, double dimChar) { _ptr->applySimilarity(xBary,yBary,dimChar); }
INTERPKERNEL_EXPORT void unApplySimilarity(double xBary, double yBary, double dimChar) { _ptr->unApplySimilarity(xBary,yBary,dimChar); }
INTERPKERNEL_EXPORT void getAllNodes(std::set<Node *>& output) const;
+ INTERPKERNEL_EXPORT bool hasSameExtremities(const ElementaryEdge& other) const;
INTERPKERNEL_EXPORT void getBarycenter(double *bary, double& weigh) const;
INTERPKERNEL_EXPORT ElementaryEdge *clone() const;
INTERPKERNEL_EXPORT void initLocations() const;
INTERPKERNEL_EXPORT bool intresicEqual(const ElementaryEdge *other) const;
INTERPKERNEL_EXPORT bool intresicEqualDirSensitive(const ElementaryEdge *other) const;
INTERPKERNEL_EXPORT void dumpInXfigFile(std::ostream& stream, int resolution, const Bounds& box) const;
+ INTERPKERNEL_EXPORT void dumpToCout(const std::map<INTERP_KERNEL::Node *,int>& mapp, int index) const;
INTERPKERNEL_EXPORT bool getDirection() const { return _direction; }
INTERPKERNEL_EXPORT bool intresincEqCoarse(const Edge *other) const;
INTERPKERNEL_EXPORT bool isEqual(const ElementaryEdge& other) const;
INTERPKERNEL_EXPORT void fillGlobalInfoAbs(const std::map<INTERP_KERNEL::Node *,int>& mapThis, const std::map<INTERP_KERNEL::Node *,int>& mapOther, int offset1, int offset2, double fact, double baryX, double baryY,
std::vector<int>& edgesThis, std::vector<double>& addCoo, std::map<INTERP_KERNEL::Node *,int> mapAddCoo) const;
INTERPKERNEL_EXPORT void fillGlobalInfoAbs2(const std::map<INTERP_KERNEL::Node *,int>& mapThis, const std::map<INTERP_KERNEL::Node *,int>& mapOther, int offset1, int offset2, double fact, double baryX, double baryY,
+ short skipStartOrEnd,
std::vector<int>& edgesOther, std::vector<double>& addCoo, std::map<INTERP_KERNEL::Node *,int>& mapAddCoo) const;
INTERPKERNEL_EXPORT static ElementaryEdge *BuildEdgeFromStartEndDir(bool direction, INTERP_KERNEL::Node *start, INTERP_KERNEL::Node *end);
private:
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
void Node::fillGlobalInfoAbs(const std::map<INTERP_KERNEL::Node *,int>& mapThis, const std::map<INTERP_KERNEL::Node *,int>& mapOther, int offset1, int offset2, double fact, double baryX, double baryY,
std::vector<double>& addCoo, std::map<INTERP_KERNEL::Node *,int>& mapAddCoo, int *nodeId) const
{
- std::map<INTERP_KERNEL::Node *,int>::const_iterator it=mapThis.find(const_cast<Node *>(this));
- if(it!=mapThis.end())
+ std::map<INTERP_KERNEL::Node *,int>::const_iterator it=mapOther.find(const_cast<Node *>(this));
+ if(it!=mapOther.end()) // order matters, try in mapOther first.
{
- *nodeId=(*it).second;
+ *nodeId=(*it).second+offset1;
return;
}
- it=mapOther.find(const_cast<Node *>(this));
- if(it!=mapOther.end())
+ it=mapThis.find(const_cast<Node *>(this));
+ if(it!=mapThis.end())
{
- *nodeId=(*it).second+offset1;
+ *nodeId=(*it).second;
return;
}
it=mapAddCoo.find(const_cast<Node *>(this));
int tmp;
std::size_t sz1=addCoo.size();
fillGlobalInfoAbs(mapThis,mapOther,offset1,offset2,fact,baryX,baryY,addCoo,mapAddCoo,&tmp);
- if(sz1!=addCoo.size())
+ if(sz1!=addCoo.size() // newly created point
+ || (tmp >= offset2 // or previously created point merged with a neighbour
+ && (pointsOther.size() == 0 || pointsOther.back() != tmp)))
{
pointsOther.push_back(tmp);
return ;
std::vector<int>::const_iterator it=std::find(pointsOther.begin(),pointsOther.end(),tmp);
if(it!=pointsOther.end())
return ;
- if(tmp<offset1)
- pointsOther.push_back(tmp);
+ pointsOther.push_back(tmp);
}
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
double fact=normalizeExt(&other, xBaryBB, yBaryBB);
//
- IteratorOnComposedEdge it1(this),it3(&other);
+ IteratorOnComposedEdge itThis(this),itOther(&other); // other is (part of) the tool mesh
MergePoints merge;
- ComposedEdge *c1=new ComposedEdge;
- ComposedEdge *c2=new ComposedEdge;
+ ComposedEdge *cThis=new ComposedEdge;
+ ComposedEdge *cOther=new ComposedEdge;
int i=0;
std::map<INTERP_KERNEL::Node *,int> mapAddCoo;
- for(it3.first();!it3.finished();it3.next(),i++)//iteration over 'other->_sub_edges'
+ for(itOther.first();!itOther.finished();itOther.next(),i++)
{
+ // For each edge of 'other', proceed with intersections: the edge might split into sub-edges, 'otherTmp' will hold the final split result.
+ // In the process of going through all edges of 'other', 'this' (which contains initially only one edge)
+ // is sub-divised into several edges : each of them has to be tested when intersecting the next candidate stored in 'other'.
QuadraticPolygon otherTmp;
- ElementaryEdge* curE3=it3.current();
- otherTmp.pushBack(new ElementaryEdge(curE3->getPtr(),curE3->getDirection())); curE3->getPtr()->incrRef();
- IteratorOnComposedEdge it2(&otherTmp);
- for(it2.first();!it2.finished();it2.next())//iteration on subedges of 'otherTmp->_sub_edge'
+ ElementaryEdge* curOther=itOther.current();
+ otherTmp.pushBack(new ElementaryEdge(curOther->getPtr(),curOther->getDirection())); curOther->getPtr()->incrRef();
+ IteratorOnComposedEdge itOtherTmp(&otherTmp);
+ for(itOtherTmp.first();!itOtherTmp.finished();itOtherTmp.next())
{
- ElementaryEdge* curE2=it2.current();
- if(!curE2->isThereStartPoint())
- it1.first();
+ ElementaryEdge* curOtherTmp=itOtherTmp.current();
+ if(!curOtherTmp->isThereStartPoint())
+ itThis.first(); // reset iterator on 'this'
else
- it1=curE2->getIterator();
- for(;!it1.finished();)//iteration over 'this' _sub_edges
+ itThis=curOtherTmp->getIterator();
+ for(;!itThis.finished();)
{
- ElementaryEdge* curE1=it1.current();
+ ElementaryEdge* curThis=itThis.current();
merge.clear();
//
- std::map<INTERP_KERNEL::Node *,int>::const_iterator thisStart(mapThis.find(curE1->getStartNode())),thisEnd(mapThis.find(curE1->getEndNode())),otherStart(mapOther.find(curE2->getStartNode())),otherEnd(mapOther.find(curE2->getEndNode()));
- int thisStart2(thisStart==mapThis.end()?-1:(*thisStart).second),thisEnd2(thisEnd==mapThis.end()?-1:(*thisEnd).second),otherStart2(otherStart==mapOther.end()?-1:(*otherStart).second+offset1),otherEnd2(otherEnd==mapOther.end()?-1:(*otherEnd).second+offset1);
+ std::map<INTERP_KERNEL::Node *,int>::const_iterator thisStart(mapThis.find(curThis->getStartNode())),thisEnd(mapThis.find(curThis->getEndNode())),
+ otherStart(mapOther.find(curOtherTmp->getStartNode())),otherEnd(mapOther.find(curOtherTmp->getEndNode()));
+ int thisStart2(thisStart==mapThis.end()?-1:(*thisStart).second), thisEnd2(thisEnd==mapThis.end()?-1:(*thisEnd).second),
+ otherStart2(otherStart==mapOther.end()?-1:(*otherStart).second+offset1),otherEnd2(otherEnd==mapOther.end()?-1:(*otherEnd).second+offset1);
//
- if(curE1->getPtr()->intersectWith(curE2->getPtr(),merge,*c1,*c2))
+ if(curThis->getPtr()->intersectWith(curOtherTmp->getPtr(),merge,*cThis,*cOther))
{
- if(!curE1->getDirection()) c1->reverse();
- if(!curE2->getDirection()) c2->reverse();
- UpdateNeighbours(merge,it1,it2,c1,c2);
- //Substitution of simple edge by sub-edges.
- delete curE1; // <-- destroying simple edge coming from pol1
- delete curE2; // <-- destroying simple edge coming from pol2
- it1.insertElemEdges(c1,true);// <-- 2nd param is true to go next.
- it2.insertElemEdges(c2,false);// <-- 2nd param is false to avoid to go next.
- curE2=it2.current();
+ if(!curThis->getDirection()) cThis->reverse();
+ if(!curOtherTmp->getDirection()) cOther->reverse();
+ // Substitution of a single simple edge by two sub-edges resulting from the intersection
+ // First modify the edges currently pointed by itThis and itOtherTmp so that the newly created node
+ // becomes the end of the previous sub-edge and the beginning of the next one.
+ UpdateNeighbours(merge,itThis,itOtherTmp,cThis,cOther);
+ delete curThis; // <-- destroying simple edge coming from pol1
+ delete curOtherTmp; // <-- destroying simple edge coming from pol2
+ // Then insert second part of the intersection.
+ itThis.insertElemEdges(cThis,true); // <-- 2nd param is true to go next.
+ itOtherTmp.insertElemEdges(cOther,false); // <-- 2nd param is false to avoid to go next.
+ curOtherTmp=itOtherTmp.current();
//
- it1.assignMySelfToAllElems(c2);//To avoid that others
- SoftDelete(c1);
- SoftDelete(c2);
- c1=new ComposedEdge;
- c2=new ComposedEdge;
+ itThis.assignMySelfToAllElems(cOther);
+ SoftDelete(cThis);
+ SoftDelete(cOther);
+ cThis=new ComposedEdge;
+ cOther=new ComposedEdge;
}
else
{
- UpdateNeighbours(merge,it1,it2,curE1,curE2);
- it1.next();
+ UpdateNeighbours(merge,itThis,itOtherTmp,curThis,curOtherTmp);
+ itThis.next();
}
merge.updateMergedNodes(thisStart2,thisEnd2,otherStart2,otherEnd2,mergedNodes);
}
}
+ // If one sub-edge of otherTmp is "ON" an edge of this, then we have colinearity (all edges in otherTmp are //)
if(otherTmp.presenceOfOn())
edgesInOtherColinearWithThis[otherEdgeIds[i]].push_back(cellIdThis);
- if(otherTmp._sub_edges.size()>1)
+ // Converting back to integer connectivity:
+ if(otherTmp._sub_edges.size()>1) // only if a new point has been added (i.e. an actual intersection was done)
{
- for(std::list<ElementaryEdge *>::const_iterator it=otherTmp._sub_edges.begin();it!=otherTmp._sub_edges.end();it++)
- (*it)->fillGlobalInfoAbs2(mapThis,mapOther,offset1,offset2,/**/fact,xBaryBB,yBaryBB,/**/subDivOther[otherEdgeIds[i]],addCoo,mapAddCoo);
+ int jj = 0, sz(otherTmp._sub_edges.size());
+ for(std::list<ElementaryEdge *>::const_iterator it=otherTmp._sub_edges.begin();it!=otherTmp._sub_edges.end();it++, jj++)
+ {
+ short skipStartOrEnd = jj == 0 ? -1 : (jj == sz-1 ? 1 : 0); // -1 means START, 1 means END, 0 other
+ (*it)->fillGlobalInfoAbs2(mapThis,mapOther,offset1,offset2,
+ fact,xBaryBB,yBaryBB, skipStartOrEnd,
+ /*out*/ subDivOther[otherEdgeIds[i]],addCoo,mapAddCoo);
+ }
}
}
- Delete(c1);
- Delete(c2);
+ Delete(cThis);
+ Delete(cOther);
//
for(std::list<ElementaryEdge *>::const_iterator it=_sub_edges.begin();it!=_sub_edges.end();it++)
(*it)->fillGlobalInfoAbs(mapThis,mapOther,offset1,offset2,/**/fact,xBaryBB,yBaryBB,/**/edgesThis,addCoo,mapAddCoo);
* This method builds from descending conn of a quadratic polygon stored in crude mode (MEDCoupling). Descending conn is in FORTRAN relative mode in order to give the
* orientation of edge.
*/
-void QuadraticPolygon::buildFromCrudeDataArray2(const std::map<int,INTERP_KERNEL::Node *>& mapp, bool isQuad, const int *nodalBg, const double *coords, const int *descBg, const int *descEnd, const std::vector<std::vector<int> >& intersectEdges,
+void QuadraticPolygon::buildFromCrudeDataArray2(const std::map<int,INTERP_KERNEL::Node *>& mapp, bool isQuad, const int *nodalBg, const double *coords, const int *descBg, const int *descEnd, const std::vector<std::vector<int> >& intersectEdges2,
const INTERP_KERNEL::QuadraticPolygon& pol1, const int *descBg1, const int *descEnd1, const std::vector<std::vector<int> >& intersectEdges1,
const std::vector< std::vector<int> >& colinear1,
std::map<int,std::vector<INTERP_KERNEL::ElementaryEdge *> >& alreadyExistingIn2)
if(directos)
{//no subpart of edge 'edgeId' of pol2 is in pol1 so let's operate the same thing that QuadraticPolygon::buildFromCrudeDataArray method
std::size_t oldSz=_sub_edges.size();
- appendEdgeFromCrudeDataArray(i,mapp,isQuad,nodalBg,coords,descBg,descEnd,intersectEdges);
+ appendEdgeFromCrudeDataArray(i,mapp,isQuad,nodalBg,coords,descBg,descEnd,intersectEdges2);
std::size_t newSz=_sub_edges.size();
std::size_t zeSz=newSz-oldSz;
alreadyExistingIn2[descBg[i]].resize(zeSz);
}
else
{//there is subpart of edge 'edgeId' of pol2 inside pol1
- const std::vector<int>& subEdge=intersectEdges[edgeId];
+ const std::vector<int>& subEdge=intersectEdges2[edgeId];
std::size_t nbOfSubEdges=subEdge.size()/2;
for(std::size_t j=0;j<nbOfSubEdges;j++)
{
* @param [in,out] edgesThis, parameter that keep informed the caller about the edges in this not shared by the result of intersection of \a this with \a other
* @param [in,out] edgesBoundaryOther, parameter that stores all edges in result of intersection that are not
*/
-void QuadraticPolygon::buildPartitionsAbs(QuadraticPolygon& other, std::set<INTERP_KERNEL::Edge *>& edgesThis, std::set<INTERP_KERNEL::Edge *>& edgesBoundaryOther, const std::map<INTERP_KERNEL::Node *,int>& mapp, int idThis, int idOther, int offset, std::vector<double>& addCoordsQuadratic, std::vector<int>& conn, std::vector<int>& connI, std::vector<int>& nbThis, std::vector<int>& nbOther)
+void QuadraticPolygon::buildPartitionsAbs(QuadraticPolygon& other, std::set<INTERP_KERNEL::Edge *>& edgesThis, std::set<INTERP_KERNEL::Edge *>& edgesBoundaryOther,
+ const std::map<INTERP_KERNEL::Node *,int>& mapp, int idThis, int idOther, int offset,
+ std::vector<double>& addCoordsQuadratic, std::vector<int>& conn, std::vector<int>& connI,
+ std::vector<int>& nbThis, std::vector<int>& nbOther)
{
double xBaryBB, yBaryBB;
double fact=normalizeExt(&other, xBaryBB, yBaryBB);
//Locate \a this relative to \a other (edges of \a this, aka \a pol1 are marked as IN or OUT)
other.performLocatingOperationSlow(*this); // without any assumption
- std::vector<QuadraticPolygon *> res=buildIntersectionPolygons(other,*this);
+ std::vector<QuadraticPolygon *> res=buildIntersectionPolygons(*this,other);
for(std::vector<QuadraticPolygon *>::iterator it=res.begin();it!=res.end();it++)
{
(*it)->appendCrudeData(mapp,xBaryBB,yBaryBB,fact,offset,addCoordsQuadratic,conn,connI);
unApplyGlobalSimilarityExt(other,xBaryBB,yBaryBB,fact);
}
+/*!
+ * Remove the two 'identical' edges from the list, and drecRef the objects.
+ */
+void QuadraticPolygon::cleanDegeneratedConsecutiveEdges()
+{
+ IteratorOnComposedEdge it(this);
+ ElementaryEdge * prevEdge = 0;
+ if (recursiveSize() > 2)
+ for(it.first();!it.finished();it.next())
+ {
+ ElementaryEdge * cur = it.current();
+ if (prevEdge && prevEdge->hasSameExtremities(*cur))
+ {
+ it.eraseCurrent();
+ it.eraseCurrent();
+ prevEdge = it.current();
+ }
+ else
+ prevEdge = cur;
+ }
+}
+
/*!
* Warning This method is \b NOT const. 'this' and 'other' are modified after call of this method.
* 'other' is a QuadraticPolygon of \b non closed edges.
* \b WARNING this method is const and other is const too. \b BUT location of Edges in 'this' and 'other' are nevertheless modified.
* This is possible because loc attribute in Edge class is mutable.
* This implies that if 'this' or/and 'other' are reused for intersect* method initLocations has to be called on each of this/them.
+ * This method is currently not used by any high level functionality.
*/
std::vector<QuadraticPolygon *> QuadraticPolygon::intersectMySelfWith(const QuadraticPolygon& other) const
{
SplitPolygonsEachOther(cpyOfThis,cpyOfOther,nbOfSplits);
//At this point cpyOfThis and cpyOfOther have been splited at maximum edge so that in/out can been done.
performLocatingOperation(cpyOfOther);
- return other.buildIntersectionPolygons(cpyOfThis,cpyOfOther);
+ return other.buildIntersectionPolygons(cpyOfOther, cpyOfThis);
}
/*!
/*!
* Given 2 polygons \a pol1 and \a pol2 (localized) the resulting polygons are returned.
*
- * this : pol2 simplified.
+ * this : pol1 simplified.
* @param [in] pol1 pol1 split.
* @param [in] pol2 pol2 split.
*/
std::vector<QuadraticPolygon *> QuadraticPolygon::buildIntersectionPolygons(const QuadraticPolygon& pol1, const QuadraticPolygon& pol2) const
{
std::vector<QuadraticPolygon *> ret;
- std::list<QuadraticPolygon *> pol2Zip=pol2.zipConsecutiveInSegments();
- if(!pol2Zip.empty())
- ClosePolygons(pol2Zip,pol1,*this,ret);
+ // Extract from pol1, and pol1 only, all consecutive edges.
+ // pol1Zip contains concatenated pieces of pol1 which are part of the resulting intersecting cell being built.
+ std::list<QuadraticPolygon *> pol1Zip=pol1.zipConsecutiveInSegments();
+ if(!pol1Zip.empty())
+ ClosePolygons(pol1Zip,*this,pol2,ret);
else
- {//borders of pol2 do not cross pol1,and pol2 borders are outside of pol1. That is to say, either pol2 and pol1
- //do not overlap or pol1 is fully inside pol2. So in the first case no intersection, in the other case
- //the intersection is pol1.
- ElementaryEdge *e1FromPol1=pol1[0];
+ {//borders of pol1 do not cross pol2,and pol1 borders are outside of pol2. That is to say, either pol1 and pol2
+ //do not overlap or pol2 is fully inside pol1. So in the first case no intersection, in the other case
+ //the intersection is pol2.
+ ElementaryEdge *e1FromPol2=pol2[0];
TypeOfEdgeLocInPolygon loc=FULL_ON_1;
- loc=e1FromPol1->locateFullyMySelf(*this,loc);
+ loc=e1FromPol2->locateFullyMySelf(*this,loc);
if(loc==FULL_IN_1)
- ret.push_back(new QuadraticPolygon(pol1));
+ ret.push_back(new QuadraticPolygon(pol2));
}
return ret;
}
/*!
* Returns parts of potentially non closed-polygons. Each returned polygons are not mergeable.
- * this : pol2 split and locallized.
+ * this : pol1 split and localized.
*/
std::list<QuadraticPolygon *> QuadraticPolygon::zipConsecutiveInSegments() const
{
}
/*!
- * @param [in] pol2zip is a list of set of edges (=an opened polygon) coming from split polygon 2.
- * @param [in] pol1 is split pol1.
- * @param [in] pol2 should be considered as pol2Simplified.
+ * @param [in] pol1zip is a list of set of edges (=an opened polygon) coming from split polygon 1.
+ * @param [in] pol1 should be considered as pol1Simplified.
+ * @param [in] pol2 is split pol2.
* @param [out] results the resulting \b CLOSED polygons.
*/
-void QuadraticPolygon::ClosePolygons(std::list<QuadraticPolygon *>& pol2Zip, const QuadraticPolygon& pol1, const QuadraticPolygon& pol2,
+void QuadraticPolygon::ClosePolygons(std::list<QuadraticPolygon *>& pol1Zip, const QuadraticPolygon& pol1, const QuadraticPolygon& pol2,
std::vector<QuadraticPolygon *>& results)
{
- bool directionKnownInPol1=false;
- bool directionInPol1;
- for(std::list<QuadraticPolygon *>::iterator iter=pol2Zip.begin();iter!=pol2Zip.end();)
+ bool directionKnownInPol2=false;
+ bool directionInPol2;
+ for(std::list<QuadraticPolygon *>::iterator iter=pol1Zip.begin();iter!=pol1Zip.end();)
{
+ // Build incrementally the full closed cells from the consecutive line parts already built in pol1Zip.
+ // At the end of the process the item currently iterated has been totally completed (start_node=end_node)
+ // This process can produce several cells.
if((*iter)->completed())
{
results.push_back(*iter);
- directionKnownInPol1=false;
- iter=pol2Zip.erase(iter);
+ directionKnownInPol2=false;
+ iter=pol1Zip.erase(iter);
continue;
}
- if(!directionKnownInPol1)
+ if(!directionKnownInPol2)
{
- if(!(*iter)->haveIAChanceToBeCompletedBy(pol1,pol2,directionInPol1))
- { delete *iter; iter=pol2Zip.erase(iter); continue; }
+ if(!(*iter)->haveIAChanceToBeCompletedBy(pol1,pol2,directionInPol2))
+ { delete *iter; iter=pol1Zip.erase(iter); continue; }
else
- directionKnownInPol1=true;
+ directionKnownInPol2=true;
}
std::list<QuadraticPolygon *>::iterator iter2=iter; iter2++;
- std::list<QuadraticPolygon *>::iterator iter3=(*iter)->fillAsMuchAsPossibleWith(pol1,iter2,pol2Zip.end(),directionInPol1);
- if(iter3!=pol2Zip.end())
+ // Fill as much as possible the current iterate (=a part of pol1) with consecutive pieces from pol2:
+ std::list<QuadraticPolygon *>::iterator iter3=(*iter)->fillAsMuchAsPossibleWith(pol2,iter2,pol1Zip.end(),directionInPol2);
+ // and now add a full connected piece from pol1Zip:
+ if(iter3!=pol1Zip.end())
{
(*iter)->pushBack(*iter3);
SoftDelete(*iter3);
- pol2Zip.erase(iter3);
+ pol1Zip.erase(iter3);
}
}
}
/*!
- * 'this' is expected to be set of edges (not closed) of pol2 split.
+ * 'this' is expected to be set of edges (not closed) of pol1 split.
*/
-bool QuadraticPolygon::haveIAChanceToBeCompletedBy(const QuadraticPolygon& pol1Splitted,const QuadraticPolygon& pol2NotSplitted, bool& direction)
+bool QuadraticPolygon::haveIAChanceToBeCompletedBy(const QuadraticPolygon& pol1NotSplitted, const QuadraticPolygon& pol2Splitted, bool& direction) const
{
- IteratorOnComposedEdge it(const_cast<QuadraticPolygon *>(&pol1Splitted));
+ IteratorOnComposedEdge it2(const_cast<QuadraticPolygon *>(&pol2Splitted));
bool found=false;
Node *n=getEndNode();
- ElementaryEdge *cur=it.current();
- for(it.first();!it.finished() && !found;)
+ ElementaryEdge *cur=it2.current();
+ for(it2.first();!it2.finished() && !found;)
{
- cur=it.current();
+ cur=it2.current();
found=(cur->getStartNode()==n);
if(!found)
- it.next();
+ it2.next();
}
if(!found)
throw Exception("Internal error: polygons incompatible with each others. Should never happen!");
- //Ok we found correspondence between this and pol1. Searching for right direction to close polygon.
+ //Ok we found correspondence between this and pol2. Searching for right direction to close polygon.
ElementaryEdge *e=_sub_edges.back();
if(e->getLoc()==FULL_ON_1)
{
if(e->getPtr()==cur->getPtr())
{
direction=false;
- it.previousLoop();
- cur=it.current();
+ it2.previousLoop();
+ cur=it2.current();
Node *repr=cur->getPtr()->buildRepresentantOfMySelf();
- bool ret=pol2NotSplitted.isInOrOut(repr);
+ bool ret=pol1NotSplitted.isInOrOut(repr);
repr->decrRef();
return ret;
}
{
direction=true;
Node *repr=cur->getPtr()->buildRepresentantOfMySelf();
- bool ret=pol2NotSplitted.isInOrOut(repr);
+ bool ret=pol1NotSplitted.isInOrOut(repr);
repr->decrRef();
return ret;
}
}
else
- direction=cur->locateFullyMySelfAbsolute(pol2NotSplitted)==FULL_IN_1;
+ direction=cur->locateFullyMySelfAbsolute(pol1NotSplitted)==FULL_IN_1;
return true;
}
/*!
- * This method fills as much as possible \a this (a sub-part of pol2 split) with edges of \a pol1Splitted.
+ * This method fills as much as possible \a this (a sub-part of pol1 split) with edges of \a pol2Splitted.
*/
-std::list<QuadraticPolygon *>::iterator QuadraticPolygon::fillAsMuchAsPossibleWith(const QuadraticPolygon& pol1Splitted,
+std::list<QuadraticPolygon *>::iterator QuadraticPolygon::fillAsMuchAsPossibleWith(const QuadraticPolygon& pol2Splitted,
std::list<QuadraticPolygon *>::iterator iStart,
std::list<QuadraticPolygon *>::iterator iEnd,
bool direction)
{
- IteratorOnComposedEdge it(const_cast<QuadraticPolygon *>(&pol1Splitted));
+ IteratorOnComposedEdge it1(const_cast<QuadraticPolygon *>(&pol2Splitted));
bool found=false;
Node *n=getEndNode();
- ElementaryEdge *cur;
- for(it.first();!it.finished() && !found;)
+ ElementaryEdge *cur1;
+ for(it1.first();!it1.finished() && !found;)
{
- cur=it.current();
- found=(cur->getStartNode()==n);
+ cur1=it1.current();
+ found=(cur1->getStartNode()==n);
if(!found)
- it.next();
+ it1.next();
}
if(!direction)
- it.previousLoop();
+ it1.previousLoop();
Node *nodeToTest;
- int szMax(pol1Splitted.size()+1),ii(0);// here a protection against aggressive users of IntersectMeshes of invalid input meshes
+ int szMax(pol2Splitted.size()+1),ii(0); // protection against aggressive users of IntersectMeshes using invalid input meshes ...
std::list<QuadraticPolygon *>::iterator ret;
do
- {
- cur=it.current();
- ElementaryEdge *tmp=cur->clone();
+ { // Stack (consecutive) edges of pol1 into the result (no need to care about ordering, edges from pol1 are already consecutive)
+ cur1=it1.current();
+ ElementaryEdge *tmp=cur1->clone();
if(!direction)
tmp->reverse();
pushBack(tmp);
nodeToTest=tmp->getEndNode();
- direction?it.nextLoop():it.previousLoop();
+ direction?it1.nextLoop():it1.previousLoop();
ret=CheckInList(nodeToTest,iStart,iEnd);
if(completed())
return iEnd;
return iEnd;
}
-void QuadraticPolygon::ComputeResidual(const QuadraticPolygon& pol1, const std::set<Edge *>& notUsedInPol1, const std::set<Edge *>& edgesInPol2OnBoundary, const std::map<INTERP_KERNEL::Node *,int>& mapp, int offset, int idThis,
- std::vector<double>& addCoordsQuadratic, std::vector<int>& conn, std::vector<int>& connI, std::vector<int>& nb1, std::vector<int>& nb2)
+/*!
+* Compute the remaining parts of the intersection of mesh1 by mesh2.
+* The general algorithm is to :
+* - either return full cells from pol1 that were simply not touched by mesh2
+* - or to:
+* - concatenate pieces from pol1 into consecutive pieces (a bit like zipConsecutiveSegments())
+* - complete those pieces by edges found in edgesInPol2OnBoundary, which are edges from pol2 located on the boundary of the previously built
+* intersecting cells
+*/
+void QuadraticPolygon::ComputeResidual(const QuadraticPolygon& pol1, const std::set<Edge *>& notUsedInPol1, const std::set<Edge *>& edgesInPol2OnBoundary,
+ const std::map<INTERP_KERNEL::Node *,int>& mapp, int offset, int idThis,
+ std::vector<double>& addCoordsQuadratic, std::vector<int>& conn,
+ std::vector<int>& connI, std::vector<int>& nb1, std::vector<int>& nb2)
{
+ // Initialise locations on pol1. Remember that edges found in 'notUsedInPol1' are also part of the edges forming pol1.
pol1.initLocations();
- for(std::set<Edge *>::const_iterator it9=notUsedInPol1.begin();it9!=notUsedInPol1.end();it9++)
- { (*it9)->initLocs(); (*it9)->declareOn(); }
- for(std::set<Edge *>::const_iterator itA=edgesInPol2OnBoundary.begin();itA!=edgesInPol2OnBoundary.end();itA++)
- { (*itA)->initLocs(); (*itA)->declareIn(); }
+ for(std::set<Edge *>::const_iterator it1=notUsedInPol1.begin();it1!=notUsedInPol1.end();it1++)
+ { (*it1)->initLocs(); (*it1)->declareOn(); }
+ for(std::set<Edge *>::const_iterator it2=edgesInPol2OnBoundary.begin();it2!=edgesInPol2OnBoundary.end();it2++)
+ { (*it2)->initLocs(); (*it2)->declareIn(); }
////
std::set<Edge *> notUsedInPol1L(notUsedInPol1);
- IteratorOnComposedEdge it(const_cast<QuadraticPolygon *>(&pol1));
+ IteratorOnComposedEdge itPol1(const_cast<QuadraticPolygon *>(&pol1));
int sz=pol1.size();
std::list<QuadraticPolygon *> pol1Zip;
+ // If none of the edges of pol1 was consumed by the rebuilding process, we can directly take pol1 as it is to form a cell:
if(pol1.size()==(int)notUsedInPol1.size() && edgesInPol2OnBoundary.empty())
{
pol1.appendCrudeData(mapp,0.,0.,1.,offset,addCoordsQuadratic,conn,connI); nb1.push_back(idThis); nb2.push_back(-1);
return ;
}
+ // Zip consecutive edges found in notUsedInPol1L and which are not overlapping with boundary edge from edgesInPol2OnBoundary:
while(!notUsedInPol1L.empty())
{
- for(int i=0;i<sz && (it.current()->getStartNode()->getLoc()!=IN_1 || it.current()->getLoc()!=FULL_ON_1);i++)
- it.nextLoop();
- if(it.current()->getStartNode()->getLoc()!=IN_1 || it.current()->getLoc()!=FULL_ON_1)
+ // If all nodes are IN or edge is ON (i.e. as initialised at the begining of the method) then error
+ for(int i=0;i<sz && (itPol1.current()->getStartNode()->getLoc()!=IN_1 || itPol1.current()->getLoc()!=FULL_ON_1);i++)
+ itPol1.nextLoop();
+ if(itPol1.current()->getStartNode()->getLoc()!=IN_1 || itPol1.current()->getLoc()!=FULL_ON_1)
throw INTERP_KERNEL::Exception("Presence of a target polygon fully included in source polygon ! The partition of this leads to a non simply connex cell (with hole) ! Impossible ! Such resulting cell cannot be stored in MED cell format !");
QuadraticPolygon *tmp1=new QuadraticPolygon;
do
{
- Edge *ee=it.current()->getPtr();
+ Edge *ee=itPol1.current()->getPtr();
if(ee->getLoc()==FULL_ON_1)
{
ee->incrRef(); notUsedInPol1L.erase(ee);
- tmp1->pushBack(new ElementaryEdge(ee,it.current()->getDirection()));
+ tmp1->pushBack(new ElementaryEdge(ee,itPol1.current()->getDirection()));
}
- it.nextLoop();
+ itPol1.nextLoop();
}
- while(it.current()->getStartNode()->getLoc()!=IN_1 && !notUsedInPol1L.empty());
+ while(itPol1.current()->getStartNode()->getLoc()!=IN_1 && !notUsedInPol1L.empty());
pol1Zip.push_back(tmp1);
}
+
////
std::list<QuadraticPolygon *> retPolsUnderContruction;
std::list<Edge *> edgesInPol2OnBoundaryL(edgesInPol2OnBoundary.begin(),edgesInPol2OnBoundary.end());
- std::map<QuadraticPolygon *, std::list<QuadraticPolygon *> > pol1ZipConsumed;
+ std::map<QuadraticPolygon *, std::list<QuadraticPolygon *> > pol1ZipConsumed; // for memory management only.
std::size_t maxNbOfTurn=edgesInPol2OnBoundaryL.size(),nbOfTurn=0,iiMNT=0;
for(std::list<QuadraticPolygon *>::const_iterator itMNT=pol1Zip.begin();itMNT!=pol1Zip.end();itMNT++,iiMNT++)
nbOfTurn+=(*itMNT)->size();
// [ABN] at least 3 turns for very small cases (typically one (quad) edge against one (quad or lin) edge forming a new cell)!
maxNbOfTurn = maxNbOfTurn<3 ? 3 : maxNbOfTurn;
nbOfTurn=0;
- while(nbOfTurn<maxNbOfTurn && ((!pol1Zip.empty() || !edgesInPol2OnBoundaryL.empty())))
+ while(nbOfTurn<maxNbOfTurn) // the 'normal' way out of this loop is the break towards the end when pol1Zip is empty.
{
- for(std::list<QuadraticPolygon *>::iterator it1=retPolsUnderContruction.begin();it1!=retPolsUnderContruction.end();)
+ // retPolsUnderConstruction initially empty -> see if(!pol1Zip.empty()) below ...
+ for(std::list<QuadraticPolygon *>::iterator itConstr=retPolsUnderContruction.begin();itConstr!=retPolsUnderContruction.end();)
{
- if((*it1)->getStartNode()==(*it1)->getEndNode())
+ if((*itConstr)->getStartNode()==(*itConstr)->getEndNode()) // reconstruction of a cell is finished
{
- it1++;
+ itConstr++;
continue;
}
- Node *curN=(*it1)->getEndNode();
+ Node *curN=(*itConstr)->getEndNode();
bool smthHappened=false;
+ // Complete a partially reconstructed polygon with boundary edges by matching nodes:
for(std::list<Edge *>::iterator it2=edgesInPol2OnBoundaryL.begin();it2!=edgesInPol2OnBoundaryL.end();)
{
if(curN==(*it2)->getStartNode())
- { (*it2)->incrRef(); (*it1)->pushBack(new ElementaryEdge(*it2,true)); curN=(*it2)->getEndNode(); smthHappened=true; it2=edgesInPol2OnBoundaryL.erase(it2); }
+ { (*it2)->incrRef(); (*itConstr)->pushBack(new ElementaryEdge(*it2,true)); curN=(*it2)->getEndNode(); smthHappened=true; it2=edgesInPol2OnBoundaryL.erase(it2); }
else if(curN==(*it2)->getEndNode())
- { (*it2)->incrRef(); (*it1)->pushBack(new ElementaryEdge(*it2,false)); curN=(*it2)->getStartNode(); smthHappened=true; it2=edgesInPol2OnBoundaryL.erase(it2); }
+ { (*it2)->incrRef(); (*itConstr)->pushBack(new ElementaryEdge(*it2,false)); curN=(*it2)->getStartNode(); smthHappened=true; it2=edgesInPol2OnBoundaryL.erase(it2); }
else
it2++;
}
if(smthHappened)
{
- for(std::list<QuadraticPolygon *>::iterator it3=pol1Zip.begin();it3!=pol1Zip.end();)
+ for(std::list<QuadraticPolygon *>::iterator itZip=pol1Zip.begin();itZip!=pol1Zip.end();)
{
- if(curN==(*it3)->getStartNode())
+ if(curN==(*itZip)->getStartNode()) // we found a matching piece to append in pol1Zip. Append all of it to the current polygon being reconstr
{
- for(std::list<ElementaryEdge *>::const_iterator it4=(*it3)->_sub_edges.begin();it4!=(*it3)->_sub_edges.end();it4++)
- { (*it4)->getPtr()->incrRef(); bool dir=(*it4)->getDirection(); (*it1)->pushBack(new ElementaryEdge((*it4)->getPtr(),dir)); }
- smthHappened=true;
- pol1ZipConsumed[*it1].push_back(*it3);
- curN=(*it3)->getEndNode();
- it3=pol1Zip.erase(it3);
+ for(std::list<ElementaryEdge *>::const_iterator it4=(*itZip)->_sub_edges.begin();it4!=(*itZip)->_sub_edges.end();it4++)
+ { (*it4)->getPtr()->incrRef(); bool dir=(*it4)->getDirection(); (*itConstr)->pushBack(new ElementaryEdge((*it4)->getPtr(),dir)); }
+ pol1ZipConsumed[*itConstr].push_back(*itZip);
+ curN=(*itZip)->getEndNode();
+ itZip=pol1Zip.erase(itZip); // one zipped piece has been consumed
+ break; // we can stop here, pieces in pol1Zip are not connected, by definition.
}
else
- it3++;
+ itZip++;
}
}
- if(!smthHappened)
+ else
{
- for(std::list<ElementaryEdge *>::const_iterator it5=(*it1)->_sub_edges.begin();it5!=(*it1)->_sub_edges.end();it5++)
+ for(std::list<ElementaryEdge *>::const_iterator it5=(*itConstr)->_sub_edges.begin();it5!=(*itConstr)->_sub_edges.end();it5++)
{
Edge *ee=(*it5)->getPtr();
if(edgesInPol2OnBoundary.find(ee)!=edgesInPol2OnBoundary.end())
edgesInPol2OnBoundaryL.push_back(ee);
}
- for(std::list<QuadraticPolygon *>::iterator it6=pol1ZipConsumed[*it1].begin();it6!=pol1ZipConsumed[*it1].end();it6++)
+ for(std::list<QuadraticPolygon *>::iterator it6=pol1ZipConsumed[*itConstr].begin();it6!=pol1ZipConsumed[*itConstr].end();it6++)
pol1Zip.push_front(*it6);
- pol1ZipConsumed.erase(*it1);
- delete *it1;
- it1=retPolsUnderContruction.erase(it1);
+ pol1ZipConsumed.erase(*itConstr);
+ delete *itConstr;
+ itConstr=retPolsUnderContruction.erase(itConstr);
}
}
- if(!pol1Zip.empty())
+ if(!pol1Zip.empty()) // the filling process of retPolsUnderConstruction starts here
{
QuadraticPolygon *tmp=new QuadraticPolygon;
QuadraticPolygon *first=*(pol1Zip.begin());
retPolsUnderContruction.push_back(tmp);
pol1Zip.erase(pol1Zip.begin());
}
+ else
+ break;
nbOfTurn++;
}
if(nbOfTurn==maxNbOfTurn)
oss << " Number of turns is = " << nbOfTurn << " !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
- for(std::list<QuadraticPolygon *>::iterator it1=retPolsUnderContruction.begin();it1!=retPolsUnderContruction.end();it1++)
+ // Convert to integer connectivity:
+ for(std::list<QuadraticPolygon *>::iterator itConstr=retPolsUnderContruction.begin();itConstr!=retPolsUnderContruction.end();itConstr++)
{
- if((*it1)->getStartNode()==(*it1)->getEndNode())
+ if((*itConstr)->getStartNode()==(*itConstr)->getEndNode()) // take only fully closed reconstructed polygon
{
- (*it1)->appendCrudeData(mapp,0.,0.,1.,offset,addCoordsQuadratic,conn,connI); nb1.push_back(idThis); nb2.push_back(-1);
- for(std::list<QuadraticPolygon *>::iterator it6=pol1ZipConsumed[*it1].begin();it6!=pol1ZipConsumed[*it1].end();it6++)
+ (*itConstr)->cleanDegeneratedConsecutiveEdges();
+ (*itConstr)->appendCrudeData(mapp,0.,0.,1.,offset,addCoordsQuadratic,conn,connI); nb1.push_back(idThis); nb2.push_back(-1);
+ for(std::list<QuadraticPolygon *>::iterator it6=pol1ZipConsumed[*itConstr].begin();it6!=pol1ZipConsumed[*itConstr].end();it6++)
delete *it6;
- delete *it1;
+ delete *itConstr;
+ }
+ else
+ {
+ std::ostringstream oss; oss << "Internal error during reconstruction of residual of cell! Non fully closed polygon built!";
+ throw INTERP_KERNEL::Exception(oss.str().c_str());
}
}
}
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
class Edge;
class MergePoints;
+ enum NodeUsage { USAGE_UNKNOWN, USAGE_LINEAR, USAGE_QUADRATIC_ONLY };
+ typedef std::pair<INTERP_KERNEL::Node *,NodeUsage> NodeWithUsage;
+
/**
* A set of quadratic or linear edges, not necessarily connected to form a closed polygon.
* Some methods however requires a closed form.
INTERPKERNEL_EXPORT void performLocatingOperationSlow(QuadraticPolygon& pol2) const;
INTERPKERNEL_EXPORT static void SplitPolygonsEachOther(QuadraticPolygon& pol1, QuadraticPolygon& pol2, int& nbOfSplits);
INTERPKERNEL_EXPORT std::vector<QuadraticPolygon *> buildIntersectionPolygons(const QuadraticPolygon& pol1, const QuadraticPolygon& pol2) const;
- INTERPKERNEL_EXPORT bool haveIAChanceToBeCompletedBy(const QuadraticPolygon& pol1Splitted, const QuadraticPolygon& pol2NotSplitted, bool& direction);
+ INTERPKERNEL_EXPORT bool haveIAChanceToBeCompletedBy(const QuadraticPolygon& pol1NotSplitted, const QuadraticPolygon& pol2Splitted, bool& direction) const;
INTERPKERNEL_EXPORT static void ComputeResidual(const QuadraticPolygon& pol1, const std::set<Edge *>& notUsedInPol1, const std::set<Edge *>& edgesInPol2OnBoundary, const std::map<INTERP_KERNEL::Node *,int>& mapp, int offset, int idThis,
std::vector<double>& addCoordsQuadratic, std::vector<int>& conn, std::vector<int>& connI, std::vector<int>& nb1, std::vector<int>& nb2);
+ INTERPKERNEL_EXPORT void cleanDegeneratedConsecutiveEdges();
protected:
std::list<QuadraticPolygon *> zipConsecutiveInSegments() const;
void dumpInXfigFile(std::ostream& stream, int resolution, const Bounds& box) const;
- static void ClosePolygons(std::list<QuadraticPolygon *>& pol2Zip, const QuadraticPolygon& pol1, const QuadraticPolygon& pol2, std::vector<QuadraticPolygon *>& results);
+ static void ClosePolygons(std::list<QuadraticPolygon *>& pol1Zip, const QuadraticPolygon& pol1, const QuadraticPolygon& pol2,
+ std::vector<QuadraticPolygon *>& results);
template<class EDGES>
static void UpdateNeighbours(const MergePoints& merger, IteratorOnComposedEdge it1, IteratorOnComposedEdge it2,
const EDGES *e1, const EDGES *e2);
- std::list<QuadraticPolygon *>::iterator fillAsMuchAsPossibleWith(const QuadraticPolygon& pol1Splitted,
+ std::list<QuadraticPolygon *>::iterator fillAsMuchAsPossibleWith(const QuadraticPolygon& pol2Splitted,
std::list<QuadraticPolygon *>::iterator iStart,
std::list<QuadraticPolygon *>::iterator iEnd,
bool direction);
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2018 CEA/DEN, EDF R&D
+// Copyright (C) 2018-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2018 CEA/DEN, EDF R&D
+// Copyright (C) 2018-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2018 CEA/DEN, EDF R&D
+// Copyright (C) 2018-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
intersectFaces,
getSplittingPolicy());
break;
- case PointLocator:// switch target and source
- intersector=new PointLocator3DIntersectorP0P0<MyMeshType,MyMatrixType>(srcMesh,targetMesh,getPrecision());
- break;
default:
- throw INTERP_KERNEL::Exception("Invalid 3D to 2D intersection type for P0P0 interp specified : must be Triangulation or PointLocator.");
+ throw INTERP_KERNEL::Exception("Invalid 2D to 3D intersection type for P0P0 interp specified : must be Triangulation.");
}
}
else
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2009-2016 OPEN CASCADE
+// Copyright (C) 2009-2019 OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2009-2016 OPEN CASCADE
+// Copyright (C) 2009-2019 OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2009-2016 OPEN CASCADE
+// Copyright (C) 2009-2019 OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2009-2016 OPEN CASCADE
+// Copyright (C) 2009-2019 OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
bc[2] = 1. - bc[0] - bc[1];
}
+ inline void barycentric_coords_seg2(const std::vector<const double*>& n, const double *p, double *bc)
+ {
+ double delta=n[0][0]-n[1][0];
+ bc[0]=fabs((*p-n[1][0])/delta);
+ bc[1]=fabs((*p-n[0][0])/delta);
+ }
+
+ inline void barycentric_coords_tri3(const std::vector<const double*>& n, const double *p, double *bc)
+ {
+ enum { _XX=0, _YY, _ZZ };
+ // matrix 2x2
+ double
+ T11 = n[0][_XX]-n[2][_XX], T12 = n[1][_XX]-n[2][_XX],
+ T21 = n[0][_YY]-n[2][_YY], T22 = n[1][_YY]-n[2][_YY];
+ // matrix determinant
+ double Tdet = T11*T22 - T12*T21;
+ if ( (std::fabs( Tdet) ) < (std::numeric_limits<double>::min()) )
+ {
+ bc[0]=1; bc[1]=bc[2]=0; // no solution
+ return;
+ }
+ // matrix inverse
+ double t11 = T22, t12 = -T12, t21 = -T21, t22 = T11;
+ // vector
+ double r11 = p[_XX]-n[2][_XX], r12 = p[_YY]-n[2][_YY];
+ // barycentric coordinates: multiply matrix by vector
+ bc[0] = (t11 * r11 + t12 * r12)/Tdet;
+ bc[1] = (t21 * r11 + t22 * r12)/Tdet;
+ bc[2] = 1. - bc[0] - bc[1];
+ }
+
+ inline void barycentric_coords_quad4(const std::vector<const double*>& n, const double *p, double *bc)
+ {
+ enum { _XX=0, _YY, _ZZ };
+ // Find bc by solving system of 3 equations using Gaussian elimination algorithm
+ // bc1*( x1 - x4 ) + bc2*( x2 - x4 ) + bc3*( x3 - x4 ) = px - x4
+ // bc1*( y1 - y4 ) + bc2*( y2 - y4 ) + bc3*( y3 - y4 ) = px - y4
+ // bc1*( z1 - z4 ) + bc2*( z2 - z4 ) + bc3*( z3 - z4 ) = px - z4
+
+ double T[3][4]=
+ {{ n[0][_XX]-n[3][_XX], n[1][_XX]-n[3][_XX], n[2][_XX]-n[3][_XX], p[_XX]-n[3][_XX] },
+ { n[0][_YY]-n[3][_YY], n[1][_YY]-n[3][_YY], n[2][_YY]-n[3][_YY], p[_YY]-n[3][_YY] },
+ { n[0][_ZZ]-n[3][_ZZ], n[1][_ZZ]-n[3][_ZZ], n[2][_ZZ]-n[3][_ZZ], p[_ZZ]-n[3][_ZZ] }};
+
+ if ( !solveSystemOfEquations<3>( T, bc ) )
+ bc[0]=1., bc[1] = bc[2] = bc[3] = 0;
+ else
+ bc[ 3 ] = 1. - bc[0] - bc[1] - bc[2];
+ }
+
+ inline void barycentric_coords_tri6(const std::vector<const double*>& n, const double *p, double *bc)
+ {
+ double matrix2[48]={1., 0., 0., 0., 0., 0., 0., 0.,
+ 1., 0., 0., 0., 0., 0., 1., 0.,
+ 1., 0., 0., 0., 0., 0., 0., 1.,
+ 1., 0., 0., 0., 0., 0., 0.5, 0.,
+ 1., 0., 0., 0., 0., 0., 0.5, 0.5,
+ 1., 0., 0., 0., 0., 0., 0.,0.5};
+ for(int i=0;i<6;i++)
+ {
+ matrix2[8*i+1]=n[i][0];
+ matrix2[8*i+2]=n[i][1];
+ matrix2[8*i+3]=n[i][0]*n[i][0];
+ matrix2[8*i+4]=n[i][0]*n[i][1];
+ matrix2[8*i+5]=n[i][1]*n[i][1];
+ }
+ double res[12];
+ solveSystemOfEquations2<6,2>(matrix2,res,std::numeric_limits<double>::min());
+ double refCoo[2];
+ refCoo[0]=computeTria6RefBase(res,p);
+ refCoo[1]=computeTria6RefBase(res+6,p);
+ computeWeightedCoeffsInTria6FromRefBase(refCoo,bc);
+ }
+
+ inline void barycentric_coords_tetra10(const std::vector<const double*>& n, const double *p, double *bc)
+ {
+ double matrix2[130]={1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
+ 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 1., 0., 0.,
+ 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 1., 0.,
+ 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 1.,
+ 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.5, 0., 0.,
+ 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.5, 0.5, 0.,
+ 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,0.5, 0.,
+ 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.5,
+ 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.5, 0., 0.5,
+ 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.5, 0.5};
+ for(int i=0;i<10;i++)
+ {
+ matrix2[13*i+1]=n[i][0];
+ matrix2[13*i+2]=n[i][1];
+ matrix2[13*i+3]=n[i][2];
+ matrix2[13*i+4]=n[i][0]*n[i][0];
+ matrix2[13*i+5]=n[i][0]*n[i][1];
+ matrix2[13*i+6]=n[i][0]*n[i][2];
+ matrix2[13*i+7]=n[i][1]*n[i][1];
+ matrix2[13*i+8]=n[i][1]*n[i][2];
+ matrix2[13*i+9]=n[i][2]*n[i][2];
+ }
+ double res[30];
+ solveSystemOfEquations2<10,3>(matrix2,res,std::numeric_limits<double>::min());
+ double refCoo[3];
+ refCoo[0]=computeTetra10RefBase(res,p);
+ refCoo[1]=computeTetra10RefBase(res+10,p);
+ refCoo[2]=computeTetra10RefBase(res+20,p);
+ computeWeightedCoeffsInTetra10FromRefBase(refCoo,bc);
+ }
+
/*!
* Calculate barycentric coordinates of a point p with respect to triangle or tetra vertices.
* This method makes 2 assumptions :
*/
inline void barycentric_coords(const std::vector<const double*>& n, const double *p, double *bc)
{
- enum { _XX=0, _YY, _ZZ };
switch(n.size())
{
case 2:
{// SEG 2
- double delta=n[0][0]-n[1][0];
- bc[0]=fabs((*p-n[1][0])/delta);
- bc[1]=fabs((*p-n[0][0])/delta);
+ barycentric_coords_seg2(n,p,bc);
break;
}
case 3:
{ // TRIA3
- // matrix 2x2
- double
- T11 = n[0][_XX]-n[2][_XX], T12 = n[1][_XX]-n[2][_XX],
- T21 = n[0][_YY]-n[2][_YY], T22 = n[1][_YY]-n[2][_YY];
- // matrix determinant
- double Tdet = T11*T22 - T12*T21;
- if ( (std::fabs( Tdet) ) < (std::numeric_limits<double>::min()) )
- {
- bc[0]=1; bc[1]=bc[2]=0; // no solution
- return;
- }
- // matrix inverse
- double t11 = T22, t12 = -T12, t21 = -T21, t22 = T11;
- // vector
- double r11 = p[_XX]-n[2][_XX], r12 = p[_YY]-n[2][_YY];
- // barycentric coordinates: multiply matrix by vector
- bc[0] = (t11 * r11 + t12 * r12)/Tdet;
- bc[1] = (t21 * r11 + t22 * r12)/Tdet;
- bc[2] = 1. - bc[0] - bc[1];
+ barycentric_coords_tri3(n,p,bc);
break;
}
case 4:
{ // TETRA4
- // Find bc by solving system of 3 equations using Gaussian elimination algorithm
- // bc1*( x1 - x4 ) + bc2*( x2 - x4 ) + bc3*( x3 - x4 ) = px - x4
- // bc1*( y1 - y4 ) + bc2*( y2 - y4 ) + bc3*( y3 - y4 ) = px - y4
- // bc1*( z1 - z4 ) + bc2*( z2 - z4 ) + bc3*( z3 - z4 ) = px - z4
-
- double T[3][4]=
- {{ n[0][_XX]-n[3][_XX], n[1][_XX]-n[3][_XX], n[2][_XX]-n[3][_XX], p[_XX]-n[3][_XX] },
- { n[0][_YY]-n[3][_YY], n[1][_YY]-n[3][_YY], n[2][_YY]-n[3][_YY], p[_YY]-n[3][_YY] },
- { n[0][_ZZ]-n[3][_ZZ], n[1][_ZZ]-n[3][_ZZ], n[2][_ZZ]-n[3][_ZZ], p[_ZZ]-n[3][_ZZ] }};
-
- if ( !solveSystemOfEquations<3>( T, bc ) )
- bc[0]=1., bc[1] = bc[2] = bc[3] = 0;
- else
- bc[ 3 ] = 1. - bc[0] - bc[1] - bc[2];
+ barycentric_coords_quad4(n,p,bc);
break;
}
case 6:
{
// TRIA6
- double matrix2[48]={1., 0., 0., 0., 0., 0., 0., 0.,
- 1., 0., 0., 0., 0., 0., 1., 0.,
- 1., 0., 0., 0., 0., 0., 0., 1.,
- 1., 0., 0., 0., 0., 0., 0.5, 0.,
- 1., 0., 0., 0., 0., 0., 0.5, 0.5,
- 1., 0., 0., 0., 0., 0., 0.,0.5};
- for(int i=0;i<6;i++)
- {
- matrix2[8*i+1]=n[i][0];
- matrix2[8*i+2]=n[i][1];
- matrix2[8*i+3]=n[i][0]*n[i][0];
- matrix2[8*i+4]=n[i][0]*n[i][1];
- matrix2[8*i+5]=n[i][1]*n[i][1];
- }
- double res[12];
- solveSystemOfEquations2<6,2>(matrix2,res,std::numeric_limits<double>::min());
- double refCoo[2];
- refCoo[0]=computeTria6RefBase(res,p);
- refCoo[1]=computeTria6RefBase(res+6,p);
- computeWeightedCoeffsInTria6FromRefBase(refCoo,bc);
+ barycentric_coords_tri6(n,p,bc);
break;
}
case 10:
{//TETRA10
- double matrix2[130]={1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
- 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 1., 0., 0.,
- 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 1., 0.,
- 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 1.,
- 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.5, 0., 0.,
- 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.5, 0.5, 0.,
- 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,0.5, 0.,
- 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.5,
- 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.5, 0., 0.5,
- 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.5, 0.5};
- for(int i=0;i<10;i++)
- {
- matrix2[13*i+1]=n[i][0];
- matrix2[13*i+2]=n[i][1];
- matrix2[13*i+3]=n[i][2];
- matrix2[13*i+4]=n[i][0]*n[i][0];
- matrix2[13*i+5]=n[i][0]*n[i][1];
- matrix2[13*i+6]=n[i][0]*n[i][2];
- matrix2[13*i+7]=n[i][1]*n[i][1];
- matrix2[13*i+8]=n[i][1]*n[i][2];
- matrix2[13*i+9]=n[i][2]*n[i][2];
- }
- double res[30];
- solveSystemOfEquations2<10,3>(matrix2,res,std::numeric_limits<double>::min());
- double refCoo[3];
- refCoo[0]=computeTetra10RefBase(res,p);
- refCoo[1]=computeTetra10RefBase(res+10,p);
- refCoo[2]=computeTetra10RefBase(res+20,p);
- computeWeightedCoeffsInTetra10FromRefBase(refCoo,bc);
+ barycentric_coords_tetra10(n,p,bc);
+ break;
+ }
+ default:
+ throw INTERP_KERNEL::Exception("INTERP_KERNEL::barycentric_coords : unrecognized simplex !");
+ }
+ }
+
+ inline void barycentric_coords(INTERP_KERNEL::NormalizedCellType ct, const std::vector<const double*>& n, const double *p, double *bc)
+ {
+ switch(ct)
+ {
+ case NORM_SEG2:
+ {// SEG 2
+ barycentric_coords_seg2(n,p,bc);
+ break;
+ }
+ case NORM_TRI3:
+ { // TRIA3
+ barycentric_coords_tri3(n,p,bc);
+ break;
+ }
+ case NORM_TETRA4:
+ { // TETRA4
+ barycentric_coords_quad4(n,p,bc);
+ break;
+ }
+ case NORM_TRI6:
+ {
+ // TRIA6
+ barycentric_coords_tri6(n,p,bc);
+ break;
+ }
+ case NORM_TETRA10:
+ {//TETRA10
+ barycentric_coords_tetra10(n,p,bc);
break;
}
default:
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2009-2016 OPEN CASCADE
+// Copyright (C) 2009-2019 OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2009-2016 OPEN CASCADE
+// Copyright (C) 2009-2019 OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2009-2016 OPEN CASCADE
+// Copyright (C) 2009-2019 OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2009-2016 OPEN CASCADE
+// Copyright (C) 2009-2019 OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2009-2016 OPEN CASCADE
+// Copyright (C) 2009-2019 OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2009-2016 OPEN CASCADE
+// Copyright (C) 2009-2019 OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2009-2016 OPEN CASCADE
+// Copyright (C) 2009-2019 OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2009-2016 OPEN CASCADE
+// Copyright (C) 2009-2019 OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-# Copyright (C) 2012-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-# Copyright (C) 2015-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2015-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
{
ComposedEdge& v1=*(new ComposedEdge);
ComposedEdge& v2=*(new ComposedEdge);
+ QuadraticPlanarPrecision::setPrecision(5.0e-14); // [ABN] man, those tests are really close to epsilon! I need to relax this a bit.
MergePoints v3;
//Testing merge of geometric equals seg2.
Edge *e1=new EdgeLin(0.5,0.5,1.,1.); Edge *e2=new EdgeLin(0.5,0.5,1.,1.);
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
//Test 0
- //Test 1 - OUT_AFTER - OUT_AFTER | same dir. - 0°
+ //Test 1 - OUT_AFTER - OUT_AFTER | same dir. - 0deg
e1=new EdgeLin(0.,0.,1.,0.); e2=new EdgeLin(1.5,0.,2.,0.);
CPPUNIT_ASSERT(!e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT_EQUAL(0,(int)v2.size());
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 2 - INSIDE - OUT_AFTER | same dir. - 0°
+ //Test 2 - INSIDE - OUT_AFTER | same dir. - 0deg
e1=new EdgeLin(0.,0.,1.,0.); e2=new EdgeLin(0.5,0.,1.5,0.);
CPPUNIT_ASSERT(e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(e2->getStartNode()==v2.front()->getStartNode() && e2->getEndNode()==v2.back()->getEndNode());
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 2 - INSIDE - OUT_AFTER | same dir. - 90°
+ //Test 2 - INSIDE - OUT_AFTER | same dir. - 90deg
e1=new EdgeLin(0.,0.,0.,1.); e2=new EdgeLin(0.,0.5,0.,1.5);
CPPUNIT_ASSERT(e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(e2->getStartNode()==v2.front()->getStartNode() && e2->getEndNode()==v2.back()->getEndNode());
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 2 - INSIDE - OUT_AFTER | same dir. - 45°
+ //Test 2 - INSIDE - OUT_AFTER | same dir. - 45deg
e1=new EdgeLin(0.,0.,1.,1.); e2=new EdgeLin(0.5,0.5,1.5,1.5);
CPPUNIT_ASSERT(e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(v2[0]->getEndNode()==v2[1]->getStartNode()); CPPUNIT_ASSERT(e2->getStartNode()==v2[0]->getStartNode()); CPPUNIT_ASSERT(e2->getEndNode()==v2[1]->getEndNode());
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 2 - INSIDE - OUT_AFTER | opp. dir. - 45°
+ //Test 2 - INSIDE - OUT_AFTER | opp. dir. - 45deg
e1=new EdgeLin(0.,0.,1.,1.); e2=new EdgeLin(1.5,1.5,0.5,0.5);
CPPUNIT_ASSERT(e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(e2->getStartNode()==v2.front()->getStartNode() && e2->getEndNode()==v2.back()->getEndNode());
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 3 - INSIDE - INSIDE | same dir. - 0°
+ //Test 3 - INSIDE - INSIDE | same dir. - 0deg
e1=new EdgeLin(0.,0.,1.,0.); e2=new EdgeLin(0.25,0.,0.75,0.);
CPPUNIT_ASSERT(e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(e2->getStartNode()==v2.front()->getStartNode() && e2->getEndNode()==v2.back()->getEndNode());
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 3 - INSIDE - INSIDE | same dir. - 90°
+ //Test 3 - INSIDE - INSIDE | same dir. - 90deg
e1=new EdgeLin(0.,0.,0.,1.); e2=new EdgeLin(0.,0.25,0.,0.75);
CPPUNIT_ASSERT(e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(e2->getStartNode()==v2.front()->getStartNode() && e2->getEndNode()==v2.back()->getEndNode());
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 3 - INSIDE - INSIDE | same dir. - 45°
+ //Test 3 - INSIDE - INSIDE | same dir. - 45deg
e1=new EdgeLin(0.,0.,1.,1.); e2=new EdgeLin(0.25,0.25,0.75,0.75);
CPPUNIT_ASSERT(e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(e2->getStartNode()==v2.front()->getStartNode() && e2->getEndNode()==v2.back()->getEndNode());
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 3 - INSIDE - INSIDE | opp dir. - 45°
+ //Test 3 - INSIDE - INSIDE | opp dir. - 45deg
e1=new EdgeLin(0.,0.,1.,1.); e2=new EdgeLin(0.75,0.75,0.25,0.25);
CPPUNIT_ASSERT(e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(v1[1]->getEndNode()==e2->getStartNode());
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 4 - OUT_BEFORE - OUT_BEFORE | same dir. - 0 °
+ //Test 4 - OUT_BEFORE - OUT_BEFORE | same dir. - 0 deg
e1=new EdgeLin(0.,0.,1.,0.); e2=new EdgeLin(-1.,0.,-0.5,0.);
CPPUNIT_ASSERT(!e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT_EQUAL(0,(int)v2.size());
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 5 - OUT_BEFORE - INSIDE | same dir. - 0°
+ //Test 5 - OUT_BEFORE - INSIDE | same dir. - 0deg
e1=new EdgeLin(0.,0.,1.,0.); e2=new EdgeLin(-0.5,0.,0.5,0.);
CPPUNIT_ASSERT(e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(e2->getStartNode()==v2.front()->getStartNode() && e2->getEndNode()==v2.back()->getEndNode());
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 5 - OUT_BEFORE - INSIDE | same dir. - 90°
+ //Test 5 - OUT_BEFORE - INSIDE | same dir. - 90deg
e1=new EdgeLin(0.,0.,0.,1.); e2=new EdgeLin(0,-0.5,0.,0.5);
CPPUNIT_ASSERT(e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(e2->getStartNode()==v2.front()->getStartNode() && e2->getEndNode()==v2.back()->getEndNode());
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 5 - OUT_BEFORE - INSIDE | same dir. - 45°
+ //Test 5 - OUT_BEFORE - INSIDE | same dir. - 45deg
e1=new EdgeLin(0.,0.,1.,1.); e2=new EdgeLin(-0.5,-0.5,0.5,0.5);
CPPUNIT_ASSERT(e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(e2->getStartNode()==v2.front()->getStartNode() && e2->getEndNode()==v2.back()->getEndNode());
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 5 - OUT_BEFORE - INSIDE | opp dir. - 45°
+ //Test 5 - OUT_BEFORE - INSIDE | opp dir. - 45deg
e1=new EdgeLin(0.,0.,1.,1.); e2=new EdgeLin(0.5,0.5,-0.5,-0.5);
CPPUNIT_ASSERT(e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(e2->getStartNode()==v2.front()->getStartNode() && e2->getEndNode()==v2.back()->getEndNode());
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 6 - OUT_BEFORE - OUT_AFTER | same dir. - 0°
+ //Test 6 - OUT_BEFORE - OUT_AFTER | same dir. - 0deg
e1=new EdgeLin(0.,0.,1.,0.); e2=new EdgeLin(-0.5,0.,1.5,0.);
CPPUNIT_ASSERT(e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(e2->getStartNode()==v2.front()->getStartNode() && e2->getEndNode()==v2.back()->getEndNode());
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 6 - OUT_BEFORE - OUT_AFTER | same dir. - 90°
+ //Test 6 - OUT_BEFORE - OUT_AFTER | same dir. - 90deg
e1=new EdgeLin(0.,0.,0.,1.); e2=new EdgeLin(0.,-0.5,0.,1.5);
CPPUNIT_ASSERT(e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(e2->getStartNode()==v2.front()->getStartNode() && e2->getEndNode()==v2.back()->getEndNode());
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 6 - OUT_BEFORE - OUT_AFTER | same dir. - 45°
+ //Test 6 - OUT_BEFORE - OUT_AFTER | same dir. - 45deg
e1=new EdgeLin(0.,0.,1.,1.); e2=new EdgeLin(-0.5,-0.5,1.5,1.5);
CPPUNIT_ASSERT(e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(e2->getStartNode()==v2.front()->getStartNode() && e2->getEndNode()==v2.back()->getEndNode());
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 6 - OUT_BEFORE - OUT_AFTER | opp dir. - 45°
+ //Test 6 - OUT_BEFORE - OUT_AFTER | opp dir. - 45deg
e1=new EdgeLin(0.,0.,1.,1.); e2=new EdgeLin(1.5,1.5,-0.5,-0.5);
CPPUNIT_ASSERT(e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(e2->getStartNode()==v2.front()->getStartNode() && e2->getEndNode()==v2.back()->getEndNode());
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 7 - END - OUT_AFTER | same dir. - 0°
+ //Test 7 - END - OUT_AFTER | same dir. - 0deg
e1=new EdgeLin(0.,0.,1.,0.); e2=new EdgeLin(1.,0.,1.5,0.);
CPPUNIT_ASSERT(!e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(1,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT_EQUAL(0,(int)v2.size());
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 7 - END - OUT_AFTER | opp dir. - 0°
+ //Test 7 - END - OUT_AFTER | opp dir. - 0deg
e1=new EdgeLin(0.,0.,1.,0.); e2=new EdgeLin(1.5,0.,1.,0.);
CPPUNIT_ASSERT(!e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(1,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(e1->getEndNode()==e2->getEndNode());
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 8 - START - END | same dir. - 0°
+ //Test 8 - START - END | same dir. - 0deg
e1=new EdgeLin(0.,0.,0.7,0.); e2=new EdgeLin(0.,0.,0.7,0.);
CPPUNIT_ASSERT(e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(2,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(e2->getStartNode()==v2.front()->getStartNode() && e2->getEndNode()==v2.back()->getEndNode());
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 8 - START - END | same dir. - 90°
+ //Test 8 - START - END | same dir. - 90deg
e1=new EdgeLin(0.,0.,0.,0.7); e2=new EdgeLin(0.,0.,0.,0.7);
CPPUNIT_ASSERT(e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(2,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(e2->getStartNode()==v2.front()->getStartNode() && e2->getEndNode()==v2.back()->getEndNode());
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 8 - START - END | same dir. - 45°
+ //Test 8 - START - END | same dir. - 45deg
e1=new EdgeLin(0.,0.,0.7,0.7); e2=new EdgeLin(0.,0.,0.7,0.7);
CPPUNIT_ASSERT(e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(2,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(e2->getStartNode()==v2.front()->getStartNode() && e2->getEndNode()==v2.back()->getEndNode());
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 8 - START - END | opp. dir. - 45°
+ //Test 8 - START - END | opp. dir. - 45deg
e1=new EdgeLin(0.,0.,0.7,0.7); e2=new EdgeLin(0.7,0.7,0.,0.);
CPPUNIT_ASSERT(e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(2,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(e2->getEndNode()==e1->getStartNode());
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 10 - START - OUT_AFTER | same dir. - 0°
+ //Test 10 - START - OUT_AFTER | same dir. - 0deg
e1=new EdgeLin(0.,0.,0.7,0.); e2=new EdgeLin(0.,0.,1.,0.);
CPPUNIT_ASSERT(e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(1,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(e2->getStartNode()==v2.front()->getStartNode() && e2->getEndNode()==v2.back()->getEndNode());
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 10 - START - OUT_AFTER | same dir. - 90°
+ //Test 10 - START - OUT_AFTER | same dir. - 90deg
e1=new EdgeLin(0.,0.,0.,0.7); e2=new EdgeLin(0.,0.,0.,1.);
CPPUNIT_ASSERT(e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(1,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(e2->getStartNode()==v2.front()->getStartNode() && e2->getEndNode()==v2.back()->getEndNode());
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 10 - START - OUT_AFTER | same dir. - 45°
+ //Test 10 - START - OUT_AFTER | same dir. - 45deg
e1=new EdgeLin(0.,0.,0.7,0.7); e2=new EdgeLin(0.,0.,1.,1.);
CPPUNIT_ASSERT(e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(1,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(e2->getStartNode()==v2.front()->getStartNode() && e2->getEndNode()==v2.back()->getEndNode());
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 10 - START - OUT_AFTER | opp dir. - 45°
+ //Test 10 - START - OUT_AFTER | opp dir. - 45deg
e1=new EdgeLin(0.,0.,0.7,0.7); e2=new EdgeLin(1.,1.,0.,0.);
CPPUNIT_ASSERT(e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(1,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(e2->getStartNode()==v2.front()->getStartNode() && e2->getEndNode()==v2.back()->getEndNode());
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 11 - INSIDE - END | same dir. - 0°
+ //Test 11 - INSIDE - END | same dir. - 0deg
e1=new EdgeLin(0.,0.,1.,0.); e2=new EdgeLin(0.7,0.,1.,0.);
CPPUNIT_ASSERT(e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(1,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(e2->getStartNode()==v2.front()->getStartNode() && e2->getEndNode()==v2.back()->getEndNode());
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 11 - INSIDE - END | same dir. - 90°
+ //Test 11 - INSIDE - END | same dir. - 90deg
e1=new EdgeLin(0.,0.,0.,1.); e2=new EdgeLin(0.,0.7,0.,1.);
CPPUNIT_ASSERT(e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(1,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(e2->getStartNode()==v2.front()->getStartNode() && e2->getEndNode()==v2.back()->getEndNode());
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 11 - INSIDE - END | same dir. - 45°
+ //Test 11 - INSIDE - END | same dir. - 45deg
e1=new EdgeLin(0.,0.,1.,1.); e2=new EdgeLin(0.7,0.7,1.,1.);
CPPUNIT_ASSERT(e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(1,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(e2->getStartNode()==v2.front()->getStartNode() && e2->getEndNode()==v2.back()->getEndNode());
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 11 - INSIDE - END | opp dir. - 45°
+ //Test 11 - INSIDE - END | opp dir. - 45deg
e1=new EdgeLin(0.,0.,1.,1.); e2=new EdgeLin(1.,1.,0.7,0.7);
CPPUNIT_ASSERT(e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(1,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(e2->getStartNode()==v2.front()->getStartNode() && e2->getEndNode()==v2.back()->getEndNode());
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 12 - OUT_BEFORE - END | same dir. - 0°
+ //Test 12 - OUT_BEFORE - END | same dir. - 0deg
e1=new EdgeLin(0.,0.,1.,0.); e2=new EdgeLin(-0.5,0.,1.,0.);
CPPUNIT_ASSERT(e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(1,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(e2->getStartNode()==v2.front()->getStartNode() && e2->getEndNode()==v2.back()->getEndNode());
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 12 - OUT_BEFORE - END | same dir. - 90°
+ //Test 12 - OUT_BEFORE - END | same dir. - 90deg
e1=new EdgeLin(0.,0.,0.,1.); e2=new EdgeLin(0.,-0.5,0.,1.);
CPPUNIT_ASSERT(e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(1,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(e2->getStartNode()==v2.front()->getStartNode() && e2->getEndNode()==v2.back()->getEndNode());
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 12 - OUT_BEFORE - END | same dir. - 45°
+ //Test 12 - OUT_BEFORE - END | same dir. - 45deg
e1=new EdgeLin(0.,0.,1.,1.); e2=new EdgeLin(-0.5,-0.5,1.,1.);
CPPUNIT_ASSERT(e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(1,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(e2->getStartNode()==v2.front()->getStartNode() && e2->getEndNode()==v2.back()->getEndNode());
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 12 - OUT_BEFORE - END | opp dir. - 45°
+ //Test 12 - OUT_BEFORE - END | opp dir. - 45deg
e1=new EdgeLin(0.,0.,1.,1.); e2=new EdgeLin(1.,1.,-0.5,-0.5);
CPPUNIT_ASSERT(e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(1,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(e2->getStartNode()==v2.front()->getStartNode() && e2->getEndNode()==v2.back()->getEndNode());
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 13 - START - INSIDE | same dir. - 0°
+ //Test 13 - START - INSIDE | same dir. - 0deg
e1=new EdgeLin(0.,0.,1.,0.); e2=new EdgeLin(0.,0.,0.5,0.);
CPPUNIT_ASSERT(e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(1,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(e2->getStartNode()==v2.front()->getStartNode() && e2->getEndNode()==v2.back()->getEndNode());
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 13 - START - INSIDE | same dir. - 90°
+ //Test 13 - START - INSIDE | same dir. - 90deg
e1=new EdgeLin(0.,0.,0.,1.); e2=new EdgeLin(0.,0.,0.,0.5);
CPPUNIT_ASSERT(e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(1,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(e2->getStartNode()==v2.front()->getStartNode() && e2->getEndNode()==v2.back()->getEndNode());
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 13 - START - INSIDE | same dir. - 45°
+ //Test 13 - START - INSIDE | same dir. - 45deg
e1=new EdgeLin(0.,0.,1.,1.); e2=new EdgeLin(0.,0.,0.5,0.5);
CPPUNIT_ASSERT(e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(1,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(e2->getStartNode()==v2.front()->getStartNode() && e2->getEndNode()==v2.back()->getEndNode());
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 13 - START - INSIDE | opp dir. - 45°
+ //Test 13 - START - INSIDE | opp dir. - 45deg
e1=new EdgeLin(0.,0.,1.,1.); e2=new EdgeLin(0.5,0.5,0.,0.);
CPPUNIT_ASSERT(e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(1,(int)v3.getNumberOfAssociations());
*/
void QuadraticPlanarInterpTest::IntersectionPointOnlyUnitarySegSeg()
{
- // 0° - classical
+ // 0deg - classical
EdgeLin *e1=new EdgeLin(0.,0.,1.,0.);
EdgeLin *e2=new EdgeLin(0.3,0.3,0.5,-0.3);
ComposedEdge& v1=*(new ComposedEdge);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,(*v1[0]->getEndNode())[1],ADMISSIBLE_ERROR);
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- // 90° - classical
+ // 90deg - classical
e1=new EdgeLin(0.,0.,0.,1.);
e2=new EdgeLin(-0.3,0.3,0.3,0.5);
CPPUNIT_ASSERT(e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.4,(*v1[0]->getEndNode())[1],ADMISSIBLE_ERROR);
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 1 - 0°
+ //Test 1 - 0deg
e1=new EdgeLin(0.,0.,1.,0.); e2=new EdgeLin(0.,0.,0.,1.);
CPPUNIT_ASSERT(!e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(1,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(v3.isStart1(0)); CPPUNIT_ASSERT(v3.isStart2(0));
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 1 - 90°
+ //Test 1 - 90deg
e1=new EdgeLin(0.,0.,0.,1.); e2=new EdgeLin(0.,0.,1.,0.);
CPPUNIT_ASSERT(!e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(1,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(v3.isStart1(0)); CPPUNIT_ASSERT(v3.isStart2(0));
e2->decrRef(); e1->decrRef();
v1.clear(); v2.clear(); v3.clear();
- //Test 1 - 45°
+ //Test 1 - 45deg
e1=new EdgeLin(0.,0.,1.,1.); e2=new EdgeLin(0.,0.,1.,-1.);
CPPUNIT_ASSERT(!e1->intersectWith(e2,v3,v1,v2));
CPPUNIT_ASSERT_EQUAL(1,(int)v3.getNumberOfAssociations());
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
intersector=new ArcCArcCIntersector(*e1,*e2);
bool order;
bool obvious,areOverlapped;
- intersector->areOverlappedOrOnlyColinears(0,obvious,areOverlapped);
+ intersector->areOverlappedOrOnlyColinears(obvious,areOverlapped);
CPPUNIT_ASSERT(!obvious && !areOverlapped);
- CPPUNIT_ASSERT(intersector->intersect(0,v4,order,v3)); CPPUNIT_ASSERT(!order);
+ CPPUNIT_ASSERT(intersector->intersect(v4,order,v3)); CPPUNIT_ASSERT(!order);
CPPUNIT_ASSERT_EQUAL(2,(int)v4.size()); CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT_DOUBLES_EQUAL(e1->getRadius(),Node::distanceBtw2Pt(e1->getCenter(),(*(v4[0]))),ADMISSIBLE_ERROR);
CPPUNIT_ASSERT_DOUBLES_EQUAL(e2->getRadius(),Node::distanceBtw2Pt(e2->getCenter(),(*(v4[0]))),ADMISSIBLE_ERROR);
intersector=new ArcCArcCIntersector(*e1,*e2);
bool order;
bool obvious,areOverlapped;
- intersector->areOverlappedOrOnlyColinears(0,obvious,areOverlapped);
+ intersector->areOverlappedOrOnlyColinears(obvious,areOverlapped);
CPPUNIT_ASSERT(!obvious && !areOverlapped);
- CPPUNIT_ASSERT(intersector->intersect(0,v4,order,v3)); CPPUNIT_ASSERT(order);
+ CPPUNIT_ASSERT(intersector->intersect(v4,order,v3)); CPPUNIT_ASSERT(order);
CPPUNIT_ASSERT_EQUAL(2,(int)v4.size()); CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT_DOUBLES_EQUAL(e1->getRadius(),Node::distanceBtw2Pt(e1->getCenter(),(*(v4[0]))),ADMISSIBLE_ERROR);
CPPUNIT_ASSERT_DOUBLES_EQUAL(e2->getRadius(),Node::distanceBtw2Pt(e2->getCenter(),(*(v4[0]))),ADMISSIBLE_ERROR);
intersector=new ArcCArcCIntersector(*e1,*e2);
bool order;
bool obvious,areOverlapped;
- intersector->areOverlappedOrOnlyColinears(0,obvious,areOverlapped);
+ intersector->areOverlappedOrOnlyColinears(obvious,areOverlapped);
CPPUNIT_ASSERT(!obvious && !areOverlapped);
- CPPUNIT_ASSERT(intersector->intersect(0,v4,order,v3)); CPPUNIT_ASSERT(order);
+ CPPUNIT_ASSERT(intersector->intersect(v4,order,v3)); CPPUNIT_ASSERT(order);
CPPUNIT_ASSERT_EQUAL(2,(int)v4.size()); CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT_DOUBLES_EQUAL(e1->getRadius(),Node::distanceBtw2Pt(e1->getCenter(),(*(v4[0]))),ADMISSIBLE_ERROR);
CPPUNIT_ASSERT_DOUBLES_EQUAL(e2->getRadius(),Node::distanceBtw2Pt(e2->getCenter(),(*(v4[0]))),ADMISSIBLE_ERROR);
intersector=new ArcCArcCIntersector(*e1,*e2);
bool order;
bool obvious,areOverlapped;
- intersector->areOverlappedOrOnlyColinears(0,obvious,areOverlapped);
+ intersector->areOverlappedOrOnlyColinears(obvious,areOverlapped);
CPPUNIT_ASSERT(!obvious && !areOverlapped);
- CPPUNIT_ASSERT(intersector->intersect(0,v4,order,v3)); CPPUNIT_ASSERT(!order);
+ CPPUNIT_ASSERT(intersector->intersect(v4,order,v3)); CPPUNIT_ASSERT(!order);
CPPUNIT_ASSERT_EQUAL(2,(int)v4.size()); CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT_DOUBLES_EQUAL(e1->getRadius(),Node::distanceBtw2Pt(e1->getCenter(),(*(v4[0]))),ADMISSIBLE_ERROR);
CPPUNIT_ASSERT_DOUBLES_EQUAL(e2->getRadius(),Node::distanceBtw2Pt(e2->getCenter(),(*(v4[0]))),ADMISSIBLE_ERROR);
intersector=new ArcCArcCIntersector(*e1,*e2);
bool order;
bool obvious,areOverlapped;
- intersector->areOverlappedOrOnlyColinears(0,obvious,areOverlapped);
+ intersector->areOverlappedOrOnlyColinears(obvious,areOverlapped);
CPPUNIT_ASSERT(!obvious && !areOverlapped);
- CPPUNIT_ASSERT(intersector->intersect(0,v4,order,v3)); CPPUNIT_ASSERT(!order);
+ CPPUNIT_ASSERT(intersector->intersect(v4,order,v3)); CPPUNIT_ASSERT(!order);
CPPUNIT_ASSERT_EQUAL(2,(int)v4.size()); CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT_DOUBLES_EQUAL(e1->getRadius(),Node::distanceBtw2Pt(e1->getCenter(),(*(v4[0]))),ADMISSIBLE_ERROR);
CPPUNIT_ASSERT_DOUBLES_EQUAL(e2->getRadius(),Node::distanceBtw2Pt(e2->getCenter(),(*(v4[0]))),ADMISSIBLE_ERROR);
intersector=new ArcCArcCIntersector(*e1,*e2);
bool order;
bool obvious,areOverlapped;
- intersector->areOverlappedOrOnlyColinears(0,obvious,areOverlapped);
+ intersector->areOverlappedOrOnlyColinears(obvious,areOverlapped);
CPPUNIT_ASSERT(!obvious && !areOverlapped);
- CPPUNIT_ASSERT(intersector->intersect(0,v4,order,v3)); CPPUNIT_ASSERT(order);
+ CPPUNIT_ASSERT(intersector->intersect(v4,order,v3)); CPPUNIT_ASSERT(order);
CPPUNIT_ASSERT_EQUAL(2,(int)v4.size()); CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT_DOUBLES_EQUAL(e1->getRadius(),Node::distanceBtw2Pt(e1->getCenter(),(*(v4[0]))),ADMISSIBLE_ERROR);
CPPUNIT_ASSERT_DOUBLES_EQUAL(e2->getRadius(),Node::distanceBtw2Pt(e2->getCenter(),(*(v4[0]))),ADMISSIBLE_ERROR);
intersector=new ArcCArcCIntersector(*e1,*e2);
bool order;
bool obvious,areOverlapped;
- intersector->areOverlappedOrOnlyColinears(0,obvious,areOverlapped);
+ intersector->areOverlappedOrOnlyColinears(obvious,areOverlapped);
CPPUNIT_ASSERT(!obvious && !areOverlapped);
- CPPUNIT_ASSERT(intersector->intersect(0,v4,order,v3)); CPPUNIT_ASSERT(order);
+ CPPUNIT_ASSERT(intersector->intersect(v4,order,v3)); CPPUNIT_ASSERT(order);
CPPUNIT_ASSERT_EQUAL(2,(int)v4.size()); CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT_DOUBLES_EQUAL(e1->getRadius(),Node::distanceBtw2Pt(e1->getCenter(),(*(v4[0]))),ADMISSIBLE_ERROR);
CPPUNIT_ASSERT_DOUBLES_EQUAL(e2->getRadius(),Node::distanceBtw2Pt(e2->getCenter(),(*(v4[0]))),ADMISSIBLE_ERROR);
intersector=new ArcCArcCIntersector(*e1,*e2);
bool order;
bool obvious,areOverlapped;
- intersector->areOverlappedOrOnlyColinears(0,obvious,areOverlapped);
+ intersector->areOverlappedOrOnlyColinears(obvious,areOverlapped);
CPPUNIT_ASSERT(!obvious && !areOverlapped);
- CPPUNIT_ASSERT(intersector->intersect(0,v4,order,v3)); CPPUNIT_ASSERT(!order);
+ CPPUNIT_ASSERT(intersector->intersect(v4,order,v3)); CPPUNIT_ASSERT(!order);
CPPUNIT_ASSERT_EQUAL(2,(int)v4.size()); CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT_DOUBLES_EQUAL(e1->getRadius(),Node::distanceBtw2Pt(e1->getCenter(),(*(v4[0]))),ADMISSIBLE_ERROR);
CPPUNIT_ASSERT_DOUBLES_EQUAL(e2->getRadius(),Node::distanceBtw2Pt(e2->getCenter(),(*(v4[0]))),ADMISSIBLE_ERROR);
intersector=new ArcCArcCIntersector(*e1,*e2);
bool order;
bool obvious,areOverlapped;
- intersector->areOverlappedOrOnlyColinears(0,obvious,areOverlapped);
+ intersector->areOverlappedOrOnlyColinears(obvious,areOverlapped);
CPPUNIT_ASSERT(!obvious && !areOverlapped);
- CPPUNIT_ASSERT(intersector->intersect(0,v4,order,v3)); CPPUNIT_ASSERT(order); // order has no sense here because v4.size() expected to 1 but for valgrind serenity test.
+ CPPUNIT_ASSERT(intersector->intersect(v4,order,v3)); CPPUNIT_ASSERT(order); // order has no sense here because v4.size() expected to 1 but for valgrind serenity test.
CPPUNIT_ASSERT_EQUAL(1,(int)v4.size()); CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT_DOUBLES_EQUAL(e1->getRadius(),Node::distanceBtw2Pt(e1->getCenter(),(*(v4[0]))),ADMISSIBLE_ERROR);
CPPUNIT_ASSERT_DOUBLES_EQUAL(e2->getRadius(),Node::distanceBtw2Pt(e2->getCenter(),(*(v4[0]))),ADMISSIBLE_ERROR);
intersector=new ArcCArcCIntersector(*e1,*e2);
bool order;
bool obvious,areOverlapped;
- intersector->areOverlappedOrOnlyColinears(0,obvious,areOverlapped);
+ intersector->areOverlappedOrOnlyColinears(obvious,areOverlapped);
CPPUNIT_ASSERT(!obvious && !areOverlapped);
- CPPUNIT_ASSERT(!intersector->intersect(0,v4,order,v3)); CPPUNIT_ASSERT_EQUAL(0,(int)v4.size()); CPPUNIT_ASSERT_EQUAL(2,(int)v3.getNumberOfAssociations());
+ CPPUNIT_ASSERT(!intersector->intersect(v4,order,v3)); CPPUNIT_ASSERT_EQUAL(0,(int)v4.size()); CPPUNIT_ASSERT_EQUAL(2,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(e1->getStartNode()==e2->getEndNode()); CPPUNIT_ASSERT(e2->getStartNode()==e1->getEndNode());
v4.clear(); v3.clear();
delete intersector; e2->decrRef(); e1->decrRef();
intersector=new ArcCArcCIntersector(*e1,*e2);
bool order;
bool obvious,areOverlapped;
- intersector->areOverlappedOrOnlyColinears(0,obvious,areOverlapped);
+ intersector->areOverlappedOrOnlyColinears(obvious,areOverlapped);
CPPUNIT_ASSERT(!obvious && !areOverlapped);
- CPPUNIT_ASSERT(!intersector->intersect(0,v4,order,v3)); CPPUNIT_ASSERT_EQUAL(0,(int)v4.size()); CPPUNIT_ASSERT_EQUAL(2,(int)v3.getNumberOfAssociations());
+ CPPUNIT_ASSERT(!intersector->intersect(v4,order,v3)); CPPUNIT_ASSERT_EQUAL(0,(int)v4.size()); CPPUNIT_ASSERT_EQUAL(2,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(e1->getStartNode()==e2->getStartNode()); CPPUNIT_ASSERT(e2->getEndNode()==e1->getEndNode());
v4.clear(); v3.clear();
delete intersector; e2->decrRef(); e1->decrRef();
intersector=new ArcCArcCIntersector(*e1,*e2);
bool order;
bool obvious,areOverlapped;
- intersector->areOverlappedOrOnlyColinears(0,obvious,areOverlapped);
+ intersector->areOverlappedOrOnlyColinears(obvious,areOverlapped);
CPPUNIT_ASSERT(!obvious && !areOverlapped);
- CPPUNIT_ASSERT(intersector->intersect(0,v4,order,v3));
+ CPPUNIT_ASSERT(intersector->intersect(v4,order,v3));
CPPUNIT_ASSERT(order); CPPUNIT_ASSERT_EQUAL(1,(int)v4.size()); CPPUNIT_ASSERT_EQUAL(1,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(e1->getStartNode()==e2->getStartNode()); CPPUNIT_ASSERT(e1->getEndNode()==v4[0]);
v4[0]->decrRef();
intersector=new ArcCArcCIntersector(*e1,*e2);
bool order;
bool obvious,areOverlapped;
- intersector->areOverlappedOrOnlyColinears(0,obvious,areOverlapped);
+ intersector->areOverlappedOrOnlyColinears(obvious,areOverlapped);
CPPUNIT_ASSERT(!obvious && !areOverlapped);
- CPPUNIT_ASSERT(intersector->intersect(0,v4,order,v3)); CPPUNIT_ASSERT(order); CPPUNIT_ASSERT_EQUAL(2,(int)v4.size()); CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
+ CPPUNIT_ASSERT(intersector->intersect(v4,order,v3)); CPPUNIT_ASSERT(order); CPPUNIT_ASSERT_EQUAL(2,(int)v4.size()); CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(e1->getStartNode()==v4[0]); CPPUNIT_ASSERT(e1->getEndNode()==v4[1]);
v4[0]->decrRef(); v4[1]->decrRef();
v4.clear(); v3.clear();
intersector=new ArcCArcCIntersector(*e1,*e2);
bool order;
bool obvious,areOverlapped;
- intersector->areOverlappedOrOnlyColinears(0,obvious,areOverlapped);
+ intersector->areOverlappedOrOnlyColinears(obvious,areOverlapped);
CPPUNIT_ASSERT(!obvious && !areOverlapped);
- CPPUNIT_ASSERT(intersector->intersect(0,v4,order,v3)); CPPUNIT_ASSERT(order); CPPUNIT_ASSERT_EQUAL(1,(int)v4.size()); CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
+ CPPUNIT_ASSERT(intersector->intersect(v4,order,v3)); CPPUNIT_ASSERT(order); CPPUNIT_ASSERT_EQUAL(1,(int)v4.size()); CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(e1->getStartNode()==v4[0]);
v4[0]->decrRef();
v4.clear(); v3.clear();
intersector=new ArcCArcCIntersector(*e1,*e2);
bool order;
bool obvious,areOverlapped;
- intersector->areOverlappedOrOnlyColinears(0,obvious,areOverlapped);
+ intersector->areOverlappedOrOnlyColinears(obvious,areOverlapped);
CPPUNIT_ASSERT(!obvious && !areOverlapped);
- CPPUNIT_ASSERT(intersector->intersect(0,v4,order,v3)); CPPUNIT_ASSERT(order); CPPUNIT_ASSERT_EQUAL(2,(int)v4.size()); CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
+ CPPUNIT_ASSERT(intersector->intersect(v4,order,v3)); CPPUNIT_ASSERT(order); CPPUNIT_ASSERT_EQUAL(2,(int)v4.size()); CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT(e1->getStartNode()==v4[0]);
v4[0]->decrRef(); v4[1]->decrRef();
v4.clear(); v3.clear();
EdgeIntersector *intersector=new ArcCSegIntersector(*e1,*e2);
bool order;
bool obvious,areOverlapped;
- intersector->areOverlappedOrOnlyColinears(0,obvious,areOverlapped);
+ intersector->areOverlappedOrOnlyColinears(obvious,areOverlapped);
CPPUNIT_ASSERT(!obvious && !areOverlapped);
std::vector<Node *> v4;
MergePoints v3;
- CPPUNIT_ASSERT(intersector->intersect(0,v4,order,v3)); CPPUNIT_ASSERT(!order); CPPUNIT_ASSERT_EQUAL(2,(int)v4.size()); CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
+ CPPUNIT_ASSERT(intersector->intersect(v4,order,v3)); CPPUNIT_ASSERT(!order); CPPUNIT_ASSERT_EQUAL(2,(int)v4.size()); CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT_DOUBLES_EQUAL(2.,(*v4[0])[0],1e-10); CPPUNIT_ASSERT_DOUBLES_EQUAL(4.3,(*v4[0])[1],1e-10);
CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.3,(*v4[1])[0],1e-10); CPPUNIT_ASSERT_DOUBLES_EQUAL(2.,(*v4[1])[1],1e-10);
v4[0]->decrRef(); v4[1]->decrRef(); e2->decrRef(); v3.clear(); v4.clear(); delete intersector;
//
e2=new EdgeLin(3.,5.3,-1.3,1.);
intersector=new ArcCSegIntersector(*e1,*e2);
- intersector->areOverlappedOrOnlyColinears(0,obvious,areOverlapped); CPPUNIT_ASSERT(!obvious && !areOverlapped);
- CPPUNIT_ASSERT(intersector->intersect(0,v4,order,v3)); CPPUNIT_ASSERT(order); CPPUNIT_ASSERT_EQUAL(2,(int)v4.size()); CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
+ intersector->areOverlappedOrOnlyColinears(obvious,areOverlapped); CPPUNIT_ASSERT(!obvious && !areOverlapped);
+ CPPUNIT_ASSERT(intersector->intersect(v4,order,v3)); CPPUNIT_ASSERT(order); CPPUNIT_ASSERT_EQUAL(2,(int)v4.size()); CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT_DOUBLES_EQUAL(2.,(*v4[0])[0],1e-10); CPPUNIT_ASSERT_DOUBLES_EQUAL(4.3,(*v4[0])[1],1e-10);
CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.3,(*v4[1])[0],1e-10); CPPUNIT_ASSERT_DOUBLES_EQUAL(2.,(*v4[1])[1],1e-10);
v4[0]->decrRef(); v4[1]->decrRef(); e2->decrRef(); v3.clear(); v4.clear(); delete intersector;
// tangent intersection
e2=new EdgeLin(-1.,4.3,3.,4.3);
intersector=new ArcCSegIntersector(*e1,*e2);
- intersector->areOverlappedOrOnlyColinears(0,obvious,areOverlapped); CPPUNIT_ASSERT(!obvious && !areOverlapped);
- CPPUNIT_ASSERT(intersector->intersect(0,v4,order,v3)); CPPUNIT_ASSERT(order); CPPUNIT_ASSERT_EQUAL(1,(int)v4.size()); CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
+ intersector->areOverlappedOrOnlyColinears(obvious,areOverlapped); CPPUNIT_ASSERT(!obvious && !areOverlapped);
+ CPPUNIT_ASSERT(intersector->intersect(v4,order,v3)); CPPUNIT_ASSERT(order); CPPUNIT_ASSERT_EQUAL(1,(int)v4.size()); CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT_DOUBLES_EQUAL(2.,(*v4[0])[0],1e-10); CPPUNIT_ASSERT_DOUBLES_EQUAL(4.3,(*v4[0])[1],1e-10);
v4[0]->decrRef(); e2->decrRef(); v3.clear(); delete intersector;
// no intersection
e2=new EdgeLin(-2.,-2.,-1.,-3.);
intersector=new ArcCSegIntersector(*e1,*e2);
- intersector->areOverlappedOrOnlyColinears(0,obvious,areOverlapped); CPPUNIT_ASSERT(obvious && !areOverlapped);
+ intersector->areOverlappedOrOnlyColinears(obvious,areOverlapped); CPPUNIT_ASSERT(obvious && !areOverlapped);
e2->decrRef(); v3.clear(); delete intersector;
//
e1->decrRef();
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#! /bin/env python
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#!/bin/bash
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-# Copyright (C) 2012-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include "MEDCouplingRefCountObject.hxx"
#include "InterpKernelException.hxx"
+#include <vector>
+
namespace MEDCoupling
{
template<class T>
return ret;
}
+ template<class T>
+ typename std::vector<const T *> ToConstVect(const typename std::vector< MCAuto<T> >& vec)
+ {
+ std::size_t sz(vec.size());
+ std::vector<const T *> ret(sz);
+ for(std::size_t i=0;i<sz;i++)
+ ret[i]=(const T *)vec[i];
+ return ret;
+ }
+
template<class T>
class MCConstAuto
{
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2017 CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#ifndef __MEDCOUPLING_MCTYPE_HXX__
#define __MEDCOUPLING_MCTYPE_HXX__
+#include <cstdint>
+#include <stddef.h>
+
namespace MEDCoupling
{
- typedef long Int64;
- typedef int Int32;
- typedef int mcIdType;
+ using Int64 = std::int64_t;
+ using Int32 = std::int32_t;
+#ifndef MEDCOUPLING_USE_64BIT_IDS
+ using mcIdType = std::int32_t;
+#else
+ using mcIdType = std::int64_t;
+#endif
+ inline mcIdType ToIdType(std::size_t val) { return mcIdType(val); }
}
#define DataArrayInt DataArrayInt32
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
{
int nbCells=getNumberOfCells();
MCAuto<DataArrayInt> o2n=DataArrayInt::New();
- o2n->useArray(old2NewBg,false,C_DEALLOC,nbCells,1);
+ o2n->useArray(old2NewBg,false,DeallocType::C_DEALLOC,nbCells,1);
if(check)
o2n=o2n->checkAndPreparePermutation();
//
checkFullyDefined();
int nbOfNodes=getNumberOfNodes();
int *revNodalIndxPtr=(int *)malloc((nbOfNodes+1)*sizeof(int));
- revNodalIndx->useArray(revNodalIndxPtr,true,C_DEALLOC,nbOfNodes+1,1);
+ revNodalIndx->useArray(revNodalIndxPtr,true,DeallocType::C_DEALLOC,nbOfNodes+1,1);
std::fill(revNodalIndxPtr,revNodalIndxPtr+nbOfNodes+1,0);
const int *conn=_conn->begin();
int nbOfCells=getNumberOfCells();
std::transform(revNodalIndxPtr+1,revNodalIndxPtr+nbOfNodes+1,revNodalIndxPtr,revNodalIndxPtr+1,std::plus<int>());
conn=_conn->begin();
int *revNodalPtr=(int *)malloc((nbOfEltsInRevNodal)*sizeof(int));
- revNodal->useArray(revNodalPtr,true,C_DEALLOC,nbOfEltsInRevNodal,1);
+ revNodal->useArray(revNodalPtr,true,DeallocType::C_DEALLOC,nbOfEltsInRevNodal,1);
std::fill(revNodalPtr,revNodalPtr+nbOfEltsInRevNodal,-1);
for(int eltId=0;eltId<nbOfCells;eltId++)
{
{
int nbCells=getNumberOfCells();
MCAuto<DataArrayInt> o2n=DataArrayInt::New();
- o2n->useArray(old2NewBg,false,C_DEALLOC,nbCells,1);
+ o2n->useArray(old2NewBg,false,DeallocType::C_DEALLOC,nbCells,1);
if(check)
o2n=o2n->checkAndPreparePermutation();
//
MCAuto<MEDCoupling1DGTUMesh> ret(new MEDCoupling1DGTUMesh(getName(),*_cm));
ret->setCoords(_coords);
DataArrayInt *c=0,*ci=0;
- MEDCouplingUMesh::ExtractFromIndexedArrays(begin,end,_conn,_conn_indx,c,ci);
+ DataArrayInt::ExtractFromIndexedArrays(begin,end,_conn,_conn_indx,c,ci);
MCAuto<DataArrayInt> cSafe(c),ciSafe(ci);
ret->setNodalConnectivity(c,ci);
return ret.retn();
MCAuto<MEDCoupling1DGTUMesh> ret(new MEDCoupling1DGTUMesh(getName(),*_cm));
ret->setCoords(_coords);
DataArrayInt *c=0,*ci=0;
- MEDCouplingUMesh::ExtractFromIndexedArraysSlice(start,end,step,_conn,_conn_indx,c,ci);
+ DataArrayInt::ExtractFromIndexedArraysSlice(start,end,step,_conn,_conn_indx,c,ci);
MCAuto<DataArrayInt> cSafe(c),ciSafe(ci);
ret->setNodalConnectivity(c,ci);
return ret.retn();
checkFullyDefined();
int nbOfNodes=getNumberOfNodes();
int *revNodalIndxPtr=(int *)malloc((nbOfNodes+1)*sizeof(int));
- revNodalIndx->useArray(revNodalIndxPtr,true,C_DEALLOC,nbOfNodes+1,1);
+ revNodalIndx->useArray(revNodalIndxPtr,true,DeallocType::C_DEALLOC,nbOfNodes+1,1);
std::fill(revNodalIndxPtr,revNodalIndxPtr+nbOfNodes+1,0);
const int *conn=_conn->begin(),*conni=_conn_indx->begin();
int nbOfCells=getNumberOfCells();
std::transform(revNodalIndxPtr+1,revNodalIndxPtr+nbOfNodes+1,revNodalIndxPtr,revNodalIndxPtr+1,std::plus<int>());
conn=_conn->begin();
int *revNodalPtr=(int *)malloc((nbOfEltsInRevNodal)*sizeof(int));
- revNodal->useArray(revNodalPtr,true,C_DEALLOC,nbOfEltsInRevNodal,1);
+ revNodal->useArray(revNodalPtr,true,DeallocType::C_DEALLOC,nbOfEltsInRevNodal,1);
std::fill(revNodalPtr,revNodalPtr+nbOfEltsInRevNodal,-1);
for(int eltId=0;eltId<nbOfCells;eltId++)
{
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
template<class MAPCLS>
void renumberNodesInConnT(const MAPCLS& newNodeNumbersO2N);
private:
- MCAuto<DataArrayInt> _conn;
+ MCAuto<DataArrayIdType> _conn;
public:
static const int HEXA8_FACE_PAIRS[6];
};
template<class MAPCLS>
void renumberNodesInConnT(const MAPCLS& newNodeNumbersO2N);
private:
- MCAuto<DataArrayInt> _conn_indx;
- MCAuto<DataArrayInt> _conn;
+ MCAuto<DataArrayIdType> _conn_indx;
+ MCAuto<DataArrayIdType> _conn;
};
}
-// Copyright (C) 2018 CEA/DEN, EDF R&D
+// Copyright (C) 2018-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
{
if(!other)
throw INTERP_KERNEL::Exception("MEDCouplingField::areCompatibleForMerge : input field is NULL !");
- if(!_type->isEqual(other->_type,1.))
+ if(!_type || !other->_type)
+ throw INTERP_KERNEL::Exception("MEDCouplingField::areCompatibleForMerge : this or other has a nullptr spatial discretization !");
+ if(_type->getEnum()!=other->_type->getEnum())
return false;
if(_nature!=other->_nature)
return false;
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
}
}
+template<class FIELD_DISC>
+MCAuto<MEDCouplingFieldDiscretization> MEDCouplingFieldDiscretization::EasyAggregate(std::vector<const MEDCouplingFieldDiscretization *>& fds)
+{
+ if(fds.empty())
+ throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretization::aggregate : input array is empty");
+ for(const MEDCouplingFieldDiscretization * it : fds)
+ {
+ const FIELD_DISC *itc(dynamic_cast<const FIELD_DISC *>(it));
+ if(!itc)
+ throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretization::aggregate : same field discretization expected for all input discretizations !");
+ }
+ return fds[0]->clone();
+}
+
MEDCouplingFieldDiscretization::~MEDCouplingFieldDiscretization()
{
}
return ret.retn();
}
+MCAuto<MEDCouplingFieldDiscretization> MEDCouplingFieldDiscretizationP0::aggregate(std::vector<const MEDCouplingFieldDiscretization *>& fds) const
+{
+ return EasyAggregate<MEDCouplingFieldDiscretizationP0>(fds);
+}
+
int MEDCouplingFieldDiscretizationOnNodes::getNumberOfTuples(const MEDCouplingMesh *mesh) const
{
if(!mesh)
for(std::size_t i=0;i<nbOfNodes;i++)
vec[i]=&coo[i*spaceDim];
INTERP_KERNEL::AutoPtr<double> tmp=new double[nbOfNodes];
- INTERP_KERNEL::barycentric_coords(vec,loc,tmp);
+ INTERP_KERNEL::NormalizedCellType ct(mesh->getTypeOfCell(cellId));
+ INTERP_KERNEL::barycentric_coords(ct,vec,loc,tmp);
int sz=arr->getNumberOfComponents();
INTERP_KERNEL::AutoPtr<double> tmp2=new double[sz];
std::fill(res,res+sz,0.);
stream << "P1 spatial discretization.";
}
+MCAuto<MEDCouplingFieldDiscretization> MEDCouplingFieldDiscretizationP1::aggregate(std::vector<const MEDCouplingFieldDiscretization *>& fds) const
+{
+ return EasyAggregate<MEDCouplingFieldDiscretizationP1>(fds);
+}
+
MEDCouplingFieldDiscretizationPerCell::MEDCouplingFieldDiscretizationPerCell():_discr_per_cell(0)
{
}
}
}
+MEDCouplingFieldDiscretizationPerCell::MEDCouplingFieldDiscretizationPerCell(DataArrayInt *dpc):_discr_per_cell(dpc)
+{
+ if(_discr_per_cell)
+ _discr_per_cell->incrRef();
+}
+
void MEDCouplingFieldDiscretizationPerCell::updateTime() const
{
if(_discr_per_cell)
if(_discr_per_cell->getNumberOfTuples()!=nbOfCells)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationGauss::computeTupleIdsToSelectFromCellIds : mismatch of nb of tuples of cell ids array and number of cells !");
nbOfNodesPerCell->computeOffsetsFull();
- MCAuto<DataArrayInt> sel=DataArrayInt::New(); sel->useArray(startCellIds,false,CPP_DEALLOC,(int)std::distance(startCellIds,endCellIds),1);
+ MCAuto<DataArrayInt> sel=DataArrayInt::New(); sel->useArray(startCellIds,false,DeallocType::CPP_DEALLOC,(int)std::distance(startCellIds,endCellIds),1);
return sel->buildExplicitArrByRanges(nbOfNodesPerCell);
}
throw INTERP_KERNEL::Exception("Number of cells has changed and becomes higher with some cells that have been split ! Unable to conserve the Gauss field !");
}
+MCAuto<MEDCouplingFieldDiscretization> MEDCouplingFieldDiscretizationGauss::aggregate(std::vector<const MEDCouplingFieldDiscretization *>& fds) const
+{
+ if(fds.empty())
+ throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationGauss::aggregate : input array is empty");
+ std::vector<MEDCouplingGaussLocalization> loc;//store the localizations for the output GaussDiscretization object
+ std::vector< MCAuto<DataArrayInt> > discPerCells(fds.size());
+ std::size_t i(0);
+ for(auto it=fds.begin();it!=fds.end();++it,++i)
+ {
+ const MEDCouplingFieldDiscretizationGauss *itc(dynamic_cast<const MEDCouplingFieldDiscretizationGauss *>(*it));
+ if(!itc)
+ throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationGauss::aggregate : same field discretization expected for all input discretizations !");
+ //
+ std::vector<MEDCouplingGaussLocalization> loc2(itc->_loc);
+ std::vector<int> newLocId(loc2.size());
+ for(std::size_t j=0;j<loc2.size();++j)
+ {
+ std::size_t k(0);
+ for(;k<loc.size();++k)
+ {
+ if(loc2[j].isEqual(loc[k],1e-10))
+ {
+ newLocId[j]=(int)k;
+ break;
+ }
+ }
+ if(k==loc.size())// current loc2[j]
+ {
+ newLocId[j]=(int)loc.size();
+ loc.push_back(loc2[j]);
+ }
+ }
+ const DataArrayInt *dpc(itc->_discr_per_cell);
+ if(!dpc)
+ throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationGauss::aggregate : Presence of nullptr array of disc per cell !");
+ MCAuto<DataArrayInt> dpc2(dpc->deepCopy());
+ dpc2->transformWithIndArr(newLocId.data(),newLocId.data()+newLocId.size());
+ discPerCells[i]=dpc2;
+ }
+ MCAuto<DataArrayInt> dpc3(DataArrayInt::Aggregate(ToConstVect(discPerCells)));
+ MCAuto<MEDCouplingFieldDiscretizationGauss> ret(new MEDCouplingFieldDiscretizationGauss(dpc3,loc));
+ return DynamicCast<MEDCouplingFieldDiscretizationGauss,MEDCouplingFieldDiscretization>(ret);
+}
+
void MEDCouplingFieldDiscretizationGauss::setGaussLocalizationOnType(const MEDCouplingMesh *mesh, INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
const std::vector<double>& gsCoo, const std::vector<double>& wg)
{
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationGaussNE::computeTupleIdsToSelectFromCellIds : null mesh !");
MCAuto<DataArrayInt> nbOfNodesPerCell=mesh->computeNbOfNodesPerCell();
nbOfNodesPerCell->computeOffsetsFull();
- MCAuto<DataArrayInt> sel=DataArrayInt::New(); sel->useArray(startCellIds,false,CPP_DEALLOC,(int)std::distance(startCellIds,endCellIds),1);
+ MCAuto<DataArrayInt> sel=DataArrayInt::New(); sel->useArray(startCellIds,false,DeallocType::CPP_DEALLOC,(int)std::distance(startCellIds,endCellIds),1);
return sel->buildExplicitArrByRanges(nbOfNodesPerCell);
}
throw INTERP_KERNEL::Exception("Not implemented yet !");
}
+MCAuto<MEDCouplingFieldDiscretization> MEDCouplingFieldDiscretizationGaussNE::aggregate(std::vector<const MEDCouplingFieldDiscretization *>& fds) const
+{
+ return EasyAggregate<MEDCouplingFieldDiscretizationGaussNE>(fds);
+}
+
void MEDCouplingFieldDiscretizationGaussNE::renumberValuesOnCellsR(const MEDCouplingMesh *mesh, const int *new2old, int newSz, DataArrayDouble *arr) const
{
throw INTERP_KERNEL::Exception("Not implemented yet !");
stream << "Kriging spatial discretization.";
}
+MCAuto<MEDCouplingFieldDiscretization> MEDCouplingFieldDiscretizationKriging::aggregate(std::vector<const MEDCouplingFieldDiscretization *>& fds) const
+{
+ return EasyAggregate<MEDCouplingFieldDiscretizationKriging>(fds);
+}
+
/*!
* Returns the matrix of size nbRows = \a nbOfTargetPoints and \a nbCols = \a nbCols. This matrix is useful if
*
MCAuto<DataArrayDouble> coords=getLocalizationOfDiscValues(mesh);
int nbOfPts(coords->getNumberOfTuples()),dimension(coords->getNumberOfComponents());
MCAuto<DataArrayDouble> locArr=DataArrayDouble::New();
- locArr->useArray(loc,false,CPP_DEALLOC,nbOfTargetPoints,dimension);
+ locArr->useArray(loc,false,DeallocType::CPP_DEALLOC,nbOfTargetPoints,dimension);
nbCols=nbOfPts;
//
MCAuto<DataArrayDouble> matrix2=coords->buildEuclidianDistanceDenseMatrixWith(locArr);
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
MEDCOUPLING_EXPORT virtual void renumberValuesOnNodes(double epsOnVals, const int *old2New, int newNbOfNodes, DataArrayDouble *arr) const = 0;
MEDCOUPLING_EXPORT virtual void renumberValuesOnCells(double epsOnVals, const MEDCouplingMesh *mesh, const int *old2New, int newSz, DataArrayDouble *arr) const = 0;
MEDCOUPLING_EXPORT virtual void renumberValuesOnCellsR(const MEDCouplingMesh *mesh, const int *new2old, int newSz, DataArrayDouble *arr) const = 0;
+ MEDCOUPLING_EXPORT virtual MCAuto<MEDCouplingFieldDiscretization> aggregate(std::vector<const MEDCouplingFieldDiscretization *>& fds) const = 0;
MEDCOUPLING_EXPORT virtual void getSerializationIntArray(DataArrayInt *& arr) const;
MEDCOUPLING_EXPORT virtual void getTinySerializationIntInformation(std::vector<int>& tinyInfo) const;
MEDCOUPLING_EXPORT virtual void getTinySerializationDbleInformation(std::vector<double>& tinyInfo) const;
MEDCOUPLING_EXPORT MEDCouplingFieldDiscretization();
MEDCOUPLING_EXPORT static void RenumberEntitiesFromO2NArr(double epsOnVals, const int *old2NewPtr, int newNbOfEntity, DataArrayDouble *arr, const std::string& msg);
MEDCOUPLING_EXPORT static void RenumberEntitiesFromN2OArr(const int *new2OldPtr, int new2OldSz, DataArrayDouble *arr, const std::string& msg);
+ template<class FIELD_DISC>
+ static MCAuto<MEDCouplingFieldDiscretization> EasyAggregate(std::vector<const MEDCouplingFieldDiscretization *>& fds);
protected:
double _precision;
static const double DFLT_PRECISION;
MEDCOUPLING_EXPORT void renumberValuesOnNodes(double epsOnVals, const int *old2New, int newNbOfNodes, DataArrayDouble *arr) const;
MEDCOUPLING_EXPORT void renumberValuesOnCells(double epsOnVals, const MEDCouplingMesh *mesh, const int *old2New, int newSz, DataArrayDouble *arr) const;
MEDCOUPLING_EXPORT void renumberValuesOnCellsR(const MEDCouplingMesh *mesh, const int *new2old, int newSz, DataArrayDouble *arr) const;
+ MEDCOUPLING_EXPORT MCAuto<MEDCouplingFieldDiscretization> aggregate(std::vector<const MEDCouplingFieldDiscretization *>& fds) const override;
MEDCOUPLING_EXPORT MEDCouplingMesh *buildSubMeshData(const MEDCouplingMesh *mesh, const int *start, const int *end, DataArrayInt *&di) const;
MEDCOUPLING_EXPORT MEDCouplingMesh *buildSubMeshDataRange(const MEDCouplingMesh *mesh, int beginCellIds, int endCellIds, int stepCellIds, int& beginOut, int& endOut, int& stepOut, DataArrayInt *&di) const;
MEDCOUPLING_EXPORT DataArrayInt *computeTupleIdsToSelectFromCellIds(const MEDCouplingMesh *mesh, const int *startCellIds, const int *endCellIds) const;
MEDCOUPLING_EXPORT void getValueOn(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, const double *loc, double *res) const;
MEDCOUPLING_EXPORT DataArrayDouble *getValueOnMulti(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, const double *loc, int nbOfPoints) const;
MEDCOUPLING_EXPORT void reprQuickOverview(std::ostream& stream) const;
+ MEDCOUPLING_EXPORT MCAuto<MEDCouplingFieldDiscretization> aggregate(std::vector<const MEDCouplingFieldDiscretization *>& fds) const override;
public:
static const char REPR[];
static const TypeOfField TYPE;
MEDCouplingFieldDiscretizationPerCell();
MEDCouplingFieldDiscretizationPerCell(const MEDCouplingFieldDiscretizationPerCell& other, const int *startCellIds, const int *endCellIds);
MEDCouplingFieldDiscretizationPerCell(const MEDCouplingFieldDiscretizationPerCell& other, int beginCellIds, int endCellIds, int stepCellIds);
+ MEDCouplingFieldDiscretizationPerCell(DataArrayInt *dpc);
~MEDCouplingFieldDiscretizationPerCell();
void updateTime() const;
std::size_t getHeapMemorySizeWithoutChildren() const;
protected:
void buildDiscrPerCellIfNecessary(const MEDCouplingMesh *mesh);
protected:
- DataArrayInt *_discr_per_cell;
+ DataArrayIdType *_discr_per_cell;
static const int DFT_INVALID_LOCID_VALUE;
};
MEDCOUPLING_EXPORT void renumberValuesOnNodes(double epsOnVals, const int *old2New, int newNbOfNodes, DataArrayDouble *arr) const;
MEDCOUPLING_EXPORT void renumberValuesOnCells(double epsOnVals, const MEDCouplingMesh *mesh, const int *old2New, int newSz, DataArrayDouble *arr) const;
MEDCOUPLING_EXPORT void renumberValuesOnCellsR(const MEDCouplingMesh *mesh, const int *new2old, int newSz, DataArrayDouble *arr) const;
+ MEDCOUPLING_EXPORT MCAuto<MEDCouplingFieldDiscretization> aggregate(std::vector<const MEDCouplingFieldDiscretization *>& fds) const override;
MEDCOUPLING_EXPORT void setGaussLocalizationOnType(const MEDCouplingMesh *mesh, INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
const std::vector<double>& gsCoo, const std::vector<double>& wg);
MEDCOUPLING_EXPORT void setGaussLocalizationOnCells(const MEDCouplingMesh *mesh, const int *begin, const int *end, const std::vector<double>& refCoo,
protected:
MEDCouplingFieldDiscretizationGauss(const MEDCouplingFieldDiscretizationGauss& other, const int *startCellIds=0, const int *endCellIds=0);
MEDCouplingFieldDiscretizationGauss(const MEDCouplingFieldDiscretizationGauss& other, int beginCellIds, int endCellIds, int stepCellIds);
+ MEDCouplingFieldDiscretizationGauss(DataArrayInt *dpc, const std::vector<MEDCouplingGaussLocalization>& loc):MEDCouplingFieldDiscretizationPerCell(dpc),_loc(loc) { }
void zipGaussLocalizations();
int getOffsetOfCell(int cellId) const;
void checkLocalizationId(int locId) const;
MEDCOUPLING_EXPORT void renumberValuesOnNodes(double epsOnVals, const int *old2New, int newNbOfNodes, DataArrayDouble *arr) const;
MEDCOUPLING_EXPORT void renumberValuesOnCells(double epsOnVals, const MEDCouplingMesh *mesh, const int *old2New, int newSz, DataArrayDouble *arr) const;
MEDCOUPLING_EXPORT void renumberValuesOnCellsR(const MEDCouplingMesh *mesh, const int *new2old, int newSz, DataArrayDouble *arr) const;
+ MEDCOUPLING_EXPORT MCAuto<MEDCouplingFieldDiscretization> aggregate(std::vector<const MEDCouplingFieldDiscretization *>& fds) const override;
MEDCOUPLING_EXPORT void reprQuickOverview(std::ostream& stream) const;
MEDCOUPLING_EXPORT static const double *GetWeightArrayFromGeometricType(INTERP_KERNEL::NormalizedCellType geoType, std::size_t& lgth);
MEDCOUPLING_EXPORT static const double *GetRefCoordsFromGeometricType(INTERP_KERNEL::NormalizedCellType geoType, std::size_t& lgth);
MEDCOUPLING_EXPORT void getValueOn(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, const double *loc, double *res) const;
MEDCOUPLING_EXPORT DataArrayDouble *getValueOnMulti(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, const double *loc, int nbOfPoints) const;
MEDCOUPLING_EXPORT void reprQuickOverview(std::ostream& stream) const;
+ MEDCOUPLING_EXPORT MCAuto<MEDCouplingFieldDiscretization> aggregate(std::vector<const MEDCouplingFieldDiscretization *>& fds) const override;
public://specific part
MEDCOUPLING_EXPORT DataArrayDouble *computeEvaluationMatrixOnGivenPts(const MEDCouplingMesh *mesh, const double *loc, int nbOfTargetPoints, int& nbCols) const;
MEDCOUPLING_EXPORT DataArrayDouble *computeInverseMatrix(const MEDCouplingMesh *mesh, int& isDrift, int& matSz) const;
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
*/
MEDCouplingFieldDouble *MEDCouplingFieldDouble::MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2)
{
- if(!f1->areCompatibleForMerge(f2))
- throw INTERP_KERNEL::Exception("Fields are not compatible. Unable to apply MergeFields on them ! Check support mesh, field nature, and spatial and time discretisation.");
- const MEDCouplingMesh *m1(f1->getMesh()),*m2(f2->getMesh());
- if(!f1->timeDiscr())
- throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::MergeFields : no time discr of f1 !");
- if(!f1->_type)
- throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::MergeFields : no spatial discr of f1 !");
- MEDCouplingTimeDiscretization *td(f1->timeDiscr()->aggregate(f2->timeDiscr()));
- td->copyTinyAttrFrom(*f1->timeDiscr());
- MCAuto<MEDCouplingFieldDouble> ret(new MEDCouplingFieldDouble(f1->getNature(),td,f1->_type->clone()));
- ret->setName(f1->getName());
- ret->setDescription(f1->getDescription());
- if(m1)
- {
- MCAuto<MEDCouplingMesh> m=m1->mergeMyselfWith(m2);
- ret->setMesh(m);
- }
- return ret.retn();
+ std::vector<const MEDCouplingFieldDouble *> a(2);
+ a[0]=f1; a[1]=f2;
+ return MergeFields(a);
}
/*!
*/
MEDCouplingFieldDouble *MEDCouplingFieldDouble::MergeFields(const std::vector<const MEDCouplingFieldDouble *>& a)
{
- if(a.size()<1)
- throw INTERP_KERNEL::Exception("FieldDouble::MergeFields : size of array must be >= 1 !");
+ if(a.empty())
+ throw INTERP_KERNEL::Exception("FieldDouble::MergeFields : input array is empty !");
std::vector< MCAuto<MEDCouplingUMesh> > ms(a.size());
std::vector< const MEDCouplingUMesh *> ms2(a.size());
std::vector< const MEDCouplingTimeDiscretization *> tds(a.size());
- std::vector<const MEDCouplingFieldDouble *>::const_iterator it=a.begin();
- const MEDCouplingFieldDouble *ref=(*it++);
+ std::vector< const MEDCouplingFieldDouble *>::const_iterator it=a.begin();
+ std::vector<const MEDCouplingFieldDiscretization *> fds(a.size());
+ const MEDCouplingFieldDouble *ref((*it++));
if(!ref)
- throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::MergeFields : presence of NULL instance in first place of input vector !");
+ throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::MergeFields : presence of nullptr instance in first place of input vector !");
+ if(!ref->getDiscretization())
+ throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::MergeFields : nullptr spatial discretization !");
for(;it!=a.end();it++)
if(!ref->areCompatibleForMerge(*it))
throw INTERP_KERNEL::Exception("Fields are not compatible. Unable to apply MergeFields on them! Check support mesh, field nature, and spatial and time discretisation.");
for(int i=0;i<(int)a.size();i++)
{
+ if(!a[i])
+ throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::MergeFields : presence of nullptr instance in input vector !");
if(a[i]->getMesh())
{ ms[i]=a[i]->getMesh()->buildUnstructured(); ms2[i]=ms[i]; }
else
{ ms[i]=0; ms2[i]=0; }
tds[i]=a[i]->timeDiscr();
+ fds[i]=a[i]->getDiscretization();
}
MEDCouplingTimeDiscretization *td(tds[0]->aggregate(tds));
+ MCAuto<MEDCouplingFieldDiscretization> fda(fds[0]->aggregate(fds));
td->copyTinyAttrFrom(*(a[0]->timeDiscr()));
- MCAuto<MEDCouplingFieldDouble> ret(new MEDCouplingFieldDouble(a[0]->getNature(),td,a[0]->_type->clone()));
+ MCAuto<MEDCouplingFieldDouble> ret(new MEDCouplingFieldDouble(a[0]->getNature(),td,fda.retn()));
ret->setName(a[0]->getName());
ret->setDescription(a[0]->getDescription());
if(ms2[0])
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
MEDCOUPLING_EXPORT static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
MEDCOUPLING_EXPORT MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const { return MinFields(this,&other); }
MEDCOUPLING_EXPORT MEDCouplingFieldDouble *negate() const;
- MEDCOUPLING_EXPORT MEDCouplingFieldDouble *operator+(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception) { return AddFields(this,&other); }
+ MEDCOUPLING_EXPORT MEDCouplingFieldDouble *operator+(const MEDCouplingFieldDouble& other) const { return AddFields(this,&other); }
MEDCOUPLING_EXPORT const MEDCouplingFieldDouble &operator+=(const MEDCouplingFieldDouble& other);
MEDCOUPLING_EXPORT static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
- MEDCOUPLING_EXPORT MEDCouplingFieldDouble *operator-(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception) { return SubstractFields(this,&other); }
+ MEDCOUPLING_EXPORT MEDCouplingFieldDouble *operator-(const MEDCouplingFieldDouble& other) const { return SubstractFields(this,&other); }
MEDCOUPLING_EXPORT const MEDCouplingFieldDouble &operator-=(const MEDCouplingFieldDouble& other);
MEDCOUPLING_EXPORT static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
- MEDCouplingFieldDouble *operator*(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception) { return MultiplyFields(this,&other); }
+ MEDCouplingFieldDouble *operator*(const MEDCouplingFieldDouble& other) const { return MultiplyFields(this,&other); }
MEDCOUPLING_EXPORT const MEDCouplingFieldDouble &operator*=(const MEDCouplingFieldDouble& other);
MEDCOUPLING_EXPORT static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
- MEDCOUPLING_EXPORT MEDCouplingFieldDouble *operator/(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception) { return DivideFields(this,&other); }
+ MEDCOUPLING_EXPORT MEDCouplingFieldDouble *operator/(const MEDCouplingFieldDouble& other) const { return DivideFields(this,&other); }
MEDCOUPLING_EXPORT const MEDCouplingFieldDouble &operator/=(const MEDCouplingFieldDouble& other);
MEDCOUPLING_EXPORT static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
MEDCOUPLING_EXPORT MEDCouplingFieldDouble *operator^(const MEDCouplingFieldDouble& other) const;
-// Copyright (C) 2007-2017 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2017 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2016 CEA/DEN, EDF R&D
+// Copyright (C) 2016-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2016 CEA/DEN, EDF R&D
+// Copyright (C) 2016-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
int _space_dim;
double _origin[3];
double _dxyz[3];
- int _structure[3];
+ mcIdType _structure[3];
std::string _axis_unit;
};
}
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
MCAuto<MEDCouplingUMesh> _mesh2D;
MCAuto<MEDCouplingUMesh> _mesh1D;
//! New to old 3D cell Ids Array
- MCAuto<DataArrayInt> _mesh3D_ids;
- int _cell_2D_id;
+ MCAuto<DataArrayIdType> _mesh3D_ids;
+ mcIdType _cell_2D_id;
};
}
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
template class MEDCoupling::DataArrayIterator<int>;
template class MEDCoupling::DataArrayDiscrete<Int32>;
template class MEDCoupling::DataArrayDiscreteSigned<Int32>;
+template class MEDCoupling::DataArrayDiscrete<Int64>;
+template class MEDCoupling::DataArrayDiscreteSigned<Int64>;
template class MEDCoupling::DataArrayTuple<int>;
template class MEDCoupling::DataArrayTuple<double>;
template class MEDCoupling::DataArrayTuple<float>;
}
}
-/*!
- * Returns a textual and human readable representation of \a this instance of
- * DataArrayDouble. This text is shown when a DataArrayDouble is printed in Python.
- * \return std::string - text describing \a this DataArrayDouble.
- *
- * \sa reprNotTooLong, reprZip
- */
-std::string DataArrayDouble::repr() const
-{
- std::ostringstream ret;
- reprStream(ret);
- return ret.str();
-}
-
-std::string DataArrayDouble::reprZip() const
-{
- std::ostringstream ret;
- reprZipStream(ret);
- return ret.str();
-}
-
void DataArrayDouble::writeVTK(std::ostream& ofs, int indent, const std::string& nameInFile, DataArrayByte *byteArr) const
{
static const char SPACE[4]={' ',' ',' ',' '};
stream << "DataArrayDouble C++ instance at " << this << ". ";
if(isAllocated())
{
- int nbOfCompo=(int)_info_on_compo.size();
+ std::size_t nbOfCompo(_info_on_compo.size());
if(nbOfCompo>=1)
{
- int nbOfTuples=getNumberOfTuples();
+ std::size_t nbOfTuples(getNumberOfTuples());
stream << "Number of tuples : " << nbOfTuples << ". Number of components : " << nbOfCompo << "." << std::endl;
reprQuickOverviewData(stream,MAX_NB_OF_BYTE_IN_REPR);
}
return this->buildDA(nbOfTuples,nbOfCompo);
}
-/*!
- * Returns a new instance of DataArrayInt. The caller is to delete this array
- * using decrRef() as it is no more needed.
- */
-DataArrayInt *DataArrayInt::New()
-{
- return new DataArrayInt;
-}
-
/*!
* Returns the only one value in \a this, if and only if number of elements
* (nb of tuples * nb of components) is equal to 1, and that \a this is allocated.
throw INTERP_KERNEL::Exception("DataArrayInt::intValue : DataArrayInt instance is not allocated !");
}
-/*!
- * Returns an integer value characterizing \a this array, which is useful for a quick
- * comparison of many instances of DataArrayInt.
- * \return int - the hash value.
- * \throw If \a this is not allocated.
- */
-int DataArrayInt::getHashCode() const
-{
- checkAllocated();
- std::size_t nbOfElems=getNbOfElems();
- int ret=nbOfElems*65536;
- int delta=3;
- if(nbOfElems>48)
- delta=nbOfElems/8;
- int ret0=0;
- const int *pt=begin();
- for(std::size_t i=0;i<nbOfElems;i+=delta)
- ret0+=pt[i] & 0x1FFF;
- return ret+ret0;
-}
-
/*!
* Returns a full copy of \a this. For more info on copying data arrays see
* \ref MEDCouplingArrayBasicsCopyDeep.
return new DataArrayInt32(*this);
}
-/*!
- * Returns a textual and human readable representation of \a this instance of
- * DataArrayInt. This text is shown when a DataArrayInt is printed in Python.
- * \return std::string - text describing \a this DataArrayInt.
- *
- * \sa reprNotTooLong, reprZip
- */
-std::string DataArrayInt::repr() const
-{
- std::ostringstream ret;
- reprStream(ret);
- return ret.str();
-}
-
-std::string DataArrayInt::reprZip() const
-{
- std::ostringstream ret;
- reprZipStream(ret);
- return ret.str();
-}
-
-void DataArrayInt::writeVTK(std::ostream& ofs, int indent, const std::string& type, const std::string& nameInFile, DataArrayByte *byteArr) const
-{
- static const char SPACE[4]={' ',' ',' ',' '};
- checkAllocated();
- std::string idt(indent,' ');
- ofs << idt << "<DataArray type=\"" << type << "\" Name=\"" << nameInFile << "\" NumberOfComponents=\"" << getNumberOfComponents() << "\"";
- if(byteArr)
- {
- ofs << " format=\"appended\" offset=\"" << byteArr->getNumberOfTuples() << "\">";
- if(std::string(type)=="Int32")
- {
- const char *data(reinterpret_cast<const char *>(begin()));
- std::size_t sz(getNbOfElems()*sizeof(int));
- byteArr->insertAtTheEnd(data,data+sz);
- byteArr->insertAtTheEnd(SPACE,SPACE+4);
- }
- else if(std::string(type)=="Int8")
- {
- INTERP_KERNEL::AutoPtr<char> tmp(new char[getNbOfElems()]);
- std::copy(begin(),end(),(char *)tmp);
- byteArr->insertAtTheEnd((char *)tmp,(char *)tmp+getNbOfElems());
- byteArr->insertAtTheEnd(SPACE,SPACE+4);
- }
- else if(std::string(type)=="UInt8")
- {
- INTERP_KERNEL::AutoPtr<unsigned char> tmp(new unsigned char[getNbOfElems()]);
- std::copy(begin(),end(),(unsigned char *)tmp);
- byteArr->insertAtTheEnd((unsigned char *)tmp,(unsigned char *)tmp+getNbOfElems());
- byteArr->insertAtTheEnd(SPACE,SPACE+4);
- }
- else
- throw INTERP_KERNEL::Exception("DataArrayInt::writeVTK : Only Int32, Int8 and UInt8 supported !");
- }
- else
- {
- ofs << " RangeMin=\"" << getMinValueInArray() << "\" RangeMax=\"" << getMaxValueInArray() << "\" format=\"ascii\">\n" << idt;
- std::copy(begin(),end(),std::ostream_iterator<int>(ofs," "));
- }
- ofs << std::endl << idt << "</DataArray>\n";
-}
-
-void DataArrayInt::reprCppStream(const std::string& varName, std::ostream& stream) const
-{
- int nbTuples=getNumberOfTuples(),nbComp=getNumberOfComponents();
- const int *data=getConstPointer();
- stream << "DataArrayInt *" << varName << "=DataArrayInt::New();" << std::endl;
- if(nbTuples*nbComp>=1)
- {
- stream << "const int " << varName << "Data[" << nbTuples*nbComp << "]={";
- std::copy(data,data+nbTuples*nbComp-1,std::ostream_iterator<int>(stream,","));
- stream << data[nbTuples*nbComp-1] << "};" << std::endl;
- stream << varName << "->useArray(" << varName << "Data,false,CPP_DEALLOC," << nbTuples << "," << nbComp << ");" << std::endl;
- }
- else
- stream << varName << "->alloc(" << nbTuples << "," << nbComp << ");" << std::endl;
- stream << varName << "->setName(\"" << getName() << "\");" << std::endl;
-}
-
-/*!
- * Method that gives a quick overvien of \a this for python.
- */
-void DataArrayInt::reprQuickOverview(std::ostream& stream) const
-{
- static const std::size_t MAX_NB_OF_BYTE_IN_REPR=300;
- stream << "DataArrayInt C++ instance at " << this << ". ";
- if(isAllocated())
- {
- int nbOfCompo=(int)_info_on_compo.size();
- if(nbOfCompo>=1)
- {
- int nbOfTuples=getNumberOfTuples();
- stream << "Number of tuples : " << nbOfTuples << ". Number of components : " << nbOfCompo << "." << std::endl;
- reprQuickOverviewData(stream,MAX_NB_OF_BYTE_IN_REPR);
- }
- else
- stream << "Number of components : 0.";
- }
- else
- stream << "*** No data allocated ****";
-}
-
-void DataArrayInt::reprQuickOverviewData(std::ostream& stream, std::size_t maxNbOfByteInRepr) const
-{
- const int *data=begin();
- int nbOfTuples=getNumberOfTuples();
- int nbOfCompo=(int)_info_on_compo.size();
- std::ostringstream oss2; oss2 << "[";
- std::string oss2Str(oss2.str());
- bool isFinished=true;
- for(int i=0;i<nbOfTuples && isFinished;i++)
- {
- if(nbOfCompo>1)
- {
- oss2 << "(";
- for(int j=0;j<nbOfCompo;j++,data++)
- {
- oss2 << *data;
- if(j!=nbOfCompo-1) oss2 << ", ";
- }
- oss2 << ")";
- }
- else
- oss2 << *data++;
- if(i!=nbOfTuples-1) oss2 << ", ";
- std::string oss3Str(oss2.str());
- if(oss3Str.length()<maxNbOfByteInRepr)
- oss2Str=oss3Str;
- else
- isFinished=false;
- }
- stream << oss2Str;
- if(!isFinished)
- stream << "... ";
- stream << "]";
-}
-
/*!
* Computes distribution of values of \a this one-dimensional array between given value
* ranges (casts). This method is typically useful for entity number splitting by types,
}
}
-
-/*!
- * Modifies in place \a this one-dimensional array so that each value \a v = \a indArrBg[ \a v ],
- * i.e. a current value is used as in index to get a new value from \a indArrBg.
- * \param [in] indArrBg - pointer to the first element of array of new values to assign
- * to \a this array.
- * \param [in] indArrEnd - specifies the end of the array \a indArrBg, so that
- * the last value of \a indArrBg is \a indArrEnd[ -1 ].
- * \throw If \a this->getNumberOfComponents() != 1
- * \throw If any value of \a this can't be used as a valid index for
- * [\a indArrBg, \a indArrEnd).
- *
- * \sa changeValue, findIdForEach
- */
-void DataArrayInt::transformWithIndArr(const int *indArrBg, const int *indArrEnd)
-{
- this->checkAllocated();
- if(this->getNumberOfComponents()!=1)
- throw INTERP_KERNEL::Exception("Call transformWithIndArr method on DataArrayInt with only one component, you can call 'rearrange' method before !");
- int nbElemsIn((int)std::distance(indArrBg,indArrEnd)),nbOfTuples(getNumberOfTuples()),*pt(getPointer());
- for(int i=0;i<nbOfTuples;i++,pt++)
- {
- if(*pt>=0 && *pt<nbElemsIn)
- *pt=indArrBg[*pt];
- else
- {
- std::ostringstream oss; oss << "DataArrayInt::transformWithIndArr : error on tuple #" << i << " of this value is " << *pt << ", should be in [0," << nbElemsIn << ") !";
- throw INTERP_KERNEL::Exception(oss.str());
- }
- }
- this->declareAsNew();
-}
-
-void DataArrayInt::transformWithIndArr(const MapKeyVal<int>& m)
-{
- this->checkAllocated();
- if(this->getNumberOfComponents()!=1)
- throw INTERP_KERNEL::Exception("Call transformWithIndArr method on DataArrayInt with only one component, you can call 'rearrange' method before !");
- const std::map<int,int>& dat(m.data());
- int nbOfTuples(getNumberOfTuples()),*pt(getPointer());
- for(int i=0;i<nbOfTuples;i++,pt++)
- {
- std::map<int,int>::const_iterator it(dat.find(*pt));
- if(it!=dat.end())
- *pt=(*it).second;
- else
- {
- std::ostringstream oss; oss << "DataArrayInt::transformWithIndArr : error on tuple #" << i << " of this value is " << *pt << " not in map !";
- throw INTERP_KERNEL::Exception(oss.str());
- }
- }
- this->declareAsNew();
-}
-
/*!
* Creates a one-dimensional DataArrayInt (\a res) whose contents are computed from
* values of \a this (\a a) and the given (\a indArr) arrays as follows:
const int *pt=getConstPointer();
int *pt2=CheckAndPreparePermutation(pt,pt+nbTuples);
DataArrayInt *ret=DataArrayInt::New();
- ret->useArray(pt2,true,C_DEALLOC,nbTuples,1);
+ ret->useArray(pt2,true,DeallocType::C_DEALLOC,nbTuples,1);
return ret;
}
return new DataArrayIntIterator(this);
}
-/*!
- * Creates a new DataArrayInt containing IDs (indices) of tuples holding value equal to a
- * given one. The ids are sorted in the ascending order.
- * \param [in] val - the value to find within \a this.
- * \return DataArrayInt * - a new instance of DataArrayInt. The caller is to delete this
- * array using decrRef() as it is no more needed.
- * \throw If \a this is not allocated.
- * \throw If \a this->getNumberOfComponents() != 1.
- * \sa DataArrayInt::findIdsEqualTuple
- */
-DataArrayInt *DataArrayInt::findIdsEqual(int val) const
-{
- checkAllocated();
- if(getNumberOfComponents()!=1)
- throw INTERP_KERNEL::Exception("DataArrayInt::findIdsEqual : the array must have only one component, you can call 'rearrange' method before !");
- const int *cptr(getConstPointer());
- MCAuto<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
- int nbOfTuples=getNumberOfTuples();
- for(int i=0;i<nbOfTuples;i++,cptr++)
- if(*cptr==val)
- ret->pushBackSilent(i);
- return ret.retn();
-}
-
/*!
* Creates a new DataArrayInt containing IDs (indices) of tuples holding value \b not
* equal to a given one.
ret[0]=0;
for(int i=0;i<nbOfTuples;i++)
ret[i+1]=work[i]+ret[i];
- useArray(ret,true,C_DEALLOC,nbOfTuples+1,1);
+ useArray(ret,true,DeallocType::C_DEALLOC,nbOfTuples+1,1);
declareAsNew();
}
declareAsNew();
}
+/*!
+ * This method works on a pair input (\b arrIn, \b arrIndxIn) where \b arrIn indexes is in \b arrIndxIn
+ * (\ref numbering-indirect).
+ * This method returns the result of the extraction ( specified by a set of ids in [\b idsOfSelectBg , \b idsOfSelectEnd ) ).
+ * The selection of extraction is done standardly in new2old format.
+ * This method returns indexed arrays (\ref numbering-indirect) using 2 arrays (arrOut,arrIndexOut).
+ *
+ * \param [in] idsOfSelectBg begin of set of ids of the input extraction (included)
+ * \param [in] idsOfSelectEnd end of set of ids of the input extraction (excluded)
+ * \param [in] arrIn arr origin array from which the extraction will be done.
+ * \param [in] arrIndxIn is the input index array allowing to walk into \b arrIn
+ * \param [out] arrOut the resulting array
+ * \param [out] arrIndexOut the index array of the resulting array \b arrOut
+ * \sa DataArrayInt::ExtractFromIndexedArraysSlice
+ */
+void DataArrayInt::ExtractFromIndexedArrays(const int *idsOfSelectBg, const int *idsOfSelectEnd, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
+ DataArrayInt* &arrOut, DataArrayInt* &arrIndexOut)
+{
+ if(!arrIn || !arrIndxIn)
+ throw INTERP_KERNEL::Exception("DataArrayInt::ExtractFromIndexedArrays : input pointer is NULL !");
+ arrIn->checkAllocated(); arrIndxIn->checkAllocated();
+ if(arrIn->getNumberOfComponents()!=1 || arrIndxIn->getNumberOfComponents()!=1)
+ throw INTERP_KERNEL::Exception("DataArrayInt::ExtractFromIndexedArrays : input arrays must have exactly one component !");
+ std::size_t sz=std::distance(idsOfSelectBg,idsOfSelectEnd);
+ const int *arrInPtr=arrIn->begin();
+ const int *arrIndxPtr=arrIndxIn->begin();
+ int nbOfGrps=arrIndxIn->getNumberOfTuples()-1;
+ if(nbOfGrps<0)
+ throw INTERP_KERNEL::Exception("DataArrayInt::ExtractFromIndexedArrays : The format of \"arrIndxIn\" is invalid ! Its nb of tuples should be >=1 !");
+ int maxSizeOfArr=arrIn->getNumberOfTuples();
+ MCAuto<DataArrayInt> arro=DataArrayInt::New();
+ MCAuto<DataArrayInt> arrIo=DataArrayInt::New();
+ arrIo->alloc((int)(sz+1),1);
+ const int *idsIt=idsOfSelectBg;
+ int *work=arrIo->getPointer();
+ *work++=0;
+ int lgth=0;
+ for(std::size_t i=0;i<sz;i++,work++,idsIt++)
+ {
+ if(*idsIt>=0 && *idsIt<nbOfGrps)
+ lgth+=arrIndxPtr[*idsIt+1]-arrIndxPtr[*idsIt];
+ else
+ {
+ std::ostringstream oss; oss << "DataArrayInt::ExtractFromIndexedArrays : id located on pos #" << i << " value is " << *idsIt << " ! Must be in [0," << nbOfGrps << ") !";
+ throw INTERP_KERNEL::Exception(oss.str());
+ }
+ if(lgth>=work[-1])
+ *work=lgth;
+ else
+ {
+ std::ostringstream oss; oss << "DataArrayInt::ExtractFromIndexedArrays : id located on pos #" << i << " value is " << *idsIt << " and at this pos arrIndxIn[" << *idsIt;
+ oss << "+1]-arrIndxIn[" << *idsIt << "] < 0 ! The input index array is bugged !";
+ throw INTERP_KERNEL::Exception(oss.str());
+ }
+ }
+ arro->alloc(lgth,1);
+ work=arro->getPointer();
+ idsIt=idsOfSelectBg;
+ for(std::size_t i=0;i<sz;i++,idsIt++)
+ {
+ if(arrIndxPtr[*idsIt]>=0 && arrIndxPtr[*idsIt+1]<=maxSizeOfArr)
+ work=std::copy(arrInPtr+arrIndxPtr[*idsIt],arrInPtr+arrIndxPtr[*idsIt+1],work);
+ else
+ {
+ std::ostringstream oss; oss << "DataArrayInt::ExtractFromIndexedArrays : id located on pos #" << i << " value is " << *idsIt << " arrIndx[" << *idsIt << "] must be >= 0 and arrIndx[";
+ oss << *idsIt << "+1] <= " << maxSizeOfArr << " (the size of arrIn)!";
+ throw INTERP_KERNEL::Exception(oss.str());
+ }
+ }
+ arrOut=arro.retn();
+ arrIndexOut=arrIo.retn();
+}
+
+/*!
+ * This method works on a pair input (\b arrIn, \b arrIndxIn) where \b arrIn indexes is in \b arrIndxIn
+ * (\ref numbering-indirect).
+ * This method returns the result of the extraction ( specified by a set of ids with a slice given by \a idsOfSelectStart, \a idsOfSelectStop and \a idsOfSelectStep ).
+ * The selection of extraction is done standardly in new2old format.
+ * This method returns indexed arrays (\ref numbering-indirect) using 2 arrays (arrOut,arrIndexOut).
+ *
+ * \param [in] idsOfSelectStart begin of set of ids of the input extraction (included)
+ * \param [in] idsOfSelectStop end of set of ids of the input extraction (excluded)
+ * \param [in] idsOfSelectStep
+ * \param [in] arrIn arr origin array from which the extraction will be done.
+ * \param [in] arrIndxIn is the input index array allowing to walk into \b arrIn
+ * \param [out] arrOut the resulting array
+ * \param [out] arrIndexOut the index array of the resulting array \b arrOut
+ * \sa DataArrayInt::ExtractFromIndexedArrays
+ */
+void DataArrayInt::ExtractFromIndexedArraysSlice(int idsOfSelectStart, int idsOfSelectStop, int idsOfSelectStep, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
+ DataArrayInt* &arrOut, DataArrayInt* &arrIndexOut)
+{
+ if(!arrIn || !arrIndxIn)
+ throw INTERP_KERNEL::Exception("DataArrayInt::ExtractFromIndexedArraysSlice : input pointer is NULL !");
+ arrIn->checkAllocated(); arrIndxIn->checkAllocated();
+ if(arrIn->getNumberOfComponents()!=1 || arrIndxIn->getNumberOfComponents()!=1)
+ throw INTERP_KERNEL::Exception("DataArrayInt::ExtractFromIndexedArraysSlice : input arrays must have exactly one component !");
+ int sz=DataArrayInt::GetNumberOfItemGivenBESRelative(idsOfSelectStart,idsOfSelectStop,idsOfSelectStep,"MEDCouplingUMesh::ExtractFromIndexedArraysSlice : Input slice ");
+ const int *arrInPtr=arrIn->begin();
+ const int *arrIndxPtr=arrIndxIn->begin();
+ int nbOfGrps=arrIndxIn->getNumberOfTuples()-1;
+ if(nbOfGrps<0)
+ throw INTERP_KERNEL::Exception("DataArrayInt::ExtractFromIndexedArraysSlice : The format of \"arrIndxIn\" is invalid ! Its nb of tuples should be >=1 !");
+ int maxSizeOfArr=arrIn->getNumberOfTuples();
+ MCAuto<DataArrayInt> arro=DataArrayInt::New();
+ MCAuto<DataArrayInt> arrIo=DataArrayInt::New();
+ arrIo->alloc((int)(sz+1),1);
+ int idsIt=idsOfSelectStart;
+ int *work=arrIo->getPointer();
+ *work++=0;
+ int lgth=0;
+ for(int i=0;i<sz;i++,work++,idsIt+=idsOfSelectStep)
+ {
+ if(idsIt>=0 && idsIt<nbOfGrps)
+ lgth+=arrIndxPtr[idsIt+1]-arrIndxPtr[idsIt];
+ else
+ {
+ std::ostringstream oss; oss << "DataArrayInt::ExtractFromIndexedArraysSlice : id located on pos #" << i << " value is " << idsIt << " ! Must be in [0," << nbOfGrps << ") !";
+ throw INTERP_KERNEL::Exception(oss.str());
+ }
+ if(lgth>=work[-1])
+ *work=lgth;
+ else
+ {
+ std::ostringstream oss; oss << "DataArrayInt::ExtractFromIndexedArraysSlice : id located on pos #" << i << " value is " << idsIt << " and at this pos arrIndxIn[" << idsIt;
+ oss << "+1]-arrIndxIn[" << idsIt << "] < 0 ! The input index array is bugged !";
+ throw INTERP_KERNEL::Exception(oss.str());
+ }
+ }
+ arro->alloc(lgth,1);
+ work=arro->getPointer();
+ idsIt=idsOfSelectStart;
+ for(int i=0;i<sz;i++,idsIt+=idsOfSelectStep)
+ {
+ if(arrIndxPtr[idsIt]>=0 && arrIndxPtr[idsIt+1]<=maxSizeOfArr)
+ work=std::copy(arrInPtr+arrIndxPtr[idsIt],arrInPtr+arrIndxPtr[idsIt+1],work);
+ else
+ {
+ std::ostringstream oss; oss << "DataArrayInt::ExtractFromIndexedArraysSlice : id located on pos #" << i << " value is " << idsIt << " arrIndx[" << idsIt << "] must be >= 0 and arrIndx[";
+ oss << idsIt << "+1] <= " << maxSizeOfArr << " (the size of arrIn)!";
+ throw INTERP_KERNEL::Exception(oss.str());
+ }
+ }
+ arrOut=arro.retn();
+ arrIndexOut=arrIo.retn();
+}
+
+/*!
+ * This method works on an input pair (\b arrIn, \b arrIndxIn) where \b arrIn indexes is in \b arrIndxIn.
+ * This method builds an output pair (\b arrOut,\b arrIndexOut) that is a copy from \b arrIn for all cell ids \b not \b in [ \b idsOfSelectBg , \b idsOfSelectEnd ) and for
+ * cellIds \b in [ \b idsOfSelectBg , \b idsOfSelectEnd ) a copy coming from the corresponding values in input pair (\b srcArr, \b srcArrIndex).
+ * This method is an generalization of MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx that performs the same thing but by without building explicitly a result output arrays.
+ *
+ * \param [in] idsOfSelectBg begin of set of ids of the input extraction (included)
+ * \param [in] idsOfSelectEnd end of set of ids of the input extraction (excluded)
+ * \param [in] arrIn arr origin array from which the extraction will be done.
+ * \param [in] arrIndxIn is the input index array allowing to walk into \b arrIn
+ * \param [in] srcArr input array that will be used as source of copy for ids in [ \b idsOfSelectBg, \b idsOfSelectEnd )
+ * \param [in] srcArrIndex index array of \b srcArr
+ * \param [out] arrOut the resulting array
+ * \param [out] arrIndexOut the index array of the resulting array \b arrOut
+ *
+ * \sa DataArrayInt::SetPartOfIndexedArraysSameIdx
+ */
+void DataArrayInt::SetPartOfIndexedArrays(const int *idsOfSelectBg, const int *idsOfSelectEnd, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
+ const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex,
+ DataArrayInt* &arrOut, DataArrayInt* &arrIndexOut)
+{
+ if(arrIn==0 || arrIndxIn==0 || srcArr==0 || srcArrIndex==0)
+ throw INTERP_KERNEL::Exception("DataArrayInt::SetPartOfIndexedArrays : presence of null pointer in input parameter !");
+ MCAuto<DataArrayInt> arro=DataArrayInt::New();
+ MCAuto<DataArrayInt> arrIo=DataArrayInt::New();
+ int nbOfTuples=arrIndxIn->getNumberOfTuples()-1;
+ std::vector<bool> v(nbOfTuples,true);
+ int offset=0;
+ const int *arrIndxInPtr=arrIndxIn->begin();
+ const int *srcArrIndexPtr=srcArrIndex->begin();
+ for(const int *it=idsOfSelectBg;it!=idsOfSelectEnd;it++,srcArrIndexPtr++)
+ {
+ if(*it>=0 && *it<nbOfTuples)
+ {
+ v[*it]=false;
+ offset+=(srcArrIndexPtr[1]-srcArrIndexPtr[0])-(arrIndxInPtr[*it+1]-arrIndxInPtr[*it]);
+ }
+ else
+ {
+ std::ostringstream oss; oss << "DataArrayInt::SetPartOfIndexedArrays : On pos #" << std::distance(idsOfSelectBg,it) << " value is " << *it << " not in [0," << nbOfTuples << ") !";
+ throw INTERP_KERNEL::Exception(oss.str());
+ }
+ }
+ srcArrIndexPtr=srcArrIndex->begin();
+ arrIo->alloc(nbOfTuples+1,1);
+ arro->alloc(arrIn->getNumberOfTuples()+offset,1);
+ const int *arrInPtr=arrIn->begin();
+ const int *srcArrPtr=srcArr->begin();
+ int *arrIoPtr=arrIo->getPointer(); *arrIoPtr++=0;
+ int *arroPtr=arro->getPointer();
+ for(int ii=0;ii<nbOfTuples;ii++,arrIoPtr++)
+ {
+ if(v[ii])
+ {
+ arroPtr=std::copy(arrInPtr+arrIndxInPtr[ii],arrInPtr+arrIndxInPtr[ii+1],arroPtr);
+ *arrIoPtr=arrIoPtr[-1]+(arrIndxInPtr[ii+1]-arrIndxInPtr[ii]);
+ }
+ else
+ {
+ std::size_t pos=std::distance(idsOfSelectBg,std::find(idsOfSelectBg,idsOfSelectEnd,ii));
+ arroPtr=std::copy(srcArrPtr+srcArrIndexPtr[pos],srcArrPtr+srcArrIndexPtr[pos+1],arroPtr);
+ *arrIoPtr=arrIoPtr[-1]+(srcArrIndexPtr[pos+1]-srcArrIndexPtr[pos]);
+ }
+ }
+ arrOut=arro.retn();
+ arrIndexOut=arrIo.retn();
+}
+
+
+/*!
+ * This method works on an input pair (\b arrIn, \b arrIndxIn) where \b arrIn indexes is in \b arrIndxIn.
+ * This method builds an output pair (\b arrOut,\b arrIndexOut) that is a copy from \b arrIn for all cell ids \b not \b in [ \b idsOfSelectBg , \b idsOfSelectEnd ) and for
+ * cellIds \b in [\b idsOfSelectBg, \b idsOfSelectEnd) a copy coming from the corresponding values in input pair (\b srcArr, \b srcArrIndex).
+ * This method is an generalization of DataArrayInt::SetPartOfIndexedArraysSameIdx that performs the same thing but by without building explicitly a result output arrays.
+ *
+ * \param [in] start begin of set of ids of the input extraction (included)
+ * \param [in] end end of set of ids of the input extraction (excluded)
+ * \param [in] step step of the set of ids in range mode.
+ * \param [in] arrIn arr origin array from which the extraction will be done.
+ * \param [in] arrIndxIn is the input index array allowing to walk into \b arrIn
+ * \param [in] srcArr input array that will be used as source of copy for ids in [\b idsOfSelectBg, \b idsOfSelectEnd)
+ * \param [in] srcArrIndex index array of \b srcArr
+ * \param [out] arrOut the resulting array
+ * \param [out] arrIndexOut the index array of the resulting array \b arrOut
+ *
+ * \sa DataArrayInt::SetPartOfIndexedArraysSameIdx DataArrayInt::SetPartOfIndexedArrays
+ */
+void DataArrayInt::SetPartOfIndexedArraysSlice(int start, int end, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
+ const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex,
+ DataArrayInt* &arrOut, DataArrayInt* &arrIndexOut)
+{
+ if(arrIn==0 || arrIndxIn==0 || srcArr==0 || srcArrIndex==0)
+ throw INTERP_KERNEL::Exception("DataArrayInt::SetPartOfIndexedArraysSlice : presence of null pointer in input parameter !");
+ MCAuto<DataArrayInt> arro=DataArrayInt::New();
+ MCAuto<DataArrayInt> arrIo=DataArrayInt::New();
+ int nbOfTuples=arrIndxIn->getNumberOfTuples()-1;
+ int offset=0;
+ const int *arrIndxInPtr=arrIndxIn->begin();
+ const int *srcArrIndexPtr=srcArrIndex->begin();
+ int nbOfElemsToSet=DataArray::GetNumberOfItemGivenBESRelative(start,end,step,"DataArrayInt::SetPartOfIndexedArraysSlice : ");
+ int it=start;
+ for(int i=0;i<nbOfElemsToSet;i++,srcArrIndexPtr++,it+=step)
+ {
+ if(it>=0 && it<nbOfTuples)
+ offset+=(srcArrIndexPtr[1]-srcArrIndexPtr[0])-(arrIndxInPtr[it+1]-arrIndxInPtr[it]);
+ else
+ {
+ std::ostringstream oss; oss << "DataArrayInt::SetPartOfIndexedArraysSlice : On pos #" << i << " value is " << it << " not in [0," << nbOfTuples << ") !";
+ throw INTERP_KERNEL::Exception(oss.str());
+ }
+ }
+ srcArrIndexPtr=srcArrIndex->begin();
+ arrIo->alloc(nbOfTuples+1,1);
+ arro->alloc(arrIn->getNumberOfTuples()+offset,1);
+ const int *arrInPtr=arrIn->begin();
+ const int *srcArrPtr=srcArr->begin();
+ int *arrIoPtr=arrIo->getPointer(); *arrIoPtr++=0;
+ int *arroPtr=arro->getPointer();
+ for(int ii=0;ii<nbOfTuples;ii++,arrIoPtr++)
+ {
+ int pos=DataArray::GetPosOfItemGivenBESRelativeNoThrow(ii,start,end,step);
+ if(pos<0)
+ {
+ arroPtr=std::copy(arrInPtr+arrIndxInPtr[ii],arrInPtr+arrIndxInPtr[ii+1],arroPtr);
+ *arrIoPtr=arrIoPtr[-1]+(arrIndxInPtr[ii+1]-arrIndxInPtr[ii]);
+ }
+ else
+ {
+ arroPtr=std::copy(srcArrPtr+srcArrIndexPtr[pos],srcArrPtr+srcArrIndexPtr[pos+1],arroPtr);
+ *arrIoPtr=arrIoPtr[-1]+(srcArrIndexPtr[pos+1]-srcArrIndexPtr[pos]);
+ }
+ }
+ arrOut=arro.retn();
+ arrIndexOut=arrIo.retn();
+}
+
+
+/*!
+ * This method works on an input pair (\b arrIn, \b arrIndxIn) where \b arrIn indexes is in \b arrIndxIn.
+ * This method is an specialization of MEDCouplingUMesh::SetPartOfIndexedArrays in the case of assignment do not modify the index in \b arrIndxIn.
+ *
+ * \param [in] idsOfSelectBg begin of set of ids of the input extraction (included)
+ * \param [in] idsOfSelectEnd end of set of ids of the input extraction (excluded)
+ * \param [in,out] arrInOut arr origin array from which the extraction will be done.
+ * \param [in] arrIndxIn is the input index array allowing to walk into \b arrIn
+ * \param [in] srcArr input array that will be used as source of copy for ids in [ \b idsOfSelectBg , \b idsOfSelectEnd )
+ * \param [in] srcArrIndex index array of \b srcArr
+ *
+ * \sa DataArrayInt::SetPartOfIndexedArrays
+ */
+void DataArrayInt::SetPartOfIndexedArraysSameIdx(const int *idsOfSelectBg, const int *idsOfSelectEnd, DataArrayInt *arrInOut, const DataArrayInt *arrIndxIn,
+ const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex)
+{
+ if(arrInOut==0 || arrIndxIn==0 || srcArr==0 || srcArrIndex==0)
+ throw INTERP_KERNEL::Exception("DataArrayInt::SetPartOfIndexedArraysSameIdx : presence of null pointer in input parameter !");
+ int nbOfTuples=arrIndxIn->getNumberOfTuples()-1;
+ const int *arrIndxInPtr=arrIndxIn->begin();
+ const int *srcArrIndexPtr=srcArrIndex->begin();
+ int *arrInOutPtr=arrInOut->getPointer();
+ const int *srcArrPtr=srcArr->begin();
+ for(const int *it=idsOfSelectBg;it!=idsOfSelectEnd;it++,srcArrIndexPtr++)
+ {
+ if(*it>=0 && *it<nbOfTuples)
+ {
+ if(srcArrIndexPtr[1]-srcArrIndexPtr[0]==arrIndxInPtr[*it+1]-arrIndxInPtr[*it])
+ std::copy(srcArrPtr+srcArrIndexPtr[0],srcArrPtr+srcArrIndexPtr[1],arrInOutPtr+arrIndxInPtr[*it]);
+ else
+ {
+ std::ostringstream oss; oss << "DataArrayInt::SetPartOfIndexedArraysSameIdx : On pos #" << std::distance(idsOfSelectBg,it) << " id (idsOfSelectBg[" << std::distance(idsOfSelectBg,it)<< "]) is " << *it << " arrIndxIn[id+1]-arrIndxIn[id]!=srcArrIndex[pos+1]-srcArrIndex[pos] !";
+ throw INTERP_KERNEL::Exception(oss.str());
+ }
+ }
+ else
+ {
+ std::ostringstream oss; oss << "DataArrayInt::SetPartOfIndexedArraysSameIdx : On pos #" << std::distance(idsOfSelectBg,it) << " value is " << *it << " not in [0," << nbOfTuples << ") !";
+ throw INTERP_KERNEL::Exception(oss.str());
+ }
+ }
+}
+
+/*!
+ * This method works on an input pair (\b arr, \b arrIndx) where \b arr indexes is in \b arrIndx.
+ * This method will not impact the size of inout parameter \b arrIndx but the size of \b arr will be modified in case of suppression.
+ *
+ * \param [in] idsToRemoveBg begin of set of ids to remove in \b arr (included)
+ * \param [in] idsToRemoveEnd end of set of ids to remove in \b arr (excluded)
+ * \param [in,out] arr array in which the remove operation will be done.
+ * \param [in,out] arrIndx array in the remove operation will modify
+ * \param [in] offsetForRemoval (by default 0) offset so that for each i in [0,arrIndx->getNumberOfTuples()-1) removal process will be performed in the following range [arr+arrIndx[i]+offsetForRemoval,arr+arr[i+1])
+ * \return true if \b arr and \b arrIndx have been modified, false if not.
+ */
+bool DataArrayInt::RemoveIdsFromIndexedArrays(const int *idsToRemoveBg, const int *idsToRemoveEnd, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval)
+{
+ if(!arrIndx || !arr)
+ throw INTERP_KERNEL::Exception("DataArrayInt::RemoveIdsFromIndexedArrays : some input arrays are empty !");
+ if(offsetForRemoval<0)
+ throw INTERP_KERNEL::Exception("DataArrayInt::RemoveIdsFromIndexedArrays : offsetForRemoval should be >=0 !");
+ std::set<int> s(idsToRemoveBg,idsToRemoveEnd);
+ int nbOfGrps=arrIndx->getNumberOfTuples()-1;
+ int *arrIPtr=arrIndx->getPointer();
+ *arrIPtr++=0;
+ int previousArrI=0;
+ const int *arrPtr=arr->begin();
+ std::vector<int> arrOut;//no utility to switch to DataArrayInt because copy always needed
+ for(int i=0;i<nbOfGrps;i++,arrIPtr++)
+ {
+ if(*arrIPtr-previousArrI>offsetForRemoval)
+ {
+ for(const int *work=arrPtr+previousArrI+offsetForRemoval;work!=arrPtr+*arrIPtr;work++)
+ {
+ if(s.find(*work)==s.end())
+ arrOut.push_back(*work);
+ }
+ }
+ previousArrI=*arrIPtr;
+ *arrIPtr=(int)arrOut.size();
+ }
+ if(arr->getNumberOfTuples()==arrOut.size())
+ return false;
+ arr->alloc((int)arrOut.size(),1);
+ std::copy(arrOut.begin(),arrOut.end(),arr->getPointer());
+ return true;
+}
+
+/*!
+ * This method works on an input pair (\b arrIn, \b arrIndxIn) where \b arrIn indexes is in \b arrIndxIn.
+ * This method is an specialization of MEDCouplingUMesh::SetPartOfIndexedArrays in the case of assignment do not modify the index in \b arrIndxIn.
+ *
+ * \param [in] start begin of set of ids of the input extraction (included)
+ * \param [in] end end of set of ids of the input extraction (excluded)
+ * \param [in] step step of the set of ids in range mode.
+ * \param [in,out] arrInOut arr origin array from which the extraction will be done.
+ * \param [in] arrIndxIn is the input index array allowing to walk into \b arrIn
+ * \param [in] srcArr input array that will be used as source of copy for ids in [\b idsOfSelectBg, \b idsOfSelectEnd)
+ * \param [in] srcArrIndex index array of \b srcArr
+ *
+ * \sa DataArrayInt::SetPartOfIndexedArraysSlice DataArrayInt::SetPartOfIndexedArraysSameIdx
+ */
+void DataArrayInt::SetPartOfIndexedArraysSameIdxSlice(int start, int end, int step, DataArrayInt *arrInOut, const DataArrayInt *arrIndxIn,
+ const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex)
+{
+ if(arrInOut==0 || arrIndxIn==0 || srcArr==0 || srcArrIndex==0)
+ throw INTERP_KERNEL::Exception("DataArrayInt::SetPartOfIndexedArraysSameIdxSlice : presence of null pointer in input parameter !");
+ int nbOfTuples=arrIndxIn->getNumberOfTuples()-1;
+ const int *arrIndxInPtr=arrIndxIn->begin();
+ const int *srcArrIndexPtr=srcArrIndex->begin();
+ int *arrInOutPtr=arrInOut->getPointer();
+ const int *srcArrPtr=srcArr->begin();
+ int nbOfElemsToSet=DataArray::GetNumberOfItemGivenBESRelative(start,end,step,"DataArrayInt::SetPartOfIndexedArraysSameIdxSlice : ");
+ int it=start;
+ for(int i=0;i<nbOfElemsToSet;i++,srcArrIndexPtr++,it+=step)
+ {
+ if(it>=0 && it<nbOfTuples)
+ {
+ if(srcArrIndexPtr[1]-srcArrIndexPtr[0]==arrIndxInPtr[it+1]-arrIndxInPtr[it])
+ std::copy(srcArrPtr+srcArrIndexPtr[0],srcArrPtr+srcArrIndexPtr[1],arrInOutPtr+arrIndxInPtr[it]);
+ else
+ {
+ std::ostringstream oss; oss << "DataArrayInt::SetPartOfIndexedArraysSameIdxSlice : On pos #" << i << " id (idsOfSelectBg[" << i << "]) is " << it << " arrIndxIn[id+1]-arrIndxIn[id]!=srcArrIndex[pos+1]-srcArrIndex[pos] !";
+ throw INTERP_KERNEL::Exception(oss.str());
+ }
+ }
+ else
+ {
+ std::ostringstream oss; oss << "DataArrayInt::SetPartOfIndexedArraysSameIdxSlice : On pos #" << i << " value is " << it << " not in [0," << nbOfTuples << ") !";
+ throw INTERP_KERNEL::Exception(oss.str());
+ }
+ }
+}
+
+
/*!
* Returns a C array which is a renumbering map in "Old to New" mode for the input array.
* This map, if applied to \a start array, would make it sorted. For example, if
{
return this->buildDA(nbOfTuples,nbOfCompo);
}
+
+DataArrayInt64 *DataArrayInt64::deepCopy() const
+{
+ return new DataArrayInt64(*this);
+}
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
public:
MEDCOUPLING_EXPORT static void CPPDeallocator(void *pt, void *param);
MEDCOUPLING_EXPORT static void CDeallocator(void *pt, void *param);
+ MEDCOUPLING_EXPORT static void COffsetDeallocator(void *pt, void *param);
private:
static void DestroyPointer(T *pt, Deallocator dealloc, void *param);
static Deallocator BuildFromType(DeallocType type);
MEDCOUPLING_EXPORT void setIJSilent(int tupleId, int compoId, T newVal) { _mem[tupleId*_info_on_compo.size()+compoId]=newVal; }
MEDCOUPLING_EXPORT T *getPointer() { return _mem.getPointer(); declareAsNew(); }
MEDCOUPLING_EXPORT void pack() const;
- MEDCOUPLING_EXPORT bool isAllocated() const;
+ MEDCOUPLING_EXPORT bool isAllocated() const override;
MEDCOUPLING_EXPORT void checkAllocated() const;
MEDCOUPLING_EXPORT void desallocate();
MEDCOUPLING_EXPORT void reserve(std::size_t nbOfElems);
MEDCOUPLING_EXPORT MemArray<T>& accessToMemArray() { return _mem; }
MEDCOUPLING_EXPORT const MemArray<T>& accessToMemArray() const { return _mem; }
protected:
- typename Traits<T>::ArrayType *mySelectByTupleId(const int *new2OldBg, const int *new2OldEnd) const;
- typename Traits<T>::ArrayType *mySelectByTupleId(const DataArrayInt32& di) const;
+ typename Traits<T>::ArrayType *mySelectByTupleId(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const;
+ typename Traits<T>::ArrayType *mySelectByTupleId(const DataArrayIdType& di) const;
typename Traits<T>::ArrayType *mySelectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const;
typename Traits<T>::ArrayType *myKeepSelectedComponents(const std::vector<int>& compoIds) const;
typename Traits<T>::ArrayType *mySelectByTupleIdSafeSlice(int bg, int end2, int step) const;
MEDCOUPLING_EXPORT void reprWithoutNameStream(std::ostream& stream) const;
MEDCOUPLING_EXPORT void reprZipWithoutNameStream(std::ostream& stream) const;
MEDCOUPLING_EXPORT void reprNotTooLongWithoutNameStream(std::ostream& stream) const;
+ MEDCOUPLING_EXPORT std::string repr() const;
+ MEDCOUPLING_EXPORT std::string reprZip() const;
MEDCOUPLING_EXPORT std::string reprNotTooLong() const;
template<class U>
MCAuto< typename Traits<U>::ArrayType > convertToOtherTypeOfArr() const;
MEDCOUPLING_EXPORT DataArrayFloat *buildNewEmptyInstance() const { return DataArrayFloat::New(); }
MEDCOUPLING_EXPORT DataArrayFloat *selectByTupleRanges(const std::vector<std::pair<int,int> >& ranges) const { return DataArrayTemplateFP<float>::mySelectByTupleRanges(ranges); }
MEDCOUPLING_EXPORT DataArrayFloat *keepSelectedComponents(const std::vector<int>& compoIds) const { return DataArrayTemplateFP<float>::myKeepSelectedComponents(compoIds); }
- MEDCOUPLING_EXPORT DataArrayFloat *selectByTupleId(const int *new2OldBg, const int *new2OldEnd) const { return DataArrayTemplateFP<float>::mySelectByTupleId(new2OldBg,new2OldEnd); }
+ MEDCOUPLING_EXPORT DataArrayFloat *selectByTupleId(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const { return this->mySelectByTupleId(new2OldBg,new2OldEnd); }
MEDCOUPLING_EXPORT DataArrayFloat *selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const { return DataArrayTemplateFP<float>::mySelectByTupleIdSafe(new2OldBg,new2OldEnd); }
MEDCOUPLING_EXPORT DataArrayFloat *selectByTupleIdSafeSlice(int bg, int end2, int step) const { return DataArrayTemplateFP<float>::mySelectByTupleIdSafeSlice(bg,end2,step); }
MEDCOUPLING_EXPORT void reprCppStream(const std::string& varName, std::ostream& stream) const;
MEDCOUPLING_EXPORT DataArrayDouble *buildNewEmptyInstance() const { return DataArrayDouble::New(); }
MEDCOUPLING_EXPORT void checkMonotonic(bool increasing, double eps) const;
MEDCOUPLING_EXPORT bool isMonotonic(bool increasing, double eps) const;
- MEDCOUPLING_EXPORT std::string repr() const;
- MEDCOUPLING_EXPORT std::string reprZip() const;
MEDCOUPLING_EXPORT void writeVTK(std::ostream& ofs, int indent, const std::string& nameInFile, DataArrayByte *byteArr) const;
MEDCOUPLING_EXPORT void reprCppStream(const std::string& varName, std::ostream& stream) const;
MEDCOUPLING_EXPORT void reprQuickOverview(std::ostream& stream) const;
MEDCOUPLING_EXPORT bool isEqual(const DataArrayDouble& other, double prec) const;
MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const DataArrayDouble& other, double prec, std::string& reason) const;
MEDCOUPLING_EXPORT bool isEqualWithoutConsideringStr(const DataArrayDouble& other, double prec) const;
- MEDCOUPLING_EXPORT DataArrayDouble *selectByTupleId(const int *new2OldBg, const int *new2OldEnd) const { return DataArrayTemplateFP<double>::mySelectByTupleId(new2OldBg,new2OldEnd); }
- MEDCOUPLING_EXPORT DataArrayDouble *selectByTupleId(const DataArrayInt32& di) const { return DataArrayTemplateFP<double>::mySelectByTupleId(di); }
+ MEDCOUPLING_EXPORT DataArrayDouble *selectByTupleId(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const { return this->mySelectByTupleId(new2OldBg,new2OldEnd); }
+ MEDCOUPLING_EXPORT DataArrayDouble *selectByTupleId(const DataArrayIdType& di) const { return this->mySelectByTupleId(di); }
MEDCOUPLING_EXPORT DataArrayDouble *selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const { return DataArrayTemplateFP<double>::mySelectByTupleIdSafe(new2OldBg,new2OldEnd); }
MEDCOUPLING_EXPORT DataArrayDouble *keepSelectedComponents(const std::vector<int>& compoIds) const { return DataArrayTemplateFP<double>::myKeepSelectedComponents(compoIds); }
MEDCOUPLING_EXPORT DataArrayDouble *selectByTupleIdSafeSlice(int bg, int end2, int step) const { return DataArrayTemplateFP<double>::mySelectByTupleIdSafeSlice(bg,end2,step); }
class DataArrayDiscrete : public DataArrayTemplateClassic<T>
{
public:
+ MEDCOUPLING_EXPORT static typename Traits<T>::ArrayType *New();
MEDCOUPLING_EXPORT bool isEqual(const DataArrayDiscrete<T>& other) const;
MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const DataArrayDiscrete<T>& other, std::string& reason) const;
MEDCOUPLING_EXPORT bool isEqualWithoutConsideringStr(const DataArrayDiscrete<T>& other) const;
MEDCOUPLING_EXPORT bool isMonotonic(bool increasing) const;
MEDCOUPLING_EXPORT void checkStrictlyMonotonic(bool increasing) const;
MEDCOUPLING_EXPORT bool isStrictlyMonotonic(bool increasing) const;
+ MEDCOUPLING_EXPORT int getHashCode() const;
+ MEDCOUPLING_EXPORT void reprCppStream(const std::string& varName, std::ostream& stream) const;
+ MEDCOUPLING_EXPORT void reprQuickOverview(std::ostream& stream) const;
+ MEDCOUPLING_EXPORT void reprQuickOverviewData(std::ostream& stream, std::size_t maxNbOfByteInRepr) const;
+ MEDCOUPLING_EXPORT void writeVTK(std::ostream& ofs, int indent, const std::string& type, const std::string& nameInFile, DataArrayByte *byteArr) const;
+ MEDCOUPLING_EXPORT void transformWithIndArr(const T *indArrBg, const T *indArrEnd);
+ MEDCOUPLING_EXPORT void transformWithIndArr(const MapKeyVal<T>& m);
+ MEDCOUPLING_EXPORT DataArrayIdType *findIdsEqual(T val) const;
protected:
template<class ALG>
void switchOnTupleAlg(T val, std::vector<bool>& vec, ALG algo) const;
class DataArrayInt32 : public DataArrayDiscreteSigned<Int32>
{
+ friend class DataArrayDiscrete<Int32>;
public:
- MEDCOUPLING_EXPORT static DataArrayInt32 *New();
MEDCOUPLING_EXPORT int intValue() const;
- MEDCOUPLING_EXPORT int getHashCode() const;
MEDCOUPLING_EXPORT DataArrayInt32 *deepCopy() const;//ok
MEDCOUPLING_EXPORT DataArrayInt32 *buildNewEmptyInstance() const { return DataArrayInt32::New(); }//ok
- MEDCOUPLING_EXPORT std::string repr() const;
- MEDCOUPLING_EXPORT std::string reprZip() const;
- MEDCOUPLING_EXPORT void writeVTK(std::ostream& ofs, int indent, const std::string& type, const std::string& nameInFile, DataArrayByte *byteArr) const;
- MEDCOUPLING_EXPORT void reprCppStream(const std::string& varName, std::ostream& stream) const;
- MEDCOUPLING_EXPORT void reprQuickOverview(std::ostream& stream) const;
- MEDCOUPLING_EXPORT void reprQuickOverviewData(std::ostream& stream, std::size_t maxNbOfByteInRepr) const;
- MEDCOUPLING_EXPORT void transformWithIndArr(const int *indArrBg, const int *indArrEnd);
- MEDCOUPLING_EXPORT void transformWithIndArr(const MapKeyVal<int>& m);
- MEDCOUPLING_EXPORT DataArrayInt32 *transformWithIndArrR(const int *indArrBg, const int *indArrEnd) const;
+ MEDCOUPLING_EXPORT DataArrayInt32 *transformWithIndArrR(const int *indArr2Bg, const int *indArrEnd) const;
MEDCOUPLING_EXPORT void splitByValueRange(const int *arrBg, const int *arrEnd,
DataArrayInt32 *& castArr, DataArrayInt32 *& rankInsideCast, DataArrayInt32 *& castsPresent) const;
MEDCOUPLING_EXPORT bool isRange(int& strt, int& sttoopp, int& stteepp) const;
MEDCOUPLING_EXPORT MCAuto< MapKeyVal<int> > invertArrayN2O2O2NOptimized() const;
MEDCOUPLING_EXPORT MCAuto< MapKeyVal<int> > giveN2OOptimized() const;
MEDCOUPLING_EXPORT DataArrayInt32 *invertArrayO2N2N2OBis(int newNbOfElem) const;
- MEDCOUPLING_EXPORT DataArrayInt32 *selectByTupleId(const int *new2OldBg, const int *new2OldEnd) const { return DataArrayTemplate<int>::mySelectByTupleId(new2OldBg,new2OldEnd); }
- MEDCOUPLING_EXPORT DataArrayInt32 *selectByTupleId(const DataArrayInt32& di) const { return DataArrayTemplate<int>::mySelectByTupleId(di); }
+ MEDCOUPLING_EXPORT DataArrayInt32 *selectByTupleId(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const { return this->mySelectByTupleId(new2OldBg,new2OldEnd); }
+ MEDCOUPLING_EXPORT DataArrayInt32 *selectByTupleId(const DataArrayIdType& di) const { return this->mySelectByTupleId(di); }
MEDCOUPLING_EXPORT DataArrayInt32 *selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const { return DataArrayTemplate<int>::mySelectByTupleIdSafe(new2OldBg,new2OldEnd); }
MEDCOUPLING_EXPORT DataArrayInt32 *keepSelectedComponents(const std::vector<int>& compoIds) const { return DataArrayTemplate<int>::myKeepSelectedComponents(compoIds); }
MEDCOUPLING_EXPORT DataArrayInt32 *selectByTupleIdSafeSlice(int bg, int end2, int step) const { return DataArrayTemplate<int>::mySelectByTupleIdSafeSlice(bg,end2,step); }
MEDCOUPLING_EXPORT bool hasUniqueValues() const;
MEDCOUPLING_EXPORT void setSelectedComponents(const DataArrayInt32 *a, const std::vector<int>& compoIds);
MEDCOUPLING_EXPORT DataArrayInt32Iterator *iterator();
- MEDCOUPLING_EXPORT DataArrayInt32 *findIdsEqual(int val) const;
MEDCOUPLING_EXPORT DataArrayInt32 *findIdsNotEqual(int val) const;
MEDCOUPLING_EXPORT DataArrayInt32 *findIdsEqualList(const int *valsBg, const int *valsEnd) const;
MEDCOUPLING_EXPORT DataArrayInt32 *findIdsNotEqualList(const int *valsBg, const int *valsEnd) const;
MEDCOUPLING_EXPORT MemArray<int>& accessToMemArray() { return _mem; }
MEDCOUPLING_EXPORT const MemArray<int>& accessToMemArray() const { return _mem; }
public:
+ MEDCOUPLING_EXPORT static void ExtractFromIndexedArrays(const int *idsOfSelectBg, const int *idsOfSelectEnd, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
+ DataArrayInt* &arrOut, DataArrayInt* &arrIndexOut);
+ MEDCOUPLING_EXPORT static void ExtractFromIndexedArraysSlice(int idsOfSelectStart, int idsOfSelectStop, int idsOfSelectStep, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
+ DataArrayInt* &arrOut, DataArrayInt* &arrIndexOut);
+ MEDCOUPLING_EXPORT static void SetPartOfIndexedArrays(const int *idsOfSelectBg, const int *idsOfSelectEnd, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
+ const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex,
+ DataArrayInt* &arrOut, DataArrayInt* &arrIndexOut);
+ MEDCOUPLING_EXPORT static void SetPartOfIndexedArraysSlice(int start, int end, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
+ const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex,
+ DataArrayInt* &arrOut, DataArrayInt* &arrIndexOut);
+ MEDCOUPLING_EXPORT static void SetPartOfIndexedArraysSameIdx(const int *idsOfSelectBg, const int *idsOfSelectEnd, DataArrayInt *arrInOut, const DataArrayInt *arrIndxIn,
+ const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex);
+ MEDCOUPLING_EXPORT static void SetPartOfIndexedArraysSameIdxSlice(int start, int end, int step, DataArrayInt *arrInOut, const DataArrayInt *arrIndxIn,
+ const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex);
+ MEDCOUPLING_EXPORT static bool RemoveIdsFromIndexedArrays(const int *idsToRemoveBg, const int *idsToRemoveEnd, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0);
MEDCOUPLING_EXPORT static int *CheckAndPreparePermutation(const int *start, const int *end);
MEDCOUPLING_EXPORT static DataArrayInt32 *Range(int begin, int end, int step);
public:
class DataArrayInt64 : public DataArrayDiscrete<Int64>
{
+ friend class DataArrayDiscrete<Int64>;
+ public:
+ MEDCOUPLING_EXPORT DataArrayInt64 *deepCopy() const;
+ MEDCOUPLING_EXPORT DataArrayInt64 *buildNewEmptyInstance() const { return DataArrayInt64::New(); }//ok
+ MEDCOUPLING_EXPORT DataArrayInt64 *selectByTupleId(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const { return this->mySelectByTupleId(new2OldBg,new2OldEnd); }
+ MEDCOUPLING_EXPORT DataArrayInt64 *selectByTupleId(const DataArrayIdType& di) const { return this->mySelectByTupleId(di); }
+ MEDCOUPLING_EXPORT DataArrayInt64 *selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const { return DataArrayTemplate<Int64>::mySelectByTupleIdSafe(new2OldBg,new2OldEnd); }
+ MEDCOUPLING_EXPORT DataArrayInt64 *keepSelectedComponents(const std::vector<int>& compoIds) const { return DataArrayTemplate<Int64>::myKeepSelectedComponents(compoIds); }
+ MEDCOUPLING_EXPORT DataArrayInt64 *selectByTupleIdSafeSlice(int bg, int end2, int step) const { return DataArrayTemplate<Int64>::mySelectByTupleIdSafeSlice(bg,end2,step); }
+ MEDCOUPLING_EXPORT DataArrayInt64 *selectByTupleRanges(const std::vector<std::pair<int,int> >& ranges) const { return DataArrayTemplate<Int64>::mySelectByTupleRanges(ranges); }
+ private:
+ ~DataArrayInt64() { }
+ DataArrayInt64() { }
};
template<class T>
MEDCOUPLING_EXPORT std::string repr() const;
MEDCOUPLING_EXPORT std::string reprZip() const;
MEDCOUPLING_EXPORT DataArrayInt *convertToIntArr() const;
- MEDCOUPLING_EXPORT DataArrayChar *selectByTupleId(const int *new2OldBg, const int *new2OldEnd) const { return DataArrayTemplate<char>::mySelectByTupleId(new2OldBg,new2OldEnd); }
- MEDCOUPLING_EXPORT DataArrayChar *selectByTupleId(const DataArrayInt& di) const { return DataArrayTemplate<char>::mySelectByTupleId(di); }
+ MEDCOUPLING_EXPORT DataArrayChar *selectByTupleId(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const { return this->mySelectByTupleId(new2OldBg,new2OldEnd); }
+ MEDCOUPLING_EXPORT DataArrayChar *selectByTupleId(const DataArrayIdType& di) const { return this->mySelectByTupleId(di); }
MEDCOUPLING_EXPORT DataArrayChar *selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const { return DataArrayTemplate<char>::mySelectByTupleIdSafe(new2OldBg,new2OldEnd); }
MEDCOUPLING_EXPORT DataArrayChar *keepSelectedComponents(const std::vector<int>& compoIds) const { return DataArrayTemplate<char>::myKeepSelectedComponents(compoIds); }
MEDCOUPLING_EXPORT DataArrayChar *selectByTupleIdSafeSlice(int bg, int end2, int step) const { return DataArrayTemplate<char>::mySelectByTupleIdSafeSlice(bg,end2,step); }
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
_nb_of_elem_alloc=other._nb_of_elem;
T *pointer=(T*)malloc(_nb_of_elem_alloc*sizeof(T));
std::copy(other._pointer.getConstPointer(),other._pointer.getConstPointer()+other._nb_of_elem,pointer);
- useArray(pointer,true,C_DEALLOC,other._nb_of_elem);
+ useArray(pointer,true,DeallocType::C_DEALLOC,other._nb_of_elem);
}
}
free(pt);
}
+ template<class T>
+ void MemArray<T>::COffsetDeallocator(void *pt, void *param)
+ {
+ int64_t *offset(reinterpret_cast<int64_t *>(param));
+ char *ptcast(reinterpret_cast<char *>(pt));
+ free(ptcast+*offset);
+ }
+
template<class T>
typename MemArray<T>::Deallocator MemArray<T>::BuildFromType(DeallocType type)
{
switch(type)
{
- case CPP_DEALLOC:
+ case DeallocType::CPP_DEALLOC:
return CPPDeallocator;
- case C_DEALLOC:
+ case DeallocType::C_DEALLOC:
return CDeallocator;
+ case DeallocType::C_DEALLOC_WITH_OFFSET:
+ return COffsetDeallocator;
default:
throw INTERP_KERNEL::Exception("Invalid deallocation requested ! Unrecognized enum DeallocType !");
}
* is to delete using decrRef() as it is no more needed.
*/
template<class T>
- typename Traits<T>::ArrayType *DataArrayTemplate<T>::mySelectByTupleId(const int *new2OldBg, const int *new2OldEnd) const
+ typename Traits<T>::ArrayType *DataArrayTemplate<T>::mySelectByTupleId(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const
{
checkAllocated();
MCAuto<DataArray> ret0(buildNewEmptyInstance());
MCAuto< typename Traits<T>::ArrayType > ret(DynamicCastSafe<DataArray,typename Traits<T>::ArrayType>(ret0));
- int nbComp(getNumberOfComponents());
- ret->alloc((int)std::distance(new2OldBg,new2OldEnd),nbComp);
+ std::size_t nbComp(getNumberOfComponents());
+ ret->alloc(std::distance(new2OldBg,new2OldEnd),nbComp);
ret->copyStringInfoFrom(*this);
T *pt(ret->getPointer());
const T *srcPt(getConstPointer());
- int i(0);
+ std::size_t i(0);
for(const int *w=new2OldBg;w!=new2OldEnd;w++,i++)
std::copy(srcPt+(*w)*nbComp,srcPt+((*w)+1)*nbComp,pt+i*nbComp);
ret->copyStringInfoFrom(*this);
}
template<class T>
- typename Traits<T>::ArrayType *DataArrayTemplate<T>::mySelectByTupleId(const DataArrayInt& di) const
+ typename Traits<T>::ArrayType *DataArrayTemplate<T>::mySelectByTupleId(const DataArrayIdType& di) const
{
- return DataArrayTemplate<T>::mySelectByTupleId(di.begin(),di.end());
+ return this->mySelectByTupleId(di.begin(),di.end());
}
template<class T>
throw INTERP_KERNEL::Exception("DataArrayDouble::fromNoInterlace : Not defined array !");
T *tab(this->_mem.fromNoInterlace(this->getNumberOfComponents()));
MCAuto<typename Traits<T>::ArrayType> ret(Traits<T>::ArrayType::New());
- ret->useArray(tab,true,C_DEALLOC,this->getNumberOfTuples(),this->getNumberOfComponents());
+ ret->useArray(tab,true,DeallocType::C_DEALLOC,this->getNumberOfTuples(),this->getNumberOfComponents());
return ret.retn();
}
throw INTERP_KERNEL::Exception("DataArrayDouble::toNoInterlace : Not defined array !");
T *tab(this->_mem.toNoInterlace(this->getNumberOfComponents()));
MCAuto<typename Traits<T>::ArrayType> ret(Traits<T>::ArrayType::New());
- ret->useArray(tab,true,C_DEALLOC,this->getNumberOfTuples(),this->getNumberOfComponents());
+ ret->useArray(tab,true,DeallocType::C_DEALLOC,this->getNumberOfTuples(),this->getNumberOfComponents());
return ret.retn();
}
w=std::copy(inp1,inp1+nbOfComp1,w);
w=std::copy(inp2,inp2+nbOfComp2,w);
}
- this->useArray(newArr,true,C_DEALLOC,nbOfTuples,nbOfComp1+nbOfComp2);
+ this->useArray(newArr,true,DeallocType::C_DEALLOC,nbOfTuples,nbOfComp1+nbOfComp2);
std::vector<int> compIds(nbOfComp2);
for(int i=0;i<nbOfComp2;i++)
compIds[i]=nbOfComp1+i;
return ret.str();
}
+ /*!
+ * Returns a textual and human readable representation of \a this instance of
+ * DataArrayInt. This text is shown when a DataArrayInt is printed in Python.
+ * \return std::string - text describing \a this DataArrayInt.
+ *
+ * \sa reprNotTooLong, reprZip
+ */
+ template<class T>
+ std::string DataArrayTemplateClassic<T>::repr() const
+ {
+ std::ostringstream ret;
+ DataArrayTemplateClassic<T>::reprStream(ret);
+ return ret.str();
+ }
+
+ template<class T>
+ std::string DataArrayTemplateClassic<T>::reprZip() const
+ {
+ std::ostringstream ret;
+ DataArrayTemplateClassic<T>::reprZipStream(ret);
+ return ret.str();
+ }
+
/////////////////////////////////
/*!
std::string tmp;
return isEqualIfNotWhy(other,tmp);
}
-
+
+ /*!
+ * Returns a new instance of DataArrayInt. The caller is to delete this array
+ * using decrRef() as it is no more needed.
+ */
+ template<class T>
+ typename Traits<T>::ArrayType *DataArrayDiscrete<T>::New()
+ {
+ return new typename Traits<T>::ArrayType;
+ }
+
/*!
* Checks if values of \a this and another DataArrayInt are equal. For more info see
* \ref MEDCouplingArrayBasicsCompare.
template<class T>
bool DataArrayDiscrete<T>::isEqualWithoutConsideringStrAndOrder(const typename Traits<T>::ArrayType& other) const
{
- MCAuto<DataArrayInt> a(static_cast<const typename Traits<T>::ArrayType *>(this)->deepCopy()),b(other.deepCopy());
+ MCAuto<typename Traits<T>::ArrayType> a((static_cast<const typename Traits<T>::ArrayType *>(this))->deepCopy());
+ MCAuto<typename Traits<T>::ArrayType> b((static_cast<const typename Traits<T>::ArrayType *>(&other))->deepCopy());
a->sort();
b->sort();
return a->isEqualWithoutConsideringStr(*b);
const T *thisPt(this->begin()),*pt(partOfThis.begin());
MCAuto<DataArrayIdType> ret(DataArrayIdType::New());
ret->alloc(nbTuples,1);
- T *retPt(ret->getPointer());
+ mcIdType *retPt(ret->getPointer());
std::map<int,mcIdType> m;
for(std::size_t i=0;i<thisNbTuples;i++,thisPt++)
m[*thisPt]=(mcIdType)i;
}
}
+ /*!
+ * Returns an integer value characterizing \a this array, which is useful for a quick
+ * comparison of many instances of DataArrayInt.
+ * \return int - the hash value.
+ * \throw If \a this is not allocated.
+ */
+ template<class T>
+ int DataArrayDiscrete<T>::getHashCode() const
+ {
+ this->checkAllocated();
+ std::size_t nbOfElems(this->getNbOfElems());
+ int ret=nbOfElems*65536;
+ int delta=3;
+ if(nbOfElems>48)
+ delta=nbOfElems/8;
+ T ret0(0);
+ const T *pt(this->begin());
+ for(std::size_t i=0;i<nbOfElems;i+=delta)
+ ret0+=pt[i] & 0x1FFF;
+ return ret+ret0;
+ }
+
+ template<class T>
+ void DataArrayDiscrete<T>::reprCppStream(const std::string& varName, std::ostream& stream) const
+ {
+ std::size_t nbTuples(this->getNumberOfTuples()),nbComp(this->getNumberOfComponents());
+ const T *data(this->getConstPointer());
+ stream << Traits<T>::ArrayTypeName << " *" << varName << "=" << Traits<T>::ArrayTypeName << "::New();" << std::endl;
+ if(nbTuples*nbComp>=1)
+ {
+ stream << "const int " << varName << "Data[" << nbTuples*nbComp << "]={";
+ std::copy(data,data+nbTuples*nbComp-1,std::ostream_iterator<int>(stream,","));
+ stream << data[nbTuples*nbComp-1] << "};" << std::endl;
+ stream << varName << "->useArray(" << varName << "Data,false,CPP_DEALLOC," << nbTuples << "," << nbComp << ");" << std::endl;
+ }
+ else
+ stream << varName << "->alloc(" << nbTuples << "," << nbComp << ");" << std::endl;
+ stream << varName << "->setName(\"" << this->getName() << "\");" << std::endl;
+ }
+
+ /*!
+ * Method that gives a quick overvien of \a this for python.
+ */
+ template<class T>
+ void DataArrayDiscrete<T>::reprQuickOverview(std::ostream& stream) const
+ {
+ static const std::size_t MAX_NB_OF_BYTE_IN_REPR=300;
+ stream << Traits<T>::ArrayTypeName << " C++ instance at " << this << ". ";
+ if(this->isAllocated())
+ {
+ std::size_t nbOfCompo(this->getNumberOfComponents());
+ if(nbOfCompo>=1)
+ {
+ std::size_t nbOfTuples(this->getNumberOfTuples());
+ stream << "Number of tuples : " << nbOfTuples << ". Number of components : " << nbOfCompo << "." << std::endl;
+ reprQuickOverviewData(stream,MAX_NB_OF_BYTE_IN_REPR);
+ }
+ else
+ stream << "Number of components : 0.";
+ }
+ else
+ stream << "*** No data allocated ****";
+ }
+
+ template<class T>
+ void DataArrayDiscrete<T>::reprQuickOverviewData(std::ostream& stream, std::size_t maxNbOfByteInRepr) const
+ {
+ const T *data(this->begin());
+ std::size_t nbOfTuples(this->getNumberOfTuples()),nbOfCompo(this->getNumberOfComponents());
+ std::ostringstream oss2; oss2 << "[";
+ std::string oss2Str(oss2.str());
+ bool isFinished=true;
+ for(int i=0;i<nbOfTuples && isFinished;i++)
+ {
+ if(nbOfCompo>1)
+ {
+ oss2 << "(";
+ for(int j=0;j<nbOfCompo;j++,data++)
+ {
+ oss2 << *data;
+ if(j!=nbOfCompo-1) oss2 << ", ";
+ }
+ oss2 << ")";
+ }
+ else
+ oss2 << *data++;
+ if(i!=nbOfTuples-1) oss2 << ", ";
+ std::string oss3Str(oss2.str());
+ if(oss3Str.length()<maxNbOfByteInRepr)
+ oss2Str=oss3Str;
+ else
+ isFinished=false;
+ }
+ stream << oss2Str;
+ if(!isFinished)
+ stream << "... ";
+ stream << "]";
+ }
+
+ template<class T>
+ void DataArrayDiscrete<T>::writeVTK(std::ostream& ofs, int indent, const std::string& type, const std::string& nameInFile, DataArrayByte *byteArr) const
+ {
+ static const char SPACE[4]={' ',' ',' ',' '};
+ this->checkAllocated();
+ std::string idt(indent,' ');
+ ofs << idt << "<DataArray type=\"" << type << "\" Name=\"" << nameInFile << "\" NumberOfComponents=\"" << this->getNumberOfComponents() << "\"";
+ if(byteArr)
+ {
+ ofs << " format=\"appended\" offset=\"" << byteArr->getNumberOfTuples() << "\">";
+ if(std::string(type)==Traits<T>::VTKReprStr)
+ {
+ const char *data(reinterpret_cast<const char *>(this->begin()));
+ std::size_t sz(this->getNbOfElems()*sizeof(T));
+ byteArr->insertAtTheEnd(data,data+sz);
+ byteArr->insertAtTheEnd(SPACE,SPACE+4);
+ }
+ else if(std::string(type)=="Int8")
+ {
+ INTERP_KERNEL::AutoPtr<char> tmp(new char[this->getNbOfElems()]);
+ std::copy(this->begin(),this->end(),(char *)tmp);
+ byteArr->insertAtTheEnd((char *)tmp,(char *)tmp+this->getNbOfElems());
+ byteArr->insertAtTheEnd(SPACE,SPACE+4);
+ }
+ else if(std::string(type)=="UInt8")
+ {
+ INTERP_KERNEL::AutoPtr<unsigned char> tmp(new unsigned char[this->getNbOfElems()]);
+ std::copy(this->begin(),this->end(),(unsigned char *)tmp);
+ byteArr->insertAtTheEnd((unsigned char *)tmp,(unsigned char *)tmp+this->getNbOfElems());
+ byteArr->insertAtTheEnd(SPACE,SPACE+4);
+ }
+ else
+ {
+ std::ostringstream oss;
+ oss << Traits<T>::ArrayTypeName << "::writeVTK : Only " << Traits<T>::VTKReprStr << ", Int8 and UInt8 supported !";
+ throw INTERP_KERNEL::Exception(oss.str());
+ }
+ }
+ else
+ {
+ ofs << " RangeMin=\"" << this->getMinValueInArray() << "\" RangeMax=\"" << this->getMaxValueInArray() << "\" format=\"ascii\">\n" << idt;
+ std::copy(this->begin(),this->end(),std::ostream_iterator<int>(ofs," "));
+ }
+ ofs << std::endl << idt << "</DataArray>\n";
+ }
+
+ /*!
+ * Modifies in place \a this one-dimensional array so that each value \a v = \a indArrBg[ \a v ],
+ * i.e. a current value is used as in index to get a new value from \a indArrBg.
+ * \param [in] indArrBg - pointer to the first element of array of new values to assign
+ * to \a this array.
+ * \param [in] indArrEnd - specifies the end of the array \a indArrBg, so that
+ * the last value of \a indArrBg is \a indArrEnd[ -1 ].
+ * \throw If \a this->getNumberOfComponents() != 1
+ * \throw If any value of \a this can't be used as a valid index for
+ * [\a indArrBg, \a indArrEnd).
+ *
+ * \sa changeValue, findIdForEach
+ */
+ template<class T>
+ void DataArrayDiscrete<T>::transformWithIndArr(const T *indArrBg, const T *indArrEnd)
+ {
+ this->checkAllocated();
+ if(this->getNumberOfComponents()!=1)
+ throw INTERP_KERNEL::Exception("Call transformWithIndArr method on DataArrayInt with only one component, you can call 'rearrange' method before !");
+ std::size_t nbElemsIn(std::distance(indArrBg,indArrEnd)),nbOfTuples(this->getNumberOfTuples());
+ T *pt(this->getPointer());
+ for(std::size_t i=0;i<nbOfTuples;i++,pt++)
+ {
+ if(*pt>=0 && *pt<nbElemsIn)
+ *pt=indArrBg[*pt];
+ else
+ {
+ std::ostringstream oss; oss << "DataArrayInt::transformWithIndArr : error on tuple #" << i << " of this value is " << *pt << ", should be in [0," << nbElemsIn << ") !";
+ throw INTERP_KERNEL::Exception(oss.str());
+ }
+ }
+ this->declareAsNew();
+ }
+
+ template<class T>
+ void DataArrayDiscrete<T>::transformWithIndArr(const MapKeyVal<T>& m)
+ {
+ this->checkAllocated();
+ if(this->getNumberOfComponents()!=1)
+ throw INTERP_KERNEL::Exception("Call transformWithIndArr method on DataArrayInt with only one component, you can call 'rearrange' method before !");
+ const typename std::map<T,T>& dat(m.data());
+ std::size_t nbOfTuples(this->getNumberOfTuples());
+ T *pt(this->getPointer());
+ for(std::size_t i=0;i<nbOfTuples;i++,pt++)
+ {
+ typename std::map<T,T>::const_iterator it(dat.find(*pt));
+ if(it!=dat.end())
+ *pt=(*it).second;
+ else
+ {
+ std::ostringstream oss; oss << "DataArrayInt::transformWithIndArr : error on tuple #" << i << " of this value is " << *pt << " not in map !";
+ throw INTERP_KERNEL::Exception(oss.str());
+ }
+ }
+ this->declareAsNew();
+ }
+
+ /*!
+ * Creates a new DataArrayInt containing IDs (indices) of tuples holding value equal to a
+ * given one. The ids are sorted in the ascending order.
+ * \param [in] val - the value to find within \a this.
+ * \return DataArrayInt * - a new instance of DataArrayInt. The caller is to delete this
+ * array using decrRef() as it is no more needed.
+ * \throw If \a this is not allocated.
+ * \throw If \a this->getNumberOfComponents() != 1.
+ * \sa DataArrayInt::findIdsEqualTuple
+ */
+ template<class T>
+ DataArrayIdType *DataArrayDiscrete<T>::findIdsEqual(T val) const
+ {
+ this->checkAllocated();
+ if(this->getNumberOfComponents()!=1)
+ throw INTERP_KERNEL::Exception("DataArrayInt::findIdsEqual : the array must have only one component, you can call 'rearrange' method before !");
+ const T *cptr(this->getConstPointer());
+ MCAuto<DataArrayIdType> ret(DataArrayIdType::New()); ret->alloc(0,1);
+ std::size_t nbOfTuples(this->getNumberOfTuples());
+ for(std::size_t i=0;i<nbOfTuples;i++,cptr++)
+ if(*cptr==val)
+ ret->pushBackSilent(ToIdType(i));
+ return ret.retn();
+ }
+
////////////////////////////////////
/*!
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
w=std::copy(inp1,inp1+nbOfComp1,w);
w=std::copy(inp2,inp2+nbOfComp2,w);
}
- useArray(newArr,true,C_DEALLOC,nbOfTuples,nbOfComp1+nbOfComp2);
+ useArray(newArr,true,DeallocType::C_DEALLOC,nbOfTuples,nbOfComp1+nbOfComp2);
std::vector<int> compIds(nbOfComp2);
for(int i=0;i<nbOfComp2;i++)
compIds[i]=nbOfComp1+i;
-// Copyright (C) 2007-2017 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
DataArrayPartDefinition *add2(const SlicePartDefinition *other) const;
virtual ~DataArrayPartDefinition();
private:
- MCAuto<DataArrayInt> _arr;
+ MCAuto<DataArrayIdType> _arr;
};
class SlicePartDefinition : public PartDefinition
PartDefinition *add2(const SlicePartDefinition *other) const;
virtual ~SlicePartDefinition();
private:
- int _start;
- int _stop;
- int _step;
+ mcIdType _start;
+ mcIdType _stop;
+ mcIdType _step;
};
}
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
throw INTERP_KERNEL::Exception("MEDCouplingPointSet::getNodeIdsNearPoint : no coordiantes set !");
int spaceDim=getSpaceDimension();
MCAuto<DataArrayDouble> points=DataArrayDouble::New();
- points->useArray(pos,false,CPP_DEALLOC,nbOfPoints,spaceDim);
+ points->useArray(pos,false,DeallocType::CPP_DEALLOC,nbOfPoints,spaceDim);
_coords->computeTupleIdsNearTuples(points,eps,c,cI);
}
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include "MEDCouplingRefCountObject.hxx"
#include "MEDCoupling_version.h"
+#include "MCType.hxx"
#include "InterpKernelException.hxx"
return 8*sizeof(std::size_t);
}
+std::size_t MEDCoupling::MEDCouplingSizeOfIDs()
+{
+ return 8*sizeof(mcIdType);
+}
+
/*!
* If true is returned it is a LittleEndian machine.
* If false it is a BigEndian machine.
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include <set>
#include <map>
+#include <atomic>
#include <vector>
#include <string>
#include <cstddef>
namespace MEDCoupling
{
- typedef enum
+ enum class DeallocType
{
C_DEALLOC = 2,
- CPP_DEALLOC = 3
- } DeallocType;
+ CPP_DEALLOC = 3,
+ C_DEALLOC_WITH_OFFSET = 4
+ };
//! The various spatial discretization of a field
typedef enum
MEDCOUPLING_EXPORT int MEDCouplingVersion();
MEDCOUPLING_EXPORT void MEDCouplingVersionMajMinRel(int& maj, int& minor, int& releas);
MEDCOUPLING_EXPORT int MEDCouplingSizeOfVoidStar();
+ MEDCOUPLING_EXPORT std::size_t MEDCouplingSizeOfIDs();
MEDCOUPLING_EXPORT bool MEDCouplingByteOrder();
MEDCOUPLING_EXPORT const char *MEDCouplingByteOrderStr();
MEDCOUPLING_EXPORT bool IsCXX11Compiled();
protected:
virtual ~RefCountObjectOnly();
private:
- mutable int _cnt;
+ mutable std::atomic<int> _cnt;
};
class RefCountObject : public RefCountObjectOnly, public BigMemoryObject
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
}
else if(srcMeshDim==2 && trgMeshDim==3 && srcSpaceDim==3)
{
- MEDCouplingNormalizedUnstructuredMesh<3,3> source_mesh_wrapper(src_mesh);
- MEDCouplingNormalizedUnstructuredMesh<3,3> target_mesh_wrapper(target_mesh);
- INTERP_KERNEL::Interpolation2D3D interpolation(*this);
- nbCols=interpolation.interpolateMeshes(source_mesh_wrapper,target_mesh_wrapper,_matrix,method);
- INTERP_KERNEL::Interpolation2D3D::DuplicateFacesType duplicateFaces=interpolation.retrieveDuplicateFaces();
- if(!duplicateFaces.empty())
+ if(getIntersectionType()==INTERP_KERNEL::PointLocator)
+ throw INTERP_KERNEL::Exception("Using point locator to transfer a mesh of dim 2 to a mesh of dim 3 does not make sense: 3D centers of mass can not be localized in a mesh having mesh-dim=2, space-dim=3!!");
+ else
{
- std::ostringstream oss; oss << "An unexpected situation happened ! For the following 2D Cells are part of edges shared by 3D cells :\n";
- for(std::map<int,std::set<int> >::const_iterator it=duplicateFaces.begin();it!=duplicateFaces.end();it++)
+ MEDCouplingNormalizedUnstructuredMesh<3,3> source_mesh_wrapper(src_mesh);
+ MEDCouplingNormalizedUnstructuredMesh<3,3> target_mesh_wrapper(target_mesh);
+ INTERP_KERNEL::Interpolation2D3D interpolation(*this);
+ nbCols=interpolation.interpolateMeshes(source_mesh_wrapper,target_mesh_wrapper,_matrix,method);
+ INTERP_KERNEL::Interpolation2D3D::DuplicateFacesType duplicateFaces=interpolation.retrieveDuplicateFaces();
+ if(!duplicateFaces.empty())
{
- oss << "2D Cell #" << (*it).first << " is part of common face of following 3D cells ids : ";
- std::copy((*it).second.begin(),(*it).second.end(),std::ostream_iterator<int>(oss," "));
- oss << std::endl;
+ std::ostringstream oss; oss << "An unexpected situation happened ! For the following 2D Cells are part of edges shared by 3D cells :\n";
+ for(std::map<int,std::set<int> >::const_iterator it=duplicateFaces.begin();it!=duplicateFaces.end();it++)
+ {
+ oss << "2D Cell #" << (*it).first << " is part of common face of following 3D cells ids : ";
+ std::copy((*it).second.begin(),(*it).second.end(),std::ostream_iterator<int>(oss," "));
+ oss << std::endl;
+ }
}
}
}
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include "MEDCouplingTimeLabel.hxx"
#include "InterpolationOptions.hxx"
#include "MEDCouplingNatureOfField.hxx"
+#include "MCType.hxx"
#include "MCAuto.hxx"
#include "InterpKernelException.hxx"
InterpolationMatrixPolicy _interp_matrix_pol;
NatureOfField _nature_of_deno;
unsigned int _time_deno_update;
- std::vector<std::map<int,double> > _matrix;
- std::vector<std::map<int,double> > _deno_multiply;
- std::vector<std::map<int,double> > _deno_reverse_multiply;
+ std::vector<std::map<mcIdType,double> > _matrix;
+ std::vector<std::map<mcIdType,double> > _deno_multiply;
+ std::vector<std::map<mcIdType,double> > _deno_reverse_multiply;
};
}
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
void validIndex(const std::string& func, int index) const;
void validSuperIndexAndIndex(const std::string& func, int superIndex, int index) const;
- MCAuto<DataArrayInt> _super_index;
- MCAuto<DataArrayInt> _index;
- MCAuto<DataArrayInt> _values;
+ MCAuto<DataArrayIdType> _super_index;
+ MCAuto<DataArrayIdType> _index;
+ MCAuto<DataArrayIdType> _values;
};
}
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
using namespace MEDCoupling;
-std::size_t TimeLabel::GLOBAL_TIME=0;
+std::atomic<std::size_t> TimeLabel::GLOBAL_TIME(0);
TimeLabel::TimeLabel():_time(GLOBAL_TIME++)
{
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include "MEDCoupling.hxx"
+#include <atomic>
#include <cstddef>
namespace MEDCoupling
MEDCOUPLING_EXPORT void updateTimeWith(const TimeLabel& other) const;
MEDCOUPLING_EXPORT void forceTimeOfThis(const TimeLabel& other) const;
private:
- static std::size_t GLOBAL_TIME;
+ static std::atomic<std::size_t> GLOBAL_TIME;
mutable std::size_t _time;
};
-// Copyright (C) 2016 CEA/DEN, EDF R&D
+// Copyright (C) 2016-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
const char Traits<int>::ReprStr[]="int";
+const char Traits<int>::VTKReprStr[]="Int32";
+
const char Traits<char>::ArrayTypeName[]="DataArrayChar";
const char Traits<Int64>::ArrayTypeName[]="DataArrayInt64";
const char Traits<Int64>::NPYStr[]="INT64";
const char Traits<Int64>::ReprStr[]="int64";
+
+const char Traits<Int64>::VTKReprStr[]="Int64";
-// Copyright (C) 2016 CEA/DEN, EDF R&D
+// Copyright (C) 2016-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
static const char FieldTypeName[];
static const char NPYStr[];
static const char ReprStr[];
+ static const char VTKReprStr[];
typedef DataArrayInt32 ArrayType;
typedef DataArrayInt32 ArrayTypeCh;
typedef MEDCouplingFieldInt FieldType;
static const char FieldTypeName[];
static const char NPYStr[];
static const char ReprStr[];
+ static const char VTKReprStr[];
typedef DataArrayInt64 ArrayType;
typedef DataArrayInt64 ArrayTypeCh;
//typedef MEDCouplingFieldInt64 FieldType;
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
checkFullyDefined();
int nbOfNodes(getNumberOfNodes());
int *revNodalIndxPtr=(int *)malloc((nbOfNodes+1)*sizeof(int));
- revNodalIndx->useArray(revNodalIndxPtr,true,C_DEALLOC,nbOfNodes+1,1);
+ revNodalIndx->useArray(revNodalIndxPtr,true,DeallocType::C_DEALLOC,nbOfNodes+1,1);
std::fill(revNodalIndxPtr,revNodalIndxPtr+nbOfNodes+1,0);
const int *conn(_nodal_connec->begin()),*connIndex(_nodal_connec_index->begin());
int nbOfCells(getNumberOfCells()),nbOfEltsInRevNodal(0);
}
std::transform(revNodalIndxPtr+1,revNodalIndxPtr+nbOfNodes+1,revNodalIndxPtr,revNodalIndxPtr+1,std::plus<int>());
int *revNodalPtr=(int *)malloc((nbOfEltsInRevNodal)*sizeof(int));
- revNodal->useArray(revNodalPtr,true,C_DEALLOC,nbOfEltsInRevNodal,1);
+ revNodal->useArray(revNodalPtr,true,DeallocType::C_DEALLOC,nbOfEltsInRevNodal,1);
std::fill(revNodalPtr,revNodalPtr+nbOfEltsInRevNodal,-1);
for(int eltId=0;eltId<nbOfCells;eltId++)
{
}
if(easyAssign)
{
- MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(cellIdsBg,cellIdsEnd,_nodal_connec,_nodal_connec_index,otherOnSameCoordsThanThis._nodal_connec,otherOnSameCoordsThanThis._nodal_connec_index);
+ DataArrayInt::SetPartOfIndexedArraysSameIdx(cellIdsBg,cellIdsEnd,_nodal_connec,_nodal_connec_index,otherOnSameCoordsThanThis._nodal_connec,otherOnSameCoordsThanThis._nodal_connec_index);
computeTypes();
}
else
{
DataArrayInt *arrOut=0,*arrIOut=0;
- MEDCouplingUMesh::SetPartOfIndexedArrays(cellIdsBg,cellIdsEnd,_nodal_connec,_nodal_connec_index,otherOnSameCoordsThanThis._nodal_connec,otherOnSameCoordsThanThis._nodal_connec_index,
+ DataArrayInt::SetPartOfIndexedArrays(cellIdsBg,cellIdsEnd,_nodal_connec,_nodal_connec_index,otherOnSameCoordsThanThis._nodal_connec,otherOnSameCoordsThanThis._nodal_connec_index,
arrOut,arrIOut);
MCAuto<DataArrayInt> arrOutAuto(arrOut),arrIOutAuto(arrIOut);
setConnectivity(arrOut,arrIOut,true);
}
if(easyAssign)
{
- MEDCouplingUMesh::SetPartOfIndexedArraysSameIdxSlice(start,end,step,_nodal_connec,_nodal_connec_index,otherOnSameCoordsThanThis._nodal_connec,otherOnSameCoordsThanThis._nodal_connec_index);
+ DataArrayInt::SetPartOfIndexedArraysSameIdxSlice(start,end,step,_nodal_connec,_nodal_connec_index,otherOnSameCoordsThanThis._nodal_connec,otherOnSameCoordsThanThis._nodal_connec_index);
computeTypes();
}
else
{
DataArrayInt *arrOut=0,*arrIOut=0;
- MEDCouplingUMesh::SetPartOfIndexedArraysSlice(start,end,step,_nodal_connec,_nodal_connec_index,otherOnSameCoordsThanThis._nodal_connec,otherOnSameCoordsThanThis._nodal_connec_index,
+ DataArrayInt::SetPartOfIndexedArraysSlice(start,end,step,_nodal_connec,_nodal_connec_index,otherOnSameCoordsThanThis._nodal_connec,otherOnSameCoordsThanThis._nodal_connec_index,
arrOut,arrIOut);
MCAuto<DataArrayInt> arrOutAuto(arrOut),arrIOutAuto(arrIOut);
setConnectivity(arrOut,arrIOut,true);
DAInt ids(idsTmp);
// In the neighbor information remove the connection between high dimension cells and its low level constituents which are part
// of the frontier given in parameter (i.e. the cells of low dimension from the group delimiting the crack):
- MEDCouplingUMesh::RemoveIdsFromIndexedArrays(ids->begin(),ids->end(),desc00,descI00);
+ DataArrayInt::RemoveIdsFromIndexedArrays(ids->begin(),ids->end(),desc00,descI00);
DataArrayInt *tmp0=0,*tmp1=0;
// Compute the neighbor of each cell in m0Part2, taking into account the broken link above. Two
// cells on either side of the crack (defined by the mesh of low dimension) are not neighbor anymore.
//
const int *conn=_nodal_connec->getConstPointer();
const int *connI=_nodal_connec_index->getConstPointer();
- MCAuto<DataArrayInt> o2n=DataArrayInt::New(); o2n->useArray(array,false,C_DEALLOC,nbCells,1);
+ MCAuto<DataArrayInt> o2n=DataArrayInt::New(); o2n->useArray(array,false,DeallocType::C_DEALLOC,nbCells,1);
MCAuto<DataArrayInt> n2o=o2n->invertArrayO2N2N2O(nbCells);
const int *n2oPtr=n2o->begin();
MCAuto<DataArrayInt> newConn=DataArrayInt::New();
std::string name="MeasureOnNodeOfMesh_";
name+=getName();
int nbNodes=getNumberOfNodes();
+ MCAuto<DataArrayDouble> nnpc;
+ {
+ MCAuto<DataArrayInt> tmp(computeNbOfNodesPerCell());
+ nnpc=tmp->convertToDblArr();
+ }
+ std::for_each(nnpc->rwBegin(),nnpc->rwEnd(),[](double& v) { v=1./v; });
+ const double *nnpcPtr(nnpc->begin());
MCAuto<MEDCouplingFieldDouble> ret=MEDCouplingFieldDouble::New(ON_NODES);
- double cst=1./((double)getMeshDimension()+1.);
MCAuto<DataArrayDouble> array=DataArrayDouble::New();
array->alloc(nbNodes,1);
double *valsToFill=array->getPointer();
const int *daIPtr=daInd->getConstPointer();
for(int i=0;i<nbNodes;i++)
for(const int *cell=daPtr+daIPtr[i];cell!=daPtr+daIPtr[i+1];cell++)
- valsToFill[i]+=cst*values[*cell];
+ valsToFill[i]+=nnpcPtr[*cell]*values[*cell];
ret->setMesh(this);
ret->setArray(array);
return ret.retn();
if((int)std::distance(ptBg,ptEnd)!=spaceDim)
{ std::ostringstream oss; oss << "MEDCouplingUMesh::distanceToPoint : input point has to have dimension equal to the space dimension of this (" << spaceDim << ") !"; throw INTERP_KERNEL::Exception(oss.str()); }
DataArrayInt *ret1=0;
- MCAuto<DataArrayDouble> pts=DataArrayDouble::New(); pts->useArray(ptBg,false,C_DEALLOC,1,spaceDim);
+ MCAuto<DataArrayDouble> pts=DataArrayDouble::New(); pts->useArray(ptBg,false,DeallocType::C_DEALLOC,1,spaceDim);
MCAuto<DataArrayDouble> ret0=distanceToPoints(pts,ret1);
MCAuto<DataArrayInt> ret1Safe(ret1);
cellId=*ret1Safe->begin();
* Returns a new DataArrayDouble holding barycenters of all cells. The barycenter is
* computed by averaging coordinates of cell nodes, so this method is not a right
* choice for degenerated meshes (not well oriented, cells with measure close to zero).
+ * Beware also that for quadratic meshes, degenerated arc of circles are turned into linear edges for the computation.
+ * This happens with a default detection precision of eps=1.0e-14. If you need control over this use computeCellCenterOfMassWithPrecision().
* \return DataArrayDouble * - a new instance of DataArrayDouble, of size \a
* this->getNumberOfCells() tuples per \a this->getSpaceDimension()
* components. The caller is to delete this array using decrRef() as it is
* \throw If the coordinates array is not set.
* \throw If the nodal connectivity of cells is not defined.
* \sa MEDCouplingUMesh::computeIsoBarycenterOfNodesPerCell
+ * \sa MEDCouplingUMesh::computeCellCenterOfMassWithPrecision
*/
DataArrayDouble *MEDCouplingUMesh::computeCellCenterOfMass() const
{
return ret.retn();
}
+
+/*!
+ * See computeCellCenterOfMass().
+ * \param eps a precision for the detection of degenerated arc of circles.
+ * \return DataArrayDouble * - a new instance of DataArrayDouble, of size \a
+ * this->getNumberOfCells() tuples per \a this->getSpaceDimension()
+ * components. The caller is to delete this array using decrRef() as it is
+ * no more needed.
+ * \throw If the coordinates array is not set.
+ * \throw If the nodal connectivity of cells is not defined.
+ * \sa MEDCouplingUMesh::computeIsoBarycenterOfNodesPerCell
+ * \sa MEDCouplingUMesh::computeCellCenterOfMassWithPrecision
+ */
+DataArrayDouble *MEDCouplingUMesh::computeCellCenterOfMassWithPrecision(double eps) const
+{
+ INTERP_KERNEL::QuadraticPlanarPrecision prec(eps);
+ MCAuto<DataArrayDouble> ret = computeCellCenterOfMass();
+ return ret.retn();
+}
+
+
/*!
* This method computes for each cell in \a this, the location of the iso barycenter of nodes constituting
* the cell. Contrary to badly named MEDCouplingUMesh::computeCellCenterOfMass method that returns the center of inertia of the
if(!isQuadratic)
for(i=0;i<sz;i++)
{
+ // Algorithm: sum in v the cross products of (e1, e2) where e_i it the vector between (0,0,0) and point i
+ // and e2 is linear point directly following e1 in the connectivity. All points are used.
v[0]+=coords[3*begin[i]+1]*coords[3*begin[(i+1)%sz]+2]-coords[3*begin[i]+2]*coords[3*begin[(i+1)%sz]+1];
v[1]+=coords[3*begin[i]+2]*coords[3*begin[(i+1)%sz]]-coords[3*begin[i]]*coords[3*begin[(i+1)%sz]+2];
v[2]+=coords[3*begin[i]]*coords[3*begin[(i+1)%sz]+1]-coords[3*begin[i]+1]*coords[3*begin[(i+1)%sz]];
}
else
{
- // Use all points if quadratic (taking only linear points might lead to issues if the linearized version of the
+ // Same algorithm as above but also using intermediate quadratic points.
+ // (taking only linear points might lead to issues if the linearized version of the
// polygon is not convex or self-intersecting ... see testCellOrientation4)
- sz /= 2;
+ int hsz = sz/2;
for(std::size_t j=0;j<sz;j++)
{
if (j%2) // current point i is quadratic, next point i+1 is standard
{
- i = sz+j;
- ip1 = (j+1)%sz; // ip1 = "i+1"
+ i = hsz+(j-1)/2;
+ ip1 = ((j-1)/2 + 1)%hsz; // ip1 means "i+1", i.e. next point
}
else // current point i is standard, next point i+1 is quadratic
{
- i = j;
- ip1 = j+sz;
+ i = j/2;
+ ip1 = j/2+hsz;
}
v[0]+=coords[3*begin[i]+1]*coords[3*begin[ip1]+2]-coords[3*begin[i]+2]*coords[3*begin[ip1]+1];
v[1]+=coords[3*begin[i]+2]*coords[3*begin[ip1]]-coords[3*begin[i]]*coords[3*begin[ip1]+2];
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::BuildConvexEnvelopOf2DCellJarvis : invalid 2D cell connectivity !");
}
-/*!
- * This method works on an input pair (\b arr, \b arrIndx) where \b arr indexes is in \b arrIndx.
- * This method will not impact the size of inout parameter \b arrIndx but the size of \b arr will be modified in case of suppression.
- *
- * \param [in] idsToRemoveBg begin of set of ids to remove in \b arr (included)
- * \param [in] idsToRemoveEnd end of set of ids to remove in \b arr (excluded)
- * \param [in,out] arr array in which the remove operation will be done.
- * \param [in,out] arrIndx array in the remove operation will modify
- * \param [in] offsetForRemoval (by default 0) offset so that for each i in [0,arrIndx->getNumberOfTuples()-1) removal process will be performed in the following range [arr+arrIndx[i]+offsetForRemoval,arr+arr[i+1])
- * \return true if \b arr and \b arrIndx have been modified, false if not.
- */
-bool MEDCouplingUMesh::RemoveIdsFromIndexedArrays(const int *idsToRemoveBg, const int *idsToRemoveEnd, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval)
-{
- if(!arrIndx || !arr)
- throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : some input arrays are empty !");
- if(offsetForRemoval<0)
- throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : offsetForRemoval should be >=0 !");
- std::set<int> s(idsToRemoveBg,idsToRemoveEnd);
- int nbOfGrps=arrIndx->getNumberOfTuples()-1;
- int *arrIPtr=arrIndx->getPointer();
- *arrIPtr++=0;
- int previousArrI=0;
- const int *arrPtr=arr->begin();
- std::vector<int> arrOut;//no utility to switch to DataArrayInt because copy always needed
- for(int i=0;i<nbOfGrps;i++,arrIPtr++)
- {
- if(*arrIPtr-previousArrI>offsetForRemoval)
- {
- for(const int *work=arrPtr+previousArrI+offsetForRemoval;work!=arrPtr+*arrIPtr;work++)
- {
- if(s.find(*work)==s.end())
- arrOut.push_back(*work);
- }
- }
- previousArrI=*arrIPtr;
- *arrIPtr=(int)arrOut.size();
- }
- if(arr->getNumberOfTuples()==arrOut.size())
- return false;
- arr->alloc((int)arrOut.size(),1);
- std::copy(arrOut.begin(),arrOut.end(),arr->getPointer());
- return true;
-}
-
-/*!
- * This method works on a pair input (\b arrIn, \b arrIndxIn) where \b arrIn indexes is in \b arrIndxIn
- * (\ref numbering-indirect).
- * This method returns the result of the extraction ( specified by a set of ids in [\b idsOfSelectBg , \b idsOfSelectEnd ) ).
- * The selection of extraction is done standardly in new2old format.
- * This method returns indexed arrays (\ref numbering-indirect) using 2 arrays (arrOut,arrIndexOut).
- *
- * \param [in] idsOfSelectBg begin of set of ids of the input extraction (included)
- * \param [in] idsOfSelectEnd end of set of ids of the input extraction (excluded)
- * \param [in] arrIn arr origin array from which the extraction will be done.
- * \param [in] arrIndxIn is the input index array allowing to walk into \b arrIn
- * \param [out] arrOut the resulting array
- * \param [out] arrIndexOut the index array of the resulting array \b arrOut
- * \sa MEDCouplingUMesh::ExtractFromIndexedArraysSlice
- */
-void MEDCouplingUMesh::ExtractFromIndexedArrays(const int *idsOfSelectBg, const int *idsOfSelectEnd, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
- DataArrayInt* &arrOut, DataArrayInt* &arrIndexOut)
-{
- if(!arrIn || !arrIndxIn)
- throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : input pointer is NULL !");
- arrIn->checkAllocated(); arrIndxIn->checkAllocated();
- if(arrIn->getNumberOfComponents()!=1 || arrIndxIn->getNumberOfComponents()!=1)
- throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : input arrays must have exactly one component !");
- std::size_t sz=std::distance(idsOfSelectBg,idsOfSelectEnd);
- const int *arrInPtr=arrIn->begin();
- const int *arrIndxPtr=arrIndxIn->begin();
- int nbOfGrps=arrIndxIn->getNumberOfTuples()-1;
- if(nbOfGrps<0)
- throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : The format of \"arrIndxIn\" is invalid ! Its nb of tuples should be >=1 !");
- int maxSizeOfArr=arrIn->getNumberOfTuples();
- MCAuto<DataArrayInt> arro=DataArrayInt::New();
- MCAuto<DataArrayInt> arrIo=DataArrayInt::New();
- arrIo->alloc((int)(sz+1),1);
- const int *idsIt=idsOfSelectBg;
- int *work=arrIo->getPointer();
- *work++=0;
- int lgth=0;
- for(std::size_t i=0;i<sz;i++,work++,idsIt++)
- {
- if(*idsIt>=0 && *idsIt<nbOfGrps)
- lgth+=arrIndxPtr[*idsIt+1]-arrIndxPtr[*idsIt];
- else
- {
- std::ostringstream oss; oss << "MEDCouplingUMesh::ExtractFromIndexedArrays : id located on pos #" << i << " value is " << *idsIt << " ! Must be in [0," << nbOfGrps << ") !";
- throw INTERP_KERNEL::Exception(oss.str());
- }
- if(lgth>=work[-1])
- *work=lgth;
- else
- {
- std::ostringstream oss; oss << "MEDCouplingUMesh::ExtractFromIndexedArrays : id located on pos #" << i << " value is " << *idsIt << " and at this pos arrIndxIn[" << *idsIt;
- oss << "+1]-arrIndxIn[" << *idsIt << "] < 0 ! The input index array is bugged !";
- throw INTERP_KERNEL::Exception(oss.str());
- }
- }
- arro->alloc(lgth,1);
- work=arro->getPointer();
- idsIt=idsOfSelectBg;
- for(std::size_t i=0;i<sz;i++,idsIt++)
- {
- if(arrIndxPtr[*idsIt]>=0 && arrIndxPtr[*idsIt+1]<=maxSizeOfArr)
- work=std::copy(arrInPtr+arrIndxPtr[*idsIt],arrInPtr+arrIndxPtr[*idsIt+1],work);
- else
- {
- std::ostringstream oss; oss << "MEDCouplingUMesh::ExtractFromIndexedArrays : id located on pos #" << i << " value is " << *idsIt << " arrIndx[" << *idsIt << "] must be >= 0 and arrIndx[";
- oss << *idsIt << "+1] <= " << maxSizeOfArr << " (the size of arrIn)!";
- throw INTERP_KERNEL::Exception(oss.str());
- }
- }
- arrOut=arro.retn();
- arrIndexOut=arrIo.retn();
-}
-
-/*!
- * This method works on a pair input (\b arrIn, \b arrIndxIn) where \b arrIn indexes is in \b arrIndxIn
- * (\ref numbering-indirect).
- * This method returns the result of the extraction ( specified by a set of ids with a slice given by \a idsOfSelectStart, \a idsOfSelectStop and \a idsOfSelectStep ).
- * The selection of extraction is done standardly in new2old format.
- * This method returns indexed arrays (\ref numbering-indirect) using 2 arrays (arrOut,arrIndexOut).
- *
- * \param [in] idsOfSelectStart begin of set of ids of the input extraction (included)
- * \param [in] idsOfSelectStop end of set of ids of the input extraction (excluded)
- * \param [in] idsOfSelectStep
- * \param [in] arrIn arr origin array from which the extraction will be done.
- * \param [in] arrIndxIn is the input index array allowing to walk into \b arrIn
- * \param [out] arrOut the resulting array
- * \param [out] arrIndexOut the index array of the resulting array \b arrOut
- * \sa MEDCouplingUMesh::ExtractFromIndexedArrays
- */
-void MEDCouplingUMesh::ExtractFromIndexedArraysSlice(int idsOfSelectStart, int idsOfSelectStop, int idsOfSelectStep, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
- DataArrayInt* &arrOut, DataArrayInt* &arrIndexOut)
-{
- if(!arrIn || !arrIndxIn)
- throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArraysSlice : input pointer is NULL !");
- arrIn->checkAllocated(); arrIndxIn->checkAllocated();
- if(arrIn->getNumberOfComponents()!=1 || arrIndxIn->getNumberOfComponents()!=1)
- throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArraysSlice : input arrays must have exactly one component !");
- int sz=DataArrayInt::GetNumberOfItemGivenBESRelative(idsOfSelectStart,idsOfSelectStop,idsOfSelectStep,"MEDCouplingUMesh::ExtractFromIndexedArraysSlice : Input slice ");
- const int *arrInPtr=arrIn->begin();
- const int *arrIndxPtr=arrIndxIn->begin();
- int nbOfGrps=arrIndxIn->getNumberOfTuples()-1;
- if(nbOfGrps<0)
- throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArraysSlice : The format of \"arrIndxIn\" is invalid ! Its nb of tuples should be >=1 !");
- int maxSizeOfArr=arrIn->getNumberOfTuples();
- MCAuto<DataArrayInt> arro=DataArrayInt::New();
- MCAuto<DataArrayInt> arrIo=DataArrayInt::New();
- arrIo->alloc((int)(sz+1),1);
- int idsIt=idsOfSelectStart;
- int *work=arrIo->getPointer();
- *work++=0;
- int lgth=0;
- for(int i=0;i<sz;i++,work++,idsIt+=idsOfSelectStep)
- {
- if(idsIt>=0 && idsIt<nbOfGrps)
- lgth+=arrIndxPtr[idsIt+1]-arrIndxPtr[idsIt];
- else
- {
- std::ostringstream oss; oss << "MEDCouplingUMesh::ExtractFromIndexedArraysSlice : id located on pos #" << i << " value is " << idsIt << " ! Must be in [0," << nbOfGrps << ") !";
- throw INTERP_KERNEL::Exception(oss.str());
- }
- if(lgth>=work[-1])
- *work=lgth;
- else
- {
- std::ostringstream oss; oss << "MEDCouplingUMesh::ExtractFromIndexedArraysSlice : id located on pos #" << i << " value is " << idsIt << " and at this pos arrIndxIn[" << idsIt;
- oss << "+1]-arrIndxIn[" << idsIt << "] < 0 ! The input index array is bugged !";
- throw INTERP_KERNEL::Exception(oss.str());
- }
- }
- arro->alloc(lgth,1);
- work=arro->getPointer();
- idsIt=idsOfSelectStart;
- for(int i=0;i<sz;i++,idsIt+=idsOfSelectStep)
- {
- if(arrIndxPtr[idsIt]>=0 && arrIndxPtr[idsIt+1]<=maxSizeOfArr)
- work=std::copy(arrInPtr+arrIndxPtr[idsIt],arrInPtr+arrIndxPtr[idsIt+1],work);
- else
- {
- std::ostringstream oss; oss << "MEDCouplingUMesh::ExtractFromIndexedArraysSlice : id located on pos #" << i << " value is " << idsIt << " arrIndx[" << idsIt << "] must be >= 0 and arrIndx[";
- oss << idsIt << "+1] <= " << maxSizeOfArr << " (the size of arrIn)!";
- throw INTERP_KERNEL::Exception(oss.str());
- }
- }
- arrOut=arro.retn();
- arrIndexOut=arrIo.retn();
-}
-
-/*!
- * This method works on an input pair (\b arrIn, \b arrIndxIn) where \b arrIn indexes is in \b arrIndxIn.
- * This method builds an output pair (\b arrOut,\b arrIndexOut) that is a copy from \b arrIn for all cell ids \b not \b in [ \b idsOfSelectBg , \b idsOfSelectEnd ) and for
- * cellIds \b in [ \b idsOfSelectBg , \b idsOfSelectEnd ) a copy coming from the corresponding values in input pair (\b srcArr, \b srcArrIndex).
- * This method is an generalization of MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx that performs the same thing but by without building explicitly a result output arrays.
- *
- * \param [in] idsOfSelectBg begin of set of ids of the input extraction (included)
- * \param [in] idsOfSelectEnd end of set of ids of the input extraction (excluded)
- * \param [in] arrIn arr origin array from which the extraction will be done.
- * \param [in] arrIndxIn is the input index array allowing to walk into \b arrIn
- * \param [in] srcArr input array that will be used as source of copy for ids in [ \b idsOfSelectBg, \b idsOfSelectEnd )
- * \param [in] srcArrIndex index array of \b srcArr
- * \param [out] arrOut the resulting array
- * \param [out] arrIndexOut the index array of the resulting array \b arrOut
- *
- * \sa MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx
- */
-void MEDCouplingUMesh::SetPartOfIndexedArrays(const int *idsOfSelectBg, const int *idsOfSelectEnd, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
- const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex,
- DataArrayInt* &arrOut, DataArrayInt* &arrIndexOut)
-{
- if(arrIn==0 || arrIndxIn==0 || srcArr==0 || srcArrIndex==0)
- throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : presence of null pointer in input parameter !");
- MCAuto<DataArrayInt> arro=DataArrayInt::New();
- MCAuto<DataArrayInt> arrIo=DataArrayInt::New();
- int nbOfTuples=arrIndxIn->getNumberOfTuples()-1;
- std::vector<bool> v(nbOfTuples,true);
- int offset=0;
- const int *arrIndxInPtr=arrIndxIn->begin();
- const int *srcArrIndexPtr=srcArrIndex->begin();
- for(const int *it=idsOfSelectBg;it!=idsOfSelectEnd;it++,srcArrIndexPtr++)
- {
- if(*it>=0 && *it<nbOfTuples)
- {
- v[*it]=false;
- offset+=(srcArrIndexPtr[1]-srcArrIndexPtr[0])-(arrIndxInPtr[*it+1]-arrIndxInPtr[*it]);
- }
- else
- {
- std::ostringstream oss; oss << "MEDCouplingUMesh::SetPartOfIndexedArrays : On pos #" << std::distance(idsOfSelectBg,it) << " value is " << *it << " not in [0," << nbOfTuples << ") !";
- throw INTERP_KERNEL::Exception(oss.str());
- }
- }
- srcArrIndexPtr=srcArrIndex->begin();
- arrIo->alloc(nbOfTuples+1,1);
- arro->alloc(arrIn->getNumberOfTuples()+offset,1);
- const int *arrInPtr=arrIn->begin();
- const int *srcArrPtr=srcArr->begin();
- int *arrIoPtr=arrIo->getPointer(); *arrIoPtr++=0;
- int *arroPtr=arro->getPointer();
- for(int ii=0;ii<nbOfTuples;ii++,arrIoPtr++)
- {
- if(v[ii])
- {
- arroPtr=std::copy(arrInPtr+arrIndxInPtr[ii],arrInPtr+arrIndxInPtr[ii+1],arroPtr);
- *arrIoPtr=arrIoPtr[-1]+(arrIndxInPtr[ii+1]-arrIndxInPtr[ii]);
- }
- else
- {
- std::size_t pos=std::distance(idsOfSelectBg,std::find(idsOfSelectBg,idsOfSelectEnd,ii));
- arroPtr=std::copy(srcArrPtr+srcArrIndexPtr[pos],srcArrPtr+srcArrIndexPtr[pos+1],arroPtr);
- *arrIoPtr=arrIoPtr[-1]+(srcArrIndexPtr[pos+1]-srcArrIndexPtr[pos]);
- }
- }
- arrOut=arro.retn();
- arrIndexOut=arrIo.retn();
-}
-
-/*!
- * This method works on an input pair (\b arrIn, \b arrIndxIn) where \b arrIn indexes is in \b arrIndxIn.
- * This method is an specialization of MEDCouplingUMesh::SetPartOfIndexedArrays in the case of assignment do not modify the index in \b arrIndxIn.
- *
- * \param [in] idsOfSelectBg begin of set of ids of the input extraction (included)
- * \param [in] idsOfSelectEnd end of set of ids of the input extraction (excluded)
- * \param [in,out] arrInOut arr origin array from which the extraction will be done.
- * \param [in] arrIndxIn is the input index array allowing to walk into \b arrIn
- * \param [in] srcArr input array that will be used as source of copy for ids in [ \b idsOfSelectBg , \b idsOfSelectEnd )
- * \param [in] srcArrIndex index array of \b srcArr
- *
- * \sa MEDCouplingUMesh::SetPartOfIndexedArrays
- */
-void MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(const int *idsOfSelectBg, const int *idsOfSelectEnd, DataArrayInt *arrInOut, const DataArrayInt *arrIndxIn,
- const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex)
-{
- if(arrInOut==0 || arrIndxIn==0 || srcArr==0 || srcArrIndex==0)
- throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : presence of null pointer in input parameter !");
- int nbOfTuples=arrIndxIn->getNumberOfTuples()-1;
- const int *arrIndxInPtr=arrIndxIn->begin();
- const int *srcArrIndexPtr=srcArrIndex->begin();
- int *arrInOutPtr=arrInOut->getPointer();
- const int *srcArrPtr=srcArr->begin();
- for(const int *it=idsOfSelectBg;it!=idsOfSelectEnd;it++,srcArrIndexPtr++)
- {
- if(*it>=0 && *it<nbOfTuples)
- {
- if(srcArrIndexPtr[1]-srcArrIndexPtr[0]==arrIndxInPtr[*it+1]-arrIndxInPtr[*it])
- std::copy(srcArrPtr+srcArrIndexPtr[0],srcArrPtr+srcArrIndexPtr[1],arrInOutPtr+arrIndxInPtr[*it]);
- else
- {
- std::ostringstream oss; oss << "MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : On pos #" << std::distance(idsOfSelectBg,it) << " id (idsOfSelectBg[" << std::distance(idsOfSelectBg,it)<< "]) is " << *it << " arrIndxIn[id+1]-arrIndxIn[id]!=srcArrIndex[pos+1]-srcArrIndex[pos] !";
- throw INTERP_KERNEL::Exception(oss.str());
- }
- }
- else
- {
- std::ostringstream oss; oss << "MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : On pos #" << std::distance(idsOfSelectBg,it) << " value is " << *it << " not in [0," << nbOfTuples << ") !";
- throw INTERP_KERNEL::Exception(oss.str());
- }
- }
-}
-
/*!
* This method works on a pair input (\b arrIn, \b arrIndxIn) where \b arr indexes is in \b arrIndxIn.
* This method expects that these two input arrays come from the output of MEDCouplingUMesh::computeNeighborsOfCells method.
}
-/*!
- * This method works on an input pair (\b arrIn, \b arrIndxIn) where \b arrIn indexes is in \b arrIndxIn.
- * This method builds an output pair (\b arrOut,\b arrIndexOut) that is a copy from \b arrIn for all cell ids \b not \b in [ \b idsOfSelectBg , \b idsOfSelectEnd ) and for
- * cellIds \b in [\b idsOfSelectBg, \b idsOfSelectEnd) a copy coming from the corresponding values in input pair (\b srcArr, \b srcArrIndex).
- * This method is an generalization of MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx that performs the same thing but by without building explicitly a result output arrays.
- *
- * \param [in] start begin of set of ids of the input extraction (included)
- * \param [in] end end of set of ids of the input extraction (excluded)
- * \param [in] step step of the set of ids in range mode.
- * \param [in] arrIn arr origin array from which the extraction will be done.
- * \param [in] arrIndxIn is the input index array allowing to walk into \b arrIn
- * \param [in] srcArr input array that will be used as source of copy for ids in [\b idsOfSelectBg, \b idsOfSelectEnd)
- * \param [in] srcArrIndex index array of \b srcArr
- * \param [out] arrOut the resulting array
- * \param [out] arrIndexOut the index array of the resulting array \b arrOut
- *
- * \sa MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx MEDCouplingUMesh::SetPartOfIndexedArrays
- */
-void MEDCouplingUMesh::SetPartOfIndexedArraysSlice(int start, int end, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
- const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex,
- DataArrayInt* &arrOut, DataArrayInt* &arrIndexOut)
-{
- if(arrIn==0 || arrIndxIn==0 || srcArr==0 || srcArrIndex==0)
- throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSlice : presence of null pointer in input parameter !");
- MCAuto<DataArrayInt> arro=DataArrayInt::New();
- MCAuto<DataArrayInt> arrIo=DataArrayInt::New();
- int nbOfTuples=arrIndxIn->getNumberOfTuples()-1;
- int offset=0;
- const int *arrIndxInPtr=arrIndxIn->begin();
- const int *srcArrIndexPtr=srcArrIndex->begin();
- int nbOfElemsToSet=DataArray::GetNumberOfItemGivenBESRelative(start,end,step,"MEDCouplingUMesh::SetPartOfIndexedArraysSlice : ");
- int it=start;
- for(int i=0;i<nbOfElemsToSet;i++,srcArrIndexPtr++,it+=step)
- {
- if(it>=0 && it<nbOfTuples)
- offset+=(srcArrIndexPtr[1]-srcArrIndexPtr[0])-(arrIndxInPtr[it+1]-arrIndxInPtr[it]);
- else
- {
- std::ostringstream oss; oss << "MEDCouplingUMesh::SetPartOfIndexedArraysSlice : On pos #" << i << " value is " << it << " not in [0," << nbOfTuples << ") !";
- throw INTERP_KERNEL::Exception(oss.str());
- }
- }
- srcArrIndexPtr=srcArrIndex->begin();
- arrIo->alloc(nbOfTuples+1,1);
- arro->alloc(arrIn->getNumberOfTuples()+offset,1);
- const int *arrInPtr=arrIn->begin();
- const int *srcArrPtr=srcArr->begin();
- int *arrIoPtr=arrIo->getPointer(); *arrIoPtr++=0;
- int *arroPtr=arro->getPointer();
- for(int ii=0;ii<nbOfTuples;ii++,arrIoPtr++)
- {
- int pos=DataArray::GetPosOfItemGivenBESRelativeNoThrow(ii,start,end,step);
- if(pos<0)
- {
- arroPtr=std::copy(arrInPtr+arrIndxInPtr[ii],arrInPtr+arrIndxInPtr[ii+1],arroPtr);
- *arrIoPtr=arrIoPtr[-1]+(arrIndxInPtr[ii+1]-arrIndxInPtr[ii]);
- }
- else
- {
- arroPtr=std::copy(srcArrPtr+srcArrIndexPtr[pos],srcArrPtr+srcArrIndexPtr[pos+1],arroPtr);
- *arrIoPtr=arrIoPtr[-1]+(srcArrIndexPtr[pos+1]-srcArrIndexPtr[pos]);
- }
- }
- arrOut=arro.retn();
- arrIndexOut=arrIo.retn();
-}
-
-/*!
- * This method works on an input pair (\b arrIn, \b arrIndxIn) where \b arrIn indexes is in \b arrIndxIn.
- * This method is an specialization of MEDCouplingUMesh::SetPartOfIndexedArrays in the case of assignment do not modify the index in \b arrIndxIn.
- *
- * \param [in] start begin of set of ids of the input extraction (included)
- * \param [in] end end of set of ids of the input extraction (excluded)
- * \param [in] step step of the set of ids in range mode.
- * \param [in,out] arrInOut arr origin array from which the extraction will be done.
- * \param [in] arrIndxIn is the input index array allowing to walk into \b arrIn
- * \param [in] srcArr input array that will be used as source of copy for ids in [\b idsOfSelectBg, \b idsOfSelectEnd)
- * \param [in] srcArrIndex index array of \b srcArr
- *
- * \sa MEDCouplingUMesh::SetPartOfIndexedArraysSlice MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx
- */
-void MEDCouplingUMesh::SetPartOfIndexedArraysSameIdxSlice(int start, int end, int step, DataArrayInt *arrInOut, const DataArrayInt *arrIndxIn,
- const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex)
-{
- if(arrInOut==0 || arrIndxIn==0 || srcArr==0 || srcArrIndex==0)
- throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdxSlice : presence of null pointer in input parameter !");
- int nbOfTuples=arrIndxIn->getNumberOfTuples()-1;
- const int *arrIndxInPtr=arrIndxIn->begin();
- const int *srcArrIndexPtr=srcArrIndex->begin();
- int *arrInOutPtr=arrInOut->getPointer();
- const int *srcArrPtr=srcArr->begin();
- int nbOfElemsToSet=DataArray::GetNumberOfItemGivenBESRelative(start,end,step,"MEDCouplingUMesh::SetPartOfIndexedArraysSameIdxSlice : ");
- int it=start;
- for(int i=0;i<nbOfElemsToSet;i++,srcArrIndexPtr++,it+=step)
- {
- if(it>=0 && it<nbOfTuples)
- {
- if(srcArrIndexPtr[1]-srcArrIndexPtr[0]==arrIndxInPtr[it+1]-arrIndxInPtr[it])
- std::copy(srcArrPtr+srcArrIndexPtr[0],srcArrPtr+srcArrIndexPtr[1],arrInOutPtr+arrIndxInPtr[it]);
- else
- {
- std::ostringstream oss; oss << "MEDCouplingUMesh::SetPartOfIndexedArraysSameIdxSlice : On pos #" << i << " id (idsOfSelectBg[" << i << "]) is " << it << " arrIndxIn[id+1]-arrIndxIn[id]!=srcArrIndex[pos+1]-srcArrIndex[pos] !";
- throw INTERP_KERNEL::Exception(oss.str());
- }
- }
- else
- {
- std::ostringstream oss; oss << "MEDCouplingUMesh::SetPartOfIndexedArraysSameIdxSlice : On pos #" << i << " value is " << it << " not in [0," << nbOfTuples << ") !";
- throw INTERP_KERNEL::Exception(oss.str());
- }
- }
-}
/*!
* \b this is expected to be a mesh fully defined whose spaceDim==meshDim.
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
MEDCOUPLING_EXPORT MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const;
MEDCOUPLING_EXPORT DataArrayDouble *computeCellCenterOfMass() const;
+ MEDCOUPLING_EXPORT DataArrayDouble *computeCellCenterOfMassWithPrecision(double eps) const;
MEDCOUPLING_EXPORT DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const;
MEDCOUPLING_EXPORT DataArrayDouble *getPartBarycenterAndOwner(const int *begin, const int *end) const;
MEDCOUPLING_EXPORT DataArrayDouble *computePlaneEquationOf3DFaces() const;
MEDCOUPLING_EXPORT static void Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D,
double eps, MEDCouplingUMesh *&splitMesh2D, MEDCouplingUMesh *&splitMesh1D, DataArrayInt *&cellIdInMesh2D, DataArrayInt *&cellIdInMesh1D);
MEDCOUPLING_EXPORT static bool BuildConvexEnvelopOf2DCellJarvis(const double *coords, const int *nodalConnBg, const int *nodalConnEnd, DataArrayInt *nodalConnecOut);
- MEDCOUPLING_EXPORT static bool RemoveIdsFromIndexedArrays(const int *idsToRemoveBg, const int *idsToRemoveEnd, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0);
- MEDCOUPLING_EXPORT static void ExtractFromIndexedArrays(const int *idsOfSelectBg, const int *idsOfSelectEnd, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
- DataArrayInt* &arrOut, DataArrayInt* &arrIndexOut);
- MEDCOUPLING_EXPORT static void ExtractFromIndexedArraysSlice(int idsOfSelectStart, int idsOfSelectStop, int idsOfSelectStep, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
- DataArrayInt* &arrOut, DataArrayInt* &arrIndexOut);
- MEDCOUPLING_EXPORT static void SetPartOfIndexedArrays(const int *idsOfSelectBg, const int *idsOfSelectEnd, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
- const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex,
- DataArrayInt* &arrOut, DataArrayInt* &arrIndexOut);
- MEDCOUPLING_EXPORT static void SetPartOfIndexedArraysSameIdx(const int *idsOfSelectBg, const int *idsOfSelectEnd, DataArrayInt *arrInOut, const DataArrayInt *arrIndxIn,
- const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex);
- MEDCOUPLING_EXPORT static void SetPartOfIndexedArraysSlice(int start, int end, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
- const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex,
- DataArrayInt* &arrOut, DataArrayInt* &arrIndexOut);
- MEDCOUPLING_EXPORT static void SetPartOfIndexedArraysSameIdxSlice(int start, int end, int step, DataArrayInt *arrInOut, const DataArrayInt *arrIndxIn,
- const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex);
MEDCOUPLING_EXPORT static std::vector<DataArrayInt *> PartitionBySpreadZone(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn);
MEDCOUPLING_EXPORT static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn);
MEDCOUPLING_EXPORT static DataArrayInt *ComputeSpreadZoneGraduallyFromSeed(const int *seedBg, const int *seedEnd, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling, int& nbOfDepthPeelingPerformed);
/// @endcond
private:
int _mesh_dim;
- DataArrayInt *_nodal_connec;
- DataArrayInt *_nodal_connec_index;
+ DataArrayIdType *_nodal_connec;
+ DataArrayIdType *_nodal_connec_index;
std::set<INTERP_KERNEL::NormalizedCellType> _types;
public:
static double EPS_FOR_POLYH_ORIENTATION;
-// Copyright (C) 2018 CEA/DEN, EDF R&D
+// Copyright (C) 2018-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
connRetWork=std::copy(conn+connIndex[*work],conn+connIndex[*work+1],connRetWork);
}
MCAuto<DataArrayInt> connRetArr=DataArrayInt::New();
- connRetArr->useArray(connRet,true,C_DEALLOC,connIndexRet[nbOfElemsRet],1);
+ connRetArr->useArray(connRet,true,DeallocType::C_DEALLOC,connIndexRet[nbOfElemsRet],1);
MCAuto<DataArrayInt> connIndexRetArr=DataArrayInt::New();
- connIndexRetArr->useArray(connIndexRet,true,C_DEALLOC,(int)nbOfElemsRet+1,1);
+ connIndexRetArr->useArray(connIndexRet,true,DeallocType::C_DEALLOC,(int)nbOfElemsRet+1,1);
ret->setConnectivity(connRetArr,connIndexRetArr,false);
ret->_types=types;
ret->copyTinyInfoFrom(this);
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
return ret;
}
- INTERP_KERNEL::Edge *MEDCouplingUMeshBuildQPFromEdge(INTERP_KERNEL::NormalizedCellType typ, std::map<int, std::pair<INTERP_KERNEL::Node *,bool> >& mapp2, const int *bg)
+ INTERP_KERNEL::Edge *MEDCouplingUMeshBuildQPFromEdge(INTERP_KERNEL::NormalizedCellType typ, std::map<int, INTERP_KERNEL::NodeWithUsage >& mapp2, const int *bg)
{
INTERP_KERNEL::Edge *ret=0;
+
+ mapp2[bg[0]].second = INTERP_KERNEL::USAGE_LINEAR;
+ mapp2[bg[1]].second = INTERP_KERNEL::USAGE_LINEAR;
+
switch(typ)
{
case INTERP_KERNEL::NORM_SEG2:
ret=new INTERP_KERNEL::EdgeLin(mapp2[bg[0]].first,mapp2[bg[1]].first);
else
ret=new INTERP_KERNEL::EdgeArcCircle(mapp2[bg[0]].first,mapp2[bg[2]].first,mapp2[bg[1]].first);
- mapp2[bg[2]].second=false;
+ if (mapp2[bg[2]].second != INTERP_KERNEL::USAGE_LINEAR) // switch the node usage to quadratic only if it is not used as an extreme point for another edge
+ mapp2[bg[2]].second = INTERP_KERNEL::USAGE_QUADRATIC_ONLY;
break;
}
default:
std::map<INTERP_KERNEL::Node *,int>& mapp)
{
mapp.clear();
- std::map<int, std::pair<INTERP_KERNEL::Node *,bool> > mapp2;//bool is for a flag specifying if node is boundary (true) or only a middle for SEG3.
+ std::map<int, INTERP_KERNEL::NodeWithUsage > mapp2; // the last var is a flag specifying if node is an extreme node of the seg (LINEAR) or only a middle for SEG3 (QUADRATIC_ONLY).
const double *coo=mDesc->getCoords()->getConstPointer();
const int *c=mDesc->getNodalConnectivity()->getConstPointer();
const int *cI=mDesc->getNodalConnectivityIndex()->getConstPointer();
for(std::set<int>::const_iterator it2=s.begin();it2!=s.end();it2++)
{
INTERP_KERNEL::Node *n=new INTERP_KERNEL::Node(coo[2*(*it2)],coo[2*(*it2)+1]);
- mapp2[*it2]=std::pair<INTERP_KERNEL::Node *,bool>(n,true);
+ mapp2[*it2]=INTERP_KERNEL::NodeWithUsage(n,INTERP_KERNEL::USAGE_UNKNOWN);
}
INTERP_KERNEL::QuadraticPolygon *ret=new INTERP_KERNEL::QuadraticPolygon;
for(std::vector<int>::const_iterator it=candidates.begin();it!=candidates.end();it++)
INTERP_KERNEL::NormalizedCellType typ=(INTERP_KERNEL::NormalizedCellType)c[cI[*it]];
ret->pushBack(MEDCouplingUMeshBuildQPFromEdge(typ,mapp2,c+cI[*it]+1));
}
- for(std::map<int, std::pair<INTERP_KERNEL::Node *,bool> >::const_iterator it2=mapp2.begin();it2!=mapp2.end();it2++)
+ for(std::map<int, INTERP_KERNEL::NodeWithUsage >::const_iterator it2=mapp2.begin();it2!=mapp2.end();it2++)
+ {
+ if((*it2).second.second == INTERP_KERNEL::USAGE_LINEAR)
+ mapp[(*it2).second.first]=(*it2).first;
+ ((*it2).second.first)->decrRef();
+ }
+ return ret;
+ }
+
+ INTERP_KERNEL::QuadraticPolygon *MEDCouplingUMeshBuildQPFromMeshWithTree(const MEDCouplingUMesh *mDesc, const std::vector<int>& candidates,
+ std::map<INTERP_KERNEL::Node *,int>& mapp,
+ const BBTreePts<2,int> & nodeTree,
+ const std::map<int, INTERP_KERNEL::Node *>& mapRev)
+ {
+ mapp.clear();
+ std::map<int, INTERP_KERNEL::NodeWithUsage > mapp2; // the last var is a flag specifying if node is an extreme node of the seg (LINEAR) or only a middle for SEG3 (QUADRATIC_ONLY).
+ const double *coo=mDesc->getCoords()->getConstPointer();
+ const int *c=mDesc->getNodalConnectivity()->getConstPointer();
+ const int *cI=mDesc->getNodalConnectivityIndex()->getConstPointer();
+ std::set<int> s;
+ for(std::vector<int>::const_iterator it=candidates.begin();it!=candidates.end();it++)
+ s.insert(c+cI[*it]+1,c+cI[(*it)+1]);
+ for(std::set<int>::const_iterator it2=s.begin();it2!=s.end();it2++)
+ {
+ INTERP_KERNEL::Node *n;
+ // Look for a potential node to merge
+ std::vector<int> candNode;
+ nodeTree.getElementsAroundPoint(coo+2*(*it2), candNode);
+ if (candNode.size() > 2)
+ throw INTERP_KERNEL::Exception("MEDCouplingUMesh::MEDCouplingUMeshBuildQPFromMeshWithTree(): some nodes are not properly merged (within eps) in input mesh!");
+ bool node_created=false;
+ if (candNode.size())
+ {
+ auto itt=mapRev.find(candNode[0]);
+ if (itt != mapRev.end()) // we might hit a node which is in the coords array but not used in the connectivity in which case it won't be in the revMap
+ {
+ node_created=true;
+ n = (*itt).second;
+ n->incrRef();
+ }
+ }
+ if(!node_created)
+ n = new INTERP_KERNEL::Node(coo[2*(*it2)],coo[2*(*it2)+1]);
+ mapp2[*it2]=INTERP_KERNEL::NodeWithUsage(n,INTERP_KERNEL::USAGE_UNKNOWN);
+ }
+ INTERP_KERNEL::QuadraticPolygon *ret=new INTERP_KERNEL::QuadraticPolygon;
+ for(std::vector<int>::const_iterator it=candidates.begin();it!=candidates.end();it++)
+ {
+ INTERP_KERNEL::NormalizedCellType typ=(INTERP_KERNEL::NormalizedCellType)c[cI[*it]];
+ ret->pushBack(MEDCouplingUMeshBuildQPFromEdge(typ,mapp2,c+cI[*it]+1)); // this call will set quad points to false in the map
+ }
+ for(std::map<int, INTERP_KERNEL::NodeWithUsage >::const_iterator it2=mapp2.begin();it2!=mapp2.end();it2++)
{
- if((*it2).second.second)
+ if((*it2).second.second == INTERP_KERNEL::USAGE_LINEAR)
mapp[(*it2).second.first]=(*it2).first;
((*it2).second.first)->decrRef();
}
{
const std::vector<int>& divs=subDiv[i];
int nnode=cI[1]-cI[0]-1;
- std::map<int, std::pair<INTERP_KERNEL::Node *,bool> > mapp2;
+ std::map<int, INTERP_KERNEL::NodeWithUsage > mapp2;
std::map<INTERP_KERNEL::Node *, int> mapp22;
for(int j=0;j<nnode;j++)
{
INTERP_KERNEL::Node *nn=new INTERP_KERNEL::Node(coo[2*c[(*cI)+j+1]],coo[2*c[(*cI)+j+1]+1]);
int nnid=c[(*cI)+j+1];
- mapp2[nnid]=std::pair<INTERP_KERNEL::Node *,bool>(nn,true);
+ mapp2[nnid]=INTERP_KERNEL::NodeWithUsage(nn,INTERP_KERNEL::USAGE_UNKNOWN);
mapp22[nn]=nnid+offset1;
}
INTERP_KERNEL::Edge *e=MEDCouplingUMeshBuildQPFromEdge((INTERP_KERNEL::NormalizedCellType)c[*cI],mapp2,c+(*cI)+1);
- for(std::map<int, std::pair<INTERP_KERNEL::Node *,bool> >::const_iterator it=mapp2.begin();it!=mapp2.end();it++)
+ for(std::map<int, INTERP_KERNEL::NodeWithUsage >::const_iterator it=mapp2.begin();it!=mapp2.end();it++)
((*it).second.first)->decrRef();
std::vector<INTERP_KERNEL::Node *> addNodes(divs.size());
std::map<INTERP_KERNEL::Node *,int> mapp3;
MCAuto<MEDCouplingUMesh> ret(MEDCouplingUMesh::New(mesh1D->getName(),1));
ret->setConnectivity(cOut,ciOut,true);
MCAuto<DataArrayDouble> arr3(DataArrayDouble::New());
- arr3->useArray(&addCoo[0],false,C_DEALLOC,(int)addCoo.size()/2,2);
- MCAuto<DataArrayDouble> arr4(DataArrayDouble::New()); arr4->useArray(&addCooQuad[0],false,C_DEALLOC,(int)addCooQuad.size()/2,2);
+ arr3->useArray(&addCoo[0],false,DeallocType::C_DEALLOC,(int)addCoo.size()/2,2);
+ MCAuto<DataArrayDouble> arr4(DataArrayDouble::New()); arr4->useArray(&addCooQuad[0],false,DeallocType::C_DEALLOC,(int)addCooQuad.size()/2,2);
std::vector<const DataArrayDouble *> coordss(4);
coordss[0]=coords1; coordss[1]=mesh1D->getCoords(); coordss[2]=arr3; coordss[3]=arr4;
MCAuto<DataArrayDouble> arr(DataArrayDouble::Aggregate(coordss));
int _iend;
MCAuto<MEDCouplingUMesh> _mesh;
MCAuto<INTERP_KERNEL::Edge> _edge;
- int _left;
- int _right;
+ int _left; // index (local numbering) of the left 2D cell bordering the edge '_edge'
+ int _right; // same as above, right side.
};
+/*
+ * Update indices of left and right 2D cell bordering the current edge.
+ */
void EdgeInfo::somethingHappendAt(int pos, const std::vector< MCAuto<INTERP_KERNEL::Edge> >& newLeft, const std::vector< MCAuto<INTERP_KERNEL::Edge> >& newRight)
{
const MEDCouplingUMesh *mesh(_mesh);
return ;
if(_left>pos)
{ _left++; _right++; return ; }
+ if (_right > pos && _left != pos)
+ { _right++; return ; }
if(_right==pos)
{
bool isLeft(std::find(newLeft.begin(),newLeft.end(),_edge)!=newLeft.end()),isRight(std::find(newRight.begin(),newRight.end(),_edge)!=newRight.end());
const CellInfo& get(int pos) const;
CellInfo& get(int pos);
private:
- std::vector<CellInfo> _pool;
- MCAuto<MEDCouplingUMesh> _ze_mesh;
- std::vector<EdgeInfo> _edge_info;
+ std::vector<CellInfo> _pool; // for a newly created 2D cell, the list of edges (int) and edges ptr constiuing it
+ MCAuto<MEDCouplingUMesh> _ze_mesh; // the aggregated mesh
+ std::vector<EdgeInfo> _edge_info; // for each new edge added when cuting the 2D cell, the information on left and right bordering 2D cell
};
VectorOfCellInfo::VectorOfCellInfo(const std::vector<int>& edges, const std::vector< MCAuto<INTERP_KERNEL::Edge> >& edgesPtr):_pool(1)
else
renumb->iota();
//
-
+ // The 1D first piece is used to intersect the 2D cell resulting in max two 2D cells.
+ // The next 1D piece is localised (getPositionOf()) into this previous cut.
+ // The result of the next intersection replaces the former single 2D cell that has been cut in the
+ // pool. The neighbourhood information detained by pool._edge_info is also updated so that left and right
+ // adjacent 2D cell of a 1D piece is kept up to date.
+ // And so on and so forth.
for(int iStart=0;iStart<nbCellsInSplitMesh1D;)
{// split [0:nbCellsInSplitMesh1D) in contiguous parts [iStart:iEnd)
int iEnd(iStart);
colinear2.resize(nDescCell2);
subDiv2.resize(nDescCell2);
BBTree<SPACEDIM,int> myTree(bbox2,0,0,m2Desc->getNumberOfCells(),-eps);
+ BBTreePts<SPACEDIM,int> treeNodes2(m2Desc->getCoords()->begin(),0,0,m2Desc->getCoords()->getNumberOfTuples(),eps);
std::vector<int> candidates1(1);
int offset1(m1Desc->getNumberOfNodes());
if(!candidates2.empty()) // candidates2 holds edges from the second mesh potentially intersecting current edge i in mesh1
{
std::map<INTERP_KERNEL::Node *,int> map1,map2;
+ std::map<int, INTERP_KERNEL::Node *> revMap2;
// pol2 is not necessarily a closed polygon: just a set of (quadratic) edges (same as candidates2) in the Geometric DS format
INTERP_KERNEL::QuadraticPolygon *pol2=MEDCouplingUMeshBuildQPFromMesh(m2Desc,candidates2,map2);
+ // Build revMap2
+ for (auto& kv : map2)
+ revMap2[kv.second] = kv.first;
candidates1[0]=i;
- INTERP_KERNEL::QuadraticPolygon *pol1=MEDCouplingUMeshBuildQPFromMesh(m1Desc,candidates1,map1);
+ // In the construction of pol1 we might reuse nodes from pol2, that we have identified as to be merged.
+ INTERP_KERNEL::QuadraticPolygon *pol1=MEDCouplingUMeshBuildQPFromMeshWithTree(m1Desc,candidates1,map1,treeNodes2, revMap2);
// This following part is to avoid that some removed nodes (for example due to a merge between pol1 and pol2) are replaced by a newly created one
// This trick guarantees that Node * are discriminant (i.e. form a unique identifier)
std::set<INTERP_KERNEL::Node *> nodes;
const INTERP_KERNEL::CellModel& cm=INTERP_KERNEL::CellModel::GetCellModel(typ);
// Populate mapp and mappRev with nodes from the current cell (i) from mesh1 - this also builds the Node* objects:
MEDCouplingUMeshBuildQPFromMesh3(coo1,offset1,coo2,offset2,addCoords,desc1+descIndx1[i],desc1+descIndx1[i+1],intesctEdges1,/* output */mapp,mappRev);
- // pol1 is the full cell from mesh2, in QP format, with all the additional intersecting nodes.
+ // pol1 is the full cell from mesh1, in QP format, with all the additional intersecting nodes.
pol1.buildFromCrudeDataArray(mappRev,cm.isQuadratic(),conn1+connI1[i]+1,coo1,
desc1+descIndx1[i],desc1+descIndx1[i+1],intesctEdges1);
//
std::map<int,std::vector<INTERP_KERNEL::ElementaryEdge *> > edgesIn2ForShare; // common edges
std::vector<INTERP_KERNEL::QuadraticPolygon> pol2s(candidates2.size());
int ii=0;
+ // Build, for each intersecting cell candidate from mesh2, the corresponding QP.
+ // Again all the additional intersecting nodes are there.
for(std::vector<int>::const_iterator it2=candidates2.begin();it2!=candidates2.end();it2++,ii++)
{
INTERP_KERNEL::NormalizedCellType typ2=(INTERP_KERNEL::NormalizedCellType)conn2[connI2[*it2]];
pol2s[ii].buildFromCrudeDataArray2(mappRev,cm2.isQuadratic(),conn2+connI2[*it2]+1,coo2,desc2+descIndx2[*it2],desc2+descIndx2[*it2+1],intesctEdges2,
pol1,desc1+descIndx1[i],desc1+descIndx1[i+1],intesctEdges1,colinear2, /* output */ edgesIn2ForShare);
}
+ // The cleaning below must be done after the full construction of all pol2s to correctly deal with shared edges:
+ for (auto &p: pol2s)
+ p.cleanDegeneratedConsecutiveEdges();
+ edgesIn2ForShare.clear(); // removing temptation to use it further since it might now contain invalid edges.
+ ///
ii=0;
+ // Now rebuild intersected cells from all this:
for(std::vector<int>::const_iterator it2=candidates2.begin();it2!=candidates2.end();it2++,ii++)
{
INTERP_KERNEL::ComposedEdge::InitLocationsWithOther(pol1,pol2s[ii]);
}
//
MCAuto<DataArrayDouble> addCooDa(DataArrayDouble::New());
- addCooDa->useArray(&addCoo[0],false,C_DEALLOC,(int)addCoo.size()/2,2);
+ addCooDa->useArray(&addCoo[0],false,DeallocType::C_DEALLOC,(int)addCoo.size()/2,2);
// Step 2: re-order newly created nodes according to the ordering found in m2
std::vector< std::vector<int> > intersectEdge2;
BuildIntersectEdges(m1Desc,mesh1D,addCoo,subDiv2,intersectEdge2);
if(!idsInDesc2DToBeRefined->empty())
{
DataArrayInt *out0(0),*outi0(0);
- MEDCouplingUMesh::ExtractFromIndexedArrays(idsInDesc2DToBeRefined->begin(),idsInDesc2DToBeRefined->end(),dd3,dd4,out0,outi0);
+ DataArrayInt::ExtractFromIndexedArrays(idsInDesc2DToBeRefined->begin(),idsInDesc2DToBeRefined->end(),dd3,dd4,out0,outi0);
MCAuto<DataArrayInt> outi0s(outi0);
out0s=out0;
out0s=out0s->buildUnique();
//
MCAuto<DataArrayInt> mSafe,nSafe,oSafe,pSafe,qSafe,rSafe;
DataArrayInt *m(0),*n(0),*o(0),*p(0),*q(0),*r(0);
- MEDCouplingUMesh::ExtractFromIndexedArrays(ret->begin(),ret->end(),desc1,descIndx1,m,n); mSafe=m; nSafe=n;
+ DataArrayInt::ExtractFromIndexedArrays(ret->begin(),ret->end(),desc1,descIndx1,m,n); mSafe=m; nSafe=n;
DataArrayInt::PutIntoToSkylineFrmt(intersectEdge,o,p); oSafe=o; pSafe=p;
if(middleNeedsToBeUsed)
{ DataArrayInt::PutIntoToSkylineFrmt(middle,q,r); qSafe=q; rSafe=r; }
-// Copyright (C) 2007-2017 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2017 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-# Copyright (C) 2012-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-# Copyright (C) 2015-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2015-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
const int tmp2[3]={8,9,10};
{
MemArray<int> mem;
- mem.useArray(tmp1,false,CPP_DEALLOC,6);
+ mem.useArray(tmp1,false,DeallocType::CPP_DEALLOC,6);
CPPUNIT_ASSERT(tmp1==mem.getConstPointer());
CPPUNIT_ASSERT_THROW(mem.getPointer(),INTERP_KERNEL::Exception);
CPPUNIT_ASSERT_THROW(mem[2]=7,INTERP_KERNEL::Exception);
int *tmp3=new int[6];
std::copy(tmp1,tmp1+6,tmp3);
MemArray<int> mem2;
- mem2.useArray(tmp3,true,CPP_DEALLOC,6);
+ mem2.useArray(tmp3,true,DeallocType::CPP_DEALLOC,6);
CPPUNIT_ASSERT(tmp3==mem2.getConstPointer());
CPPUNIT_ASSERT(tmp3==mem2.getPointer());
CPPUNIT_ASSERT_EQUAL(5,mem2[2]);
CPPUNIT_ASSERT_EQUAL(nbOfCells,(int)mesh->getNumberOfCells());
//test 0 - no copy no ownership
DataArrayDouble *myCoords=DataArrayDouble::New();
- myCoords->useArray(coords,false,CPP_DEALLOC,nbOfNodes,3);
+ myCoords->useArray(coords,false,DeallocType::CPP_DEALLOC,nbOfNodes,3);
mesh->setCoords(myCoords);
mesh->setCoords(myCoords);
myCoords->decrRef();
myCoords=DataArrayDouble::New();
double *tmp=new double[3*nbOfNodes];
std::copy(coords,coords+3*nbOfNodes,tmp);
- myCoords->useArray(tmp,true,CPP_DEALLOC,nbOfNodes,3);
+ myCoords->useArray(tmp,true,DeallocType::CPP_DEALLOC,nbOfNodes,3);
mesh->setCoords(myCoords);
myCoords->decrRef();
CPPUNIT_ASSERT_EQUAL(nbOfCells,(int)mesh->getNumberOfCells());
myCoords=DataArrayDouble::New();
tmp=(double *)malloc(3*nbOfNodes*sizeof(double));
std::copy(coords,coords+3*nbOfNodes,tmp);
- myCoords->useArray(tmp,true,C_DEALLOC,nbOfNodes,3);
+ myCoords->useArray(tmp,true,DeallocType::C_DEALLOC,nbOfNodes,3);
mesh->setCoords(myCoords);
myCoords->decrRef();
CPPUNIT_ASSERT_EQUAL(nbOfNodes,mesh->getNumberOfNodes());
MEDCouplingFieldDouble *f3=MEDCouplingFieldDouble::MergeFields(f1,f2);
f3->checkConsistencyLight();
MEDCouplingUMesh *m4=build2DTargetMeshMerged_1();
+ m4->setName(f1->getMesh()->getName());
CPPUNIT_ASSERT(f3->getMesh()->isEqual(m4,1.e-12));
std::string name=f3->getName();
CPPUNIT_ASSERT(name=="MeasureOfMesh_");
CPPUNIT_ASSERT_DOUBLES_EQUAL(3.6,values4[0],1.e-12);
CPPUNIT_ASSERT_DOUBLES_EQUAL(7.2,values4[1],1.e-12);
f1->integral(true,values4);
- CPPUNIT_ASSERT_DOUBLES_EQUAL(0.5,values4[0],1.e-12);
- CPPUNIT_ASSERT_DOUBLES_EQUAL(1.,values4[1],1.e-12);
+ //0.4 == 0.25/4*-0.6+(0.25/4+0.125/3)*-0.1+0.4*(0.125/3.+0.125/3)+(-0.1)*(0.25/4+0.25/4)+0.4*(0.25/4+0.125/3+0.125/3+0.25/4+0.25/4)+0.9*(0.25/4+0.125/3)+0.4*0.25/4+0.9*(0.25/4+0.25/4)+1.4*0.25/4
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(0.4,values4[0],1.e-12);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(0.8,values4[1],1.e-12);
f1->decrRef();
//
CPPUNIT_ASSERT_THROW(f1=m->fillFromAnalytic(ON_NODES,1,func3),INTERP_KERNEL::Exception);
CPPUNIT_ASSERT_DOUBLES_EQUAL(3.6,values4[0],1.e-12);
CPPUNIT_ASSERT_DOUBLES_EQUAL(7.2,values4[1],1.e-12);
f1->integral(true,values4);
- CPPUNIT_ASSERT_DOUBLES_EQUAL(0.5,values4[0],1.e-12);
- CPPUNIT_ASSERT_DOUBLES_EQUAL(1.,values4[1],1.e-12);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(0.4,values4[0],1.e-12);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(0.8,values4[1],1.e-12);
f1->decrRef();
//
CPPUNIT_ASSERT_THROW(f1=m->fillFromAnalytic(ON_NODES,1,"1./(x-0.2)"),INTERP_KERNEL::Exception);
DataArrayDouble* coordsX=DataArrayDouble::New();
double arrX[4] = { -1., 1., 2., 4. };
- coordsX->useArray(arrX,false, CPP_DEALLOC,4,1);
+ coordsX->useArray(arrX,false, DeallocType::CPP_DEALLOC,4,1);
DataArrayDouble* coordsY=DataArrayDouble::New();
double arrY[4] = { -2., 2., 4., 8. };
- coordsY->useArray(arrY,false, CPP_DEALLOC,4,1);
+ coordsY->useArray(arrY,false, DeallocType::CPP_DEALLOC,4,1);
DataArrayDouble* coordsZ=DataArrayDouble::New();
double arrZ[4] = { -3., 3., 6., 12. };
- coordsZ->useArray(arrZ,false, CPP_DEALLOC,4,1);
+ coordsZ->useArray(arrZ,false, DeallocType::CPP_DEALLOC,4,1);
mesh->setCoords(coordsX,coordsY,coordsZ);
coordsX->decrRef();
coordsY->decrRef();
mesh1=MEDCouplingCMesh::New();
DataArrayDouble* coordsX1=DataArrayDouble::New();
double arrX1[4] = { -1., 1., 2., 4. };
- coordsX1->useArray(arrX1,false, CPP_DEALLOC,4,1);
+ coordsX1->useArray(arrX1,false, DeallocType::CPP_DEALLOC,4,1);
DataArrayDouble* coordsY1=DataArrayDouble::New();
double arrY1[4] = { -2., 2., 4., 8. };
- coordsY1->useArray(arrY1,false, CPP_DEALLOC,4,1);
+ coordsY1->useArray(arrY1,false, DeallocType::CPP_DEALLOC,4,1);
DataArrayDouble* coordsZ1=DataArrayDouble::New();
double arrZ1[4] = { -3., 3., 6., 12. };
- coordsZ1->useArray(arrZ1,false, CPP_DEALLOC,4,1);
+ coordsZ1->useArray(arrZ1,false, DeallocType::CPP_DEALLOC,4,1);
mesh1->setCoords(coordsX1,coordsY1,coordsZ1);
mesh2=MEDCouplingCMesh::New();
DataArrayDouble* coordsX2=DataArrayDouble::New();
double arrX2[4] = { -1., 1., 2., 4. };
- coordsX2->useArray(arrX2,false, CPP_DEALLOC,4,1);
+ coordsX2->useArray(arrX2,false, DeallocType::CPP_DEALLOC,4,1);
DataArrayDouble* coordsY2=DataArrayDouble::New();
double arrY2[4] = { -2., 2., 4., 8. };
- coordsY2->useArray(arrY2,false, CPP_DEALLOC,4,1);
+ coordsY2->useArray(arrY2,false, DeallocType::CPP_DEALLOC,4,1);
DataArrayDouble* coordsZ2=DataArrayDouble::New();
double arrZ2[4] = { -3., 3., 6., 12.+1e-6 }; //here is not equal
- coordsZ2->useArray(arrZ2,false, CPP_DEALLOC,4,1);
+ coordsZ2->useArray(arrZ2,false, DeallocType::CPP_DEALLOC,4,1);
mesh2->setCoords(coordsX2,coordsY2,coordsZ2);
mesh3=MEDCouplingCMesh::New();
DataArrayDouble* coordsX3=DataArrayDouble::New();
double arrX3[1] = { -1.};
- coordsX3->useArray(arrX3,false, CPP_DEALLOC,1,1);
+ coordsX3->useArray(arrX3,false, DeallocType::CPP_DEALLOC,1,1);
DataArrayDouble* coordsY3=DataArrayDouble::New();
double arrY3[1] = { -2.};
- coordsY3->useArray(arrY3,false, CPP_DEALLOC,1,1);
+ coordsY3->useArray(arrY3,false, DeallocType::CPP_DEALLOC,1,1);
DataArrayDouble* coordsZ3=DataArrayDouble::New();
double arrZ3[1] = { -3.};
- coordsZ3->useArray(arrZ3,false, CPP_DEALLOC,1,1);
+ coordsZ3->useArray(arrZ3,false, DeallocType::CPP_DEALLOC,1,1);
mesh3->setCoords(coordsX3,coordsY3,coordsZ3);
CPPUNIT_ASSERT_EQUAL(3,mesh1->getSpaceDimension());
mesh1=MEDCouplingCMesh::New();
DataArrayDouble* coordsX1=DataArrayDouble::New();
double arrX1[4] = { -1., 1., 2., 4. };
- coordsX1->useArray(arrX1,false, CPP_DEALLOC,4,1);
+ coordsX1->useArray(arrX1,false, DeallocType::CPP_DEALLOC,4,1);
DataArrayDouble* coordsY1=DataArrayDouble::New();
double arrY1[4] = { -2., 2., 4., 8. };
- coordsY1->useArray(arrY1,false, CPP_DEALLOC,4,1);
+ coordsY1->useArray(arrY1,false, DeallocType::CPP_DEALLOC,4,1);
DataArrayDouble* coordsZ1=DataArrayDouble::New();
double arrZ1[4] = { -3., 3., 6., 12. };
- coordsZ1->useArray(arrZ1,false, CPP_DEALLOC,4,1);
+ coordsZ1->useArray(arrZ1,false, DeallocType::CPP_DEALLOC,4,1);
mesh1->setCoords(coordsX1,coordsY1,coordsZ1);
std::vector<int> dis=mesh1->getDistributionOfTypes();
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
CPPUNIT_ASSERT_DOUBLES_EQUAL(3.6,values4[0],1.e-12);
CPPUNIT_ASSERT_DOUBLES_EQUAL(7.2,values4[1],1.e-12);
f1->integral(true,values4);
- CPPUNIT_ASSERT_DOUBLES_EQUAL(0.5,values4[0],1.e-12);
- CPPUNIT_ASSERT_DOUBLES_EQUAL(1.,values4[1],1.e-12);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(0.4,values4[0],1.e-12);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(0.8,values4[1],1.e-12);
f1->decrRef();
//
f1=MEDCouplingFieldDouble::New(ON_NODES,NO_TIME);
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
MEDCouplingCMesh* mesh=MEDCouplingCMesh::New();
DataArrayDouble* coordsX=DataArrayDouble::New();
double arrX[4] = { -1., 1., 2., 4. };
- coordsX->useArray(arrX,false, CPP_DEALLOC,4,1);
+ coordsX->useArray(arrX,false, DeallocType::CPP_DEALLOC,4,1);
DataArrayDouble* coordsY=DataArrayDouble::New();
double arrY[4] = { -2., 2., 4., 8. };
- coordsY->useArray(arrY,false, CPP_DEALLOC,4,1);
+ coordsY->useArray(arrY,false, DeallocType::CPP_DEALLOC,4,1);
DataArrayDouble* coordsZ=DataArrayDouble::New();
double arrZ[4] = { -3., 3., 6., 12. };
- coordsZ->useArray(arrZ,false, CPP_DEALLOC,4,1);
+ coordsZ->useArray(arrZ,false, DeallocType::CPP_DEALLOC,4,1);
mesh->setCoords(coordsX,coordsY,coordsZ);
coordsX->decrRef();
coordsY->decrRef();
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
MEDCouplingCMesh *m1c=MEDCouplingCMesh::New();
DataArrayDouble *coordsX=DataArrayDouble::New();
double arrX[5] = { -1., 1., 2., 4., 4.5 };
- coordsX->useArray(arrX,false, CPP_DEALLOC,5,1);
+ coordsX->useArray(arrX,false, DeallocType::CPP_DEALLOC,5,1);
DataArrayDouble *coordsY=DataArrayDouble::New();
double arrY[4] = { -2., 2., 4., 8. };
- coordsY->useArray(arrY,false, CPP_DEALLOC,4,1);
+ coordsY->useArray(arrY,false, DeallocType::CPP_DEALLOC,4,1);
DataArrayDouble *coordsZ=DataArrayDouble::New();
double arrZ[3] = { -2., 2., 4. };
- coordsZ->useArray(arrZ,false, CPP_DEALLOC,3,1);
+ coordsZ->useArray(arrZ,false, DeallocType::CPP_DEALLOC,3,1);
// test in 1D
m1c->setCoordsAt(0,coordsX);
CPPUNIT_ASSERT_EQUAL(4,(int)m1c->getNumberOfCells());
DataArrayInt *cI=m->computeNbOfNodesPerCell();
cI->computeOffsetsFull();
const int sel1[3]={1,5,9};
- DataArrayInt *sel=DataArrayInt::New(); sel->useArray(sel1,false,CPP_DEALLOC,3,1);
+ DataArrayInt *sel=DataArrayInt::New(); sel->useArray(sel1,false,DeallocType::CPP_DEALLOC,3,1);
DataArrayInt *res=sel->buildExplicitArrByRanges(cI);
DataArrayDouble *arr2=arr->selectByTupleIdSafe(res->begin(),res->end());
const double expected1[30]={13.,14.,15.,16.,17.,18.,19.,20.,59.,60.,61.,62.,63.,64.,95.,96.,97.,98.,99.,100.,101.,102.,103.,104.,105.,106.,107.,108.,109.,110.};
- DataArrayDouble *arr3=DataArrayDouble::New(); arr3->useArray(expected1,false,CPP_DEALLOC,15,2);
+ DataArrayDouble *arr3=DataArrayDouble::New(); arr3->useArray(expected1,false,DeallocType::CPP_DEALLOC,15,2);
CPPUNIT_ASSERT(arr2->isEqual(*arr3,1e-12));
CPPUNIT_ASSERT(arr2->isEqual(*f2->getArray(),1e-12));
//
void MEDCouplingBasicsTest5::testDuplicateEachTupleNTimes1()
{
const double vals0[4]={9.,8.,7.,6.};
- DataArrayDouble *d=DataArrayDouble::New(); d->useArray(vals0,false,CPP_DEALLOC,4,1); d->setInfoOnComponent(0,"mass [kg]"); d->setName("aname");
+ DataArrayDouble *d=DataArrayDouble::New(); d->useArray(vals0,false,DeallocType::CPP_DEALLOC,4,1); d->setInfoOnComponent(0,"mass [kg]"); d->setName("aname");
DataArrayDouble *d2=d->duplicateEachTupleNTimes(3);
const double vals1[12]={9.,9.,9.,8.,8.,8.,7.,7.,7.,6.,6.,6.};
- DataArrayDouble *d3=DataArrayDouble::New(); d3->useArray(vals1,false,CPP_DEALLOC,4*3,1); d3->setName("aname"); d3->setInfoOnComponent(0,"mass [kg]");
+ DataArrayDouble *d3=DataArrayDouble::New(); d3->useArray(vals1,false,DeallocType::CPP_DEALLOC,4*3,1); d3->setName("aname"); d3->setInfoOnComponent(0,"mass [kg]");
CPPUNIT_ASSERT(d2->isEqual(*d2,1e-14)); d3->decrRef();
d->decrRef();
d2->decrRef();
//
const int vals2[4]={9,8,7,6};
- DataArrayInt *d4=DataArrayInt::New(); d4->useArray(vals2,false,CPP_DEALLOC,4,1); d4->setInfoOnComponent(0,"mass [kg]") ; d4->setName("aname");
+ DataArrayInt *d4=DataArrayInt::New(); d4->useArray(vals2,false,DeallocType::CPP_DEALLOC,4,1); d4->setInfoOnComponent(0,"mass [kg]") ; d4->setName("aname");
DataArrayInt *d5=d4->duplicateEachTupleNTimes(3);
const int vals3[12]={9,9,9,8,8,8,7,7,7,6,6,6};
- DataArrayInt *d6=DataArrayInt::New(); d6->useArray(vals3,false,CPP_DEALLOC,4*3,1); d6->setName("aname"); d6->setInfoOnComponent(0,"mass [kg]");
+ DataArrayInt *d6=DataArrayInt::New(); d6->useArray(vals3,false,DeallocType::CPP_DEALLOC,4*3,1); d6->setName("aname"); d6->setInfoOnComponent(0,"mass [kg]");
CPPUNIT_ASSERT(d5->isEqual(*d6)); d6->decrRef();
d4->decrRef();
d5->decrRef();
// coordinates
DataArrayDouble *coords=DataArrayDouble::New();
const double coordsData[376]={41,0,42,0,0,42,0,41,41.5,0,29.698484809834998,29.698484809834994,0,41.5,28.991378028648452,28.991378028648445,-42,0,-41,0,-29.698484809834994,29.698484809834998,-41.5,0,-28.991378028648445,28.991378028648452,0,-42,0,-41,-29.698484809835001,-29.698484809834994,0,-41.5,-28.991378028648455,-28.991378028648445,29.698484809834987,-29.698484809835001,28.991378028648441,-28.991378028648455,43,0,0,43,42.5,0,30.405591591021544,30.40559159102154,0,42.5,-43,0,-30.40559159102154,30.405591591021544,-42.5,0,0,-43,-30.405591591021551,-30.40559159102154,0,-42.5,30.405591591021537,-30.405591591021551,44,0,0,44,43.5,0,31.112698372208094,31.112698372208087,0,43.5,-44,0,-31.112698372208087,31.112698372208094,-43.5,0,0,-44,-31.112698372208097,-31.112698372208087,0,-43.5,31.112698372208083,-31.112698372208097,45,0,0,45,44.5,0,31.81980515339464,31.819805153394636,0,44.5,-45,0,-31.819805153394636,31.81980515339464,-44.5,0,0,-45,-31.819805153394647,-31.819805153394636,0,-44.5,31.819805153394629,-31.819805153394647,47,0,0,47,46,0,33.234018715767739,33.234018715767732,0,46,-47,0,-33.234018715767732,33.234018715767739,-46,0,0,-47,-33.234018715767739,-33.234018715767732,0,-46,33.234018715767725,-33.234018715767739,49,0,0,49,48,0,34.648232278140831,34.648232278140824,0,48,-49,0,-34.648232278140824,34.648232278140831,-48,0,0,-49,-34.648232278140839,-34.648232278140824,0,-48,34.648232278140817,-34.648232278140839,51,0,0,51,50,0,36.062445840513924,36.062445840513924,0,50,-51,0,-36.062445840513924,36.062445840513924,-50,0,0,-51,-36.062445840513931,-36.062445840513924,0,-50,36.062445840513917,-36.062445840513931,53,0,0,53,52,0,37.476659402887023,37.476659402887016,0,52,-53,0,-37.476659402887016,37.476659402887023,-52,0,0,-53,-37.47665940288703,-37.476659402887016,0,-52,37.476659402887009,-37.47665940288703,55,0,0,55,54,0,38.890872965260115,38.890872965260108,0,54,-55,0,-38.890872965260108,38.890872965260115,-54,0,0,-55,-38.890872965260122,-38.890872965260108,0,-54,38.890872965260101,-38.890872965260122,59,0,0,59,57,0,41.719300090006307,41.7193000900063,0,57,-59,0,-41.7193000900063,41.719300090006307,-57,0,0,-59,-41.719300090006314,-41.7193000900063,0,-57,41.719300090006293,-41.719300090006314,63,0,0,63,61,0,44.547727214752499,44.547727214752491,0,61,-63,0,-44.547727214752491,44.547727214752499,-61,0,0,-63,-44.547727214752506,-44.547727214752491,0,-61,44.547727214752484,-44.547727214752506,67,0,0,67,65,0,47.37615433949869,47.376154339498683,0,65,-67,0,-47.376154339498683,47.37615433949869,-65,0,0,-67,-47.376154339498697,-47.376154339498683,0,-65,47.376154339498676,-47.376154339498697,71,0,0,71,69,0,50.204581464244875,50.204581464244868,0,69,-71,0,-50.204581464244868,50.204581464244875,-69,0,0,-71,-50.204581464244889,-50.204581464244868,0,-69,50.20458146424486,-50.204581464244889,75,0,0,75,73,0,53.033008588991066,53.033008588991059,0,73,-75,0,-53.033008588991059,53.033008588991066,-73,0,0,-75,-53.033008588991073,-53.033008588991059,0,-73,53.033008588991052,-53.033008588991073,80,0,0,80,77.5,0,56.568542494923804,56.568542494923797,0,77.5,-80,0,-56.568542494923797,56.568542494923804,-77.5,0,0,-80,-56.568542494923818,-56.568542494923797,0,-77.5,56.56854249492379,-56.568542494923818};
- coords->useArray(coordsData,false,CPP_DEALLOC,188,2);
+ coords->useArray(coordsData,false,DeallocType::CPP_DEALLOC,188,2);
coords->setName("");
DataArrayInt *conn=DataArrayInt::New();
const int connData[540]={8,0,1,2,3,4,5,6,7,8,3,2,8,9,6,10,11,12,8,9,8,13,14,11,15,16,17,8,14,13,1,0,16,18,4,19,8,1,20,21,2,22,23,24,5,8,2,21,25,8,24,26,27,10,8,8,25,28,13,27,29,30,15,8,13,28,20,1,30,31,22,18,8,20,32,33,21,34,35,36,23,8,21,33,37,25,36,38,39,26,8,25,37,40,28,39,41,42,29,8,28,40,32,20,42,43,34,31,8,32,44,45,33,46,47,48,35,8,33,45,49,37,48,50,51,38,8,37,49,52,40,51,53,54,41,8,40,52,44,32,54,55,46,43,8,44,56,57,45,58,59,60,47,8,45,57,61,49,60,62,63,50,8,49,61,64,52,63,65,66,53,8,52,64,56,44,66,67,58,55,8,56,68,69,57,70,71,72,59,8,57,69,73,61,72,74,75,62,8,61,73,76,64,75,77,78,65,8,64,76,68,56,78,79,70,67,8,68,80,81,69,82,83,84,71,8,69,81,85,73,84,86,87,74,8,73,85,88,76,87,89,90,77,8,76,88,80,68,90,91,82,79,8,80,92,93,81,94,95,96,83,8,81,93,97,85,96,98,99,86,8,85,97,100,88,99,101,102,89,8,88,100,92,80,102,103,94,91,8,92,104,105,93,106,107,108,95,8,93,105,109,97,108,110,111,98,8,97,109,112,100,111,113,114,101,8,100,112,104,92,114,115,106,103,8,104,116,117,105,118,119,120,107,8,105,117,121,109,120,122,123,110,8,109,121,124,112,123,125,126,113,8,112,124,116,104,126,127,118,115,8,116,128,129,117,130,131,132,119,8,117,129,133,121,132,134,135,122,8,121,133,136,124,135,137,138,125,8,124,136,128,116,138,139,130,127,8,128,140,141,129,142,143,144,131,8,129,141,145,133,144,146,147,134,8,133,145,148,136,147,149,150,137,8,136,148,140,128,150,151,142,139,8,140,152,153,141,154,155,156,143,8,141,153,157,145,156,158,159,146,8,145,157,160,148,159,161,162,149,8,148,160,152,140,162,163,154,151,8,152,164,165,153,166,167,168,155,8,153,165,169,157,168,170,171,158,8,157,169,172,160,171,173,174,161,8,160,172,164,152,174,175,166,163,8,164,176,177,165,178,179,180,167,8,165,177,181,169,180,182,183,170,8,169,181,184,172,183,185,186,173,8,172,184,176,164,186,187,178,175};
- conn->useArray(connData,false,CPP_DEALLOC,540,1);
+ conn->useArray(connData,false,DeallocType::CPP_DEALLOC,540,1);
conn->setName("");
DataArrayInt *connI=DataArrayInt::New();
const int connIData[61]={0,9,18,27,36,45,54,63,72,81,90,99,108,117,126,135,144,153,162,171,180,189,198,207,216,225,234,243,252,261,270,279,288,297,306,315,324,333,342,351,360,369,378,387,396,405,414,423,432,441,450,459,468,477,486,495,504,513,522,531,540};
- connI->useArray(connIData,false,CPP_DEALLOC,61,1);
+ connI->useArray(connIData,false,DeallocType::CPP_DEALLOC,61,1);
connI->setName("");
//
MEDCouplingUMesh *m1=MEDCouplingUMesh::New("Fix",2);
//
coords=DataArrayDouble::New();
const double coordsData2[84]={46.5,-2.5,53.5,-2.5,53.5,2.5,46.5,2.5,50,-2.5,53.5,0,50,2.5,46.5,0,60.5,-2.5,60.5,2.5,57,-2.5,60.5,0,57,2.5,53.5,7.5,46.5,7.5,53.5,5,50,7.5,46.5,5,60.5,7.5,60.5,5,57,7.5,-2,47,2,47,2,53,-2,53,0,47,2,50,0,53,-2,50,6,47,6,53,4,47,6,50,4,53,2,59,-2,59,2,56,0,59,-2,56,6,59,6,56,4,59};
- coords->useArray(coordsData2,false,CPP_DEALLOC,42,2);
+ coords->useArray(coordsData2,false,DeallocType::CPP_DEALLOC,42,2);
coords->setName("");
// connectivity
conn=DataArrayInt::New();
const int connData2[72]={8,0,1,2,3,4,5,6,7,8,1,8,9,2,10,11,12,5,8,3,2,13,14,6,15,16,17,8,2,9,18,13,12,19,20,15,8,21,22,23,24,25,26,27,28,8,22,29,30,23,31,32,33,26,8,24,23,34,35,27,36,37,38,8,23,30,39,34,33,40,41,36};
- conn->useArray(connData2,false,CPP_DEALLOC,72,1);
+ conn->useArray(connData2,false,DeallocType::CPP_DEALLOC,72,1);
conn->setName("");
connI=DataArrayInt::New();
const int connIData2[9]={0,9,18,27,36,45,54,63,72};
- connI->useArray(connIData2,false,CPP_DEALLOC,9,1);
+ connI->useArray(connIData2,false,DeallocType::CPP_DEALLOC,9,1);
connI->setName("");
MEDCouplingUMesh *m2=MEDCouplingUMesh::New("Mobile",2);
m2->setCoords(coords);
{
DataArrayInt *d=DataArrayInt::New();
const int dData[14]={1,2,2,3,3,3,3,4,5,5,7,7,7,19};
- d->useArray(dData,false,CPP_DEALLOC,14,1);
+ d->useArray(dData,false,DeallocType::CPP_DEALLOC,14,1);
const int expectedData[7]={1,2,3,4,5,7,19};
//
DataArrayInt *e=d->buildUnique();
const int expected2_2[2]={0,2};
const int expected2_3[4]={3,5,6,8};
DataArrayInt *d=DataArrayInt::New();
- d->useArray(data,false,CPP_DEALLOC,9,1);
+ d->useArray(data,false,DeallocType::CPP_DEALLOC,9,1);
std::vector<int> f;
static const int nbOfOutputsExpected=4;
std::vector<DataArrayInt *> e=d->partitionByDifferentValues(f);
const int data3[6]={-1,0,3,2,4,6};
const int data4[6]={7,5,2,3,0,-6};
DataArrayInt *d=DataArrayInt::New();
- d->useArray(data1,false,CPP_DEALLOC,6,1);
+ d->useArray(data1,false,DeallocType::CPP_DEALLOC,6,1);
CPPUNIT_ASSERT(d->isMonotonic(true));
CPPUNIT_ASSERT(!d->isMonotonic(false));
d->checkMonotonic(true);
CPPUNIT_ASSERT_THROW(d->checkMonotonic(false),INTERP_KERNEL::Exception);
- d->useArray(data2,false,CPP_DEALLOC,6,1);
+ d->useArray(data2,false,DeallocType::CPP_DEALLOC,6,1);
CPPUNIT_ASSERT(d->isMonotonic(false));
CPPUNIT_ASSERT(!d->isMonotonic(true));
d->checkMonotonic(false);
CPPUNIT_ASSERT_THROW(d->checkMonotonic(true),INTERP_KERNEL::Exception);
- d->useArray(data3,false,CPP_DEALLOC,6,1);
+ d->useArray(data3,false,DeallocType::CPP_DEALLOC,6,1);
CPPUNIT_ASSERT(!d->isMonotonic(false));
CPPUNIT_ASSERT(!d->isMonotonic(true));
CPPUNIT_ASSERT_THROW(d->checkMonotonic(true),INTERP_KERNEL::Exception);
CPPUNIT_ASSERT_THROW(d->checkMonotonic(false),INTERP_KERNEL::Exception);
- d->useArray(data4,false,CPP_DEALLOC,6,1);
+ d->useArray(data4,false,DeallocType::CPP_DEALLOC,6,1);
CPPUNIT_ASSERT(!d->isMonotonic(false));
CPPUNIT_ASSERT(!d->isMonotonic(true));
CPPUNIT_ASSERT_THROW(d->checkMonotonic(true),INTERP_KERNEL::Exception);
CPPUNIT_ASSERT_THROW(d->checkMonotonic(false),INTERP_KERNEL::Exception);
- d->useArray(data4,false,CPP_DEALLOC,0,1);
+ d->useArray(data4,false,DeallocType::CPP_DEALLOC,0,1);
CPPUNIT_ASSERT(d->isMonotonic(true));
CPPUNIT_ASSERT(d->isMonotonic(false));
d->checkMonotonic(true);
d->checkMonotonic(false);
- d->useArray(data4,false,CPP_DEALLOC,3,2);//throw because nbComp!=1
+ d->useArray(data4,false,DeallocType::CPP_DEALLOC,3,2);//throw because nbComp!=1
CPPUNIT_ASSERT_THROW(d->isMonotonic(true),INTERP_KERNEL::Exception);
CPPUNIT_ASSERT_THROW(d->isMonotonic(false),INTERP_KERNEL::Exception);
CPPUNIT_ASSERT_THROW(d->checkMonotonic(true),INTERP_KERNEL::Exception);
// coordinates
DataArrayDouble *coords=DataArrayDouble::New();
const double coordsData[16]={2.7554552980815448e-15,45,-45,5.5109105961630896e-15,-31.819805153394636,31.81980515339464,2.8779199779962799e-15,47,2.8166876380389124e-15,46,-47,5.7558399559925599e-15,-33.234018715767732,33.234018715767739,-46,5.6333752760778247e-15};
- coords->useArray(coordsData,false,CPP_DEALLOC,8,2);
+ coords->useArray(coordsData,false,DeallocType::CPP_DEALLOC,8,2);
// connectivity
DataArrayInt *conn=DataArrayInt::New();
const int connData[9]={8,0,3,5,1,4,6,7,2};
- conn->useArray(connData,false,CPP_DEALLOC,9,1);
+ conn->useArray(connData,false,DeallocType::CPP_DEALLOC,9,1);
DataArrayInt *connI=DataArrayInt::New();
const int connIData[2]={0,9};
- connI->useArray(connIData,false,CPP_DEALLOC,2,1);
+ connI->useArray(connIData,false,DeallocType::CPP_DEALLOC,2,1);
MEDCouplingUMesh *m1=MEDCouplingUMesh::New("Fixe",2);
m1->setCoords(coords);
m1->setConnectivity(conn,connI,true);
//
coords=DataArrayDouble::New();
const double coordsData2[26]={-7.3800475508445391,41.854329503018846,-3.7041190667754655,42.338274668899189,-3.7041190667754655,45.338274668899189,-7.3800475508445382,44.854329503018839,-5.5473631693521845,42.136406608386956,-3.7041190667754655,43.838274668899189,-5.5420833088100014,45.09630208595901,-7.3800475508445382,43.354329503018839,-3.7041190667754651,52.338274668899189,-7.3800475508445382,51.854329503018839,-3.7041190667754655,48.838274668899189,-5.5420833088100014,52.09630208595901,-7.3800475508445382,48.354329503018839};
- coords->useArray(coordsData2,false,CPP_DEALLOC,13,2);
+ coords->useArray(coordsData2,false,DeallocType::CPP_DEALLOC,13,2);
// connectivity
conn=DataArrayInt::New();
const int connData2[18]={8,0,1,2,3,4,5,6,7,8,3,2,8,9,6,10,11,12};
- conn->useArray(connData2,false,CPP_DEALLOC,18,1);
+ conn->useArray(connData2,false,DeallocType::CPP_DEALLOC,18,1);
connI=DataArrayInt::New();
const int connIData2[3]={0,9,18};
- connI->useArray(connIData2,false,CPP_DEALLOC,3,1);
+ connI->useArray(connIData2,false,DeallocType::CPP_DEALLOC,3,1);
//
MEDCouplingUMesh *m2=MEDCouplingUMesh::New("Mobile",2);
m2->setCoords(coords);
// coordinates circle - SEE getCircle() on the Python side
DataArrayDouble *coords1=DataArrayDouble::New();
const double coordsData1[16]={0.5328427124746189, -0.08284271247461905, -0.03284271247461901, 0.4828427124746191, -0.03284271247461906, -0.082842712474619, 0.5328427124746191, 0.482842712474619};
- coords1->useArray(coordsData1,false,CPP_DEALLOC,8,2);
+ coords1->useArray(coordsData1,false,DeallocType::CPP_DEALLOC,8,2);
// connectivity
DataArrayInt *conn1=DataArrayInt::New();
const int connData1[5]={INTERP_KERNEL::NORM_QPOLYG,0,1,2,3};
- conn1->useArray(connData1,false,CPP_DEALLOC,5,1);
+ conn1->useArray(connData1,false,DeallocType::CPP_DEALLOC,5,1);
DataArrayInt *connI1=DataArrayInt::New();
const int connIData1[2]={0,5};
- connI1->useArray(connIData1,false,CPP_DEALLOC,2,1);
+ connI1->useArray(connIData1,false,DeallocType::CPP_DEALLOC,2,1);
MEDCouplingUMesh *m1=MEDCouplingUMesh::New("circle",2);
m1->setCoords(coords1);
m1->setConnectivity(conn1,connI1,true);
// square
DataArrayDouble *coords2=DataArrayDouble::New();
const double coordsData2[8]={-0.5,-0.5, -0.5, 0.5, 0.5, 0.5, 0.5,-0.5};
- coords2->useArray(coordsData2,false,CPP_DEALLOC,4,2);
+ coords2->useArray(coordsData2,false,DeallocType::CPP_DEALLOC,4,2);
// connectivity
DataArrayInt *conn2=DataArrayInt::New();
const int connData2[5]={INTERP_KERNEL::NORM_POLYGON, 0,1,2,3};
- conn2->useArray(connData2,false,CPP_DEALLOC,5,1);
+ conn2->useArray(connData2,false,DeallocType::CPP_DEALLOC,5,1);
DataArrayInt *connI2=DataArrayInt::New();
const int connIData2[2]={0,5};
- connI2->useArray(connIData2,false,CPP_DEALLOC,2,1);
+ connI2->useArray(connIData2,false,DeallocType::CPP_DEALLOC,2,1);
MEDCouplingUMesh *m2=MEDCouplingUMesh::New("square",2);
m2->setCoords(coords2);
m2->setConnectivity(conn2,connI2,true);
const int tab1[7]={1,3,5,6,7,9,13};
const int tab2[3]={3,5,9};
const int tab3[3]={1,3,5};
- DataArrayInt *da1=DataArrayInt::New(); da1->useArray(tab1,false,CPP_DEALLOC,7,1);
- DataArrayInt *da2=DataArrayInt::New(); da2->useArray(tab2,false,CPP_DEALLOC,3,1);
- DataArrayInt *da3=DataArrayInt::New(); da3->useArray(tab3,false,CPP_DEALLOC,3,1);
- DataArrayInt *da4=DataArrayInt::New(); da4->useArray(tab1,false,CPP_DEALLOC,7,1);
+ DataArrayInt *da1=DataArrayInt::New(); da1->useArray(tab1,false,DeallocType::CPP_DEALLOC,7,1);
+ DataArrayInt *da2=DataArrayInt::New(); da2->useArray(tab2,false,DeallocType::CPP_DEALLOC,3,1);
+ DataArrayInt *da3=DataArrayInt::New(); da3->useArray(tab3,false,DeallocType::CPP_DEALLOC,3,1);
+ DataArrayInt *da4=DataArrayInt::New(); da4->useArray(tab1,false,DeallocType::CPP_DEALLOC,7,1);
//
DataArrayInt *a=0;
a=da1->buildSubstractionOptimized(da2);
void MEDCouplingBasicsTest5::testDAIIsStrictlyMonotonic1()
{
const int tab1[7]={1,3,5,6,7,9,13};
- DataArrayInt *da1=DataArrayInt::New(); da1->useArray(tab1,false,CPP_DEALLOC,7,1);
+ DataArrayInt *da1=DataArrayInt::New(); da1->useArray(tab1,false,DeallocType::CPP_DEALLOC,7,1);
CPPUNIT_ASSERT(da1->isStrictlyMonotonic(true));
da1->checkStrictlyMonotonic(true);
CPPUNIT_ASSERT(da1->isMonotonic(true));
da1->decrRef();
//
int tab2[7]={1,3,5,6,6,9,13};
- da1=DataArrayInt::New(); da1->useArray(tab2,false,CPP_DEALLOC,7,1);
+ da1=DataArrayInt::New(); da1->useArray(tab2,false,DeallocType::CPP_DEALLOC,7,1);
CPPUNIT_ASSERT(!da1->isStrictlyMonotonic(true));
CPPUNIT_ASSERT_THROW(da1->checkStrictlyMonotonic(true),INTERP_KERNEL::Exception);
CPPUNIT_ASSERT(da1->isMonotonic(true));
da1->decrRef();
//
const int tab3[7]={1,3,5,6,5,9,13};
- da1=DataArrayInt::New(); da1->useArray(tab3,false,CPP_DEALLOC,7,1);
+ da1=DataArrayInt::New(); da1->useArray(tab3,false,DeallocType::CPP_DEALLOC,7,1);
CPPUNIT_ASSERT(!da1->isStrictlyMonotonic(true));
CPPUNIT_ASSERT_THROW(da1->checkStrictlyMonotonic(true),INTERP_KERNEL::Exception);
CPPUNIT_ASSERT(!da1->isMonotonic(true));
da1->decrRef();
//
const int tab4[7]={13,9,7,6,5,3,1};
- da1=DataArrayInt::New(); da1->useArray(tab4,false,CPP_DEALLOC,7,1);
+ da1=DataArrayInt::New(); da1->useArray(tab4,false,DeallocType::CPP_DEALLOC,7,1);
CPPUNIT_ASSERT(!da1->isStrictlyMonotonic(true));
CPPUNIT_ASSERT_THROW(da1->checkStrictlyMonotonic(true),INTERP_KERNEL::Exception);
CPPUNIT_ASSERT(!da1->isMonotonic(true));
da1->decrRef();
//
const int tab5[7]={13,9,6,6,5,3,1};
- da1=DataArrayInt::New(); da1->useArray(tab5,false,CPP_DEALLOC,7,1);
+ da1=DataArrayInt::New(); da1->useArray(tab5,false,DeallocType::CPP_DEALLOC,7,1);
CPPUNIT_ASSERT(!da1->isStrictlyMonotonic(true));
CPPUNIT_ASSERT_THROW(da1->checkStrictlyMonotonic(true),INTERP_KERNEL::Exception);
CPPUNIT_ASSERT(!da1->isMonotonic(true));
da1->decrRef();
//
const int tab6[7]={13,9,5,6,5,3,1};
- da1=DataArrayInt::New(); da1->useArray(tab6,false,CPP_DEALLOC,7,1);
+ da1=DataArrayInt::New(); da1->useArray(tab6,false,DeallocType::CPP_DEALLOC,7,1);
CPPUNIT_ASSERT(!da1->isStrictlyMonotonic(true));
CPPUNIT_ASSERT_THROW(da1->checkStrictlyMonotonic(true),INTERP_KERNEL::Exception);
CPPUNIT_ASSERT(!da1->isMonotonic(true));
CPPUNIT_ASSERT_THROW(da1->checkMonotonic(false),INTERP_KERNEL::Exception);
da1->decrRef();
//
- da1=DataArrayInt::New(); da1->useArray(tab1,false,CPP_DEALLOC,0,1);
+ da1=DataArrayInt::New(); da1->useArray(tab1,false,DeallocType::CPP_DEALLOC,0,1);
CPPUNIT_ASSERT(da1->isStrictlyMonotonic(true));
da1->checkStrictlyMonotonic(true);
CPPUNIT_ASSERT(da1->isMonotonic(true));
da1->checkMonotonic(false);
da1->decrRef();
//
- da1=DataArrayInt::New(); da1->useArray(tab1,false,CPP_DEALLOC,1,1);
+ da1=DataArrayInt::New(); da1->useArray(tab1,false,DeallocType::CPP_DEALLOC,1,1);
CPPUNIT_ASSERT(da1->isStrictlyMonotonic(true));
da1->checkStrictlyMonotonic(true);
CPPUNIT_ASSERT(da1->isMonotonic(true));
m->insertNextCell(INTERP_KERNEL::NORM_TETRA4,4,conn+20);
const double coords[72]={0.,0.,0.,0.,1.,0.,1.,0.,0.,0.,0.,1.,2.,0.,0.,2.,1.,0.,3.,1.,0.,3.,0.,0.,2.,0.,1.,2.,1.,1.,3.,1.,1.,3.,0.,1.,4.,0.,0.,4.,1.,0.,5.,1.,0.,5.,0.,0.,4.,0.,1.,4.,1.,1.,5.,1.,1.,5.,0.,1.,6.,0.,0.,6.,1.,0.,7.,0.,0.,6.,0.,1.};
DataArrayDouble *c=DataArrayDouble::New();
- c->useArray(coords,false,CPP_DEALLOC,24,3);
+ c->useArray(coords,false,DeallocType::CPP_DEALLOC,24,3);
m->setCoords(c);
c->decrRef();
m->checkConsistency();
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
const double* arr = i ? arr1 : arr2;
const int nb_coord = i ? 3 : 4;
DataArrayDouble* coords = DataArrayDouble::New();
- coords->useArray( arr, /*ownership=*/false, CPP_DEALLOC, nb_coord, 1 );
+ coords->useArray( arr, /*ownership=*/false, DeallocType::CPP_DEALLOC, nb_coord, 1 );
mesh[i] = MEDCouplingCMesh::New();
mesh[i]->setCoords( coords, coords, coords );
MEDCouplingCMesh* meshC = MEDCouplingCMesh::New();
DataArrayDouble* coords = DataArrayDouble::New();
double arr[4] = { -1/3., 1/3., 2/3., 4/3. };
- coords->useArray( arr, /*ownership=*/false, CPP_DEALLOC, 4, 1 );
+ coords->useArray( arr, /*ownership=*/false, DeallocType::CPP_DEALLOC, 4, 1 );
meshC->setCoords( coords );
coords->decrRef();
MEDCouplingCMesh* meshC = MEDCouplingCMesh::New();
DataArrayDouble* coords = DataArrayDouble::New();
double arr[4] = { -1/3., 1/3., 2/3., 4/3. };
- coords->useArray( arr, /*ownership=*/false, CPP_DEALLOC, 4, 1 );
+ coords->useArray( arr, /*ownership=*/false, DeallocType::CPP_DEALLOC, 4, 1 );
meshC->setCoords( coords, coords );
coords->decrRef();
MEDCouplingCMesh* meshC = MEDCouplingCMesh::New();
DataArrayDouble* coords = DataArrayDouble::New();
double arr[4] = { -1/3., 1/3., 2/3., 4/3. };
- coords->useArray( arr, /*ownership=*/false, CPP_DEALLOC, 4, 1 );
+ coords->useArray( arr, /*ownership=*/false, DeallocType::CPP_DEALLOC, 4, 1 );
meshC->setCoords( coords, coords, coords );
coords->decrRef();
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
//! [CppSnippetDataArrayBuild1_1]
coordsArr=MEDCoupling::DataArrayDouble::New();
- coordsArr->useArray(coords,false,MEDCoupling::CPP_DEALLOC,nbOfNodes,3);
+ coordsArr->useArray(coords,false,MEDCoupling::DeallocType::CPP_DEALLOC,nbOfNodes,3);
//now use coordsArr as you need
//...
//coordsArr is no more useful here : release it
coordsArr=MEDCoupling::DataArrayDouble::New();
tmp=new double[3*nbOfNodes];
std::copy(coords,coords+3*nbOfNodes,tmp);
- coordsArr->useArray(tmp,true,MEDCoupling::CPP_DEALLOC,nbOfNodes,3);
+ coordsArr->useArray(tmp,true,MEDCoupling::DeallocType::CPP_DEALLOC,nbOfNodes,3);
//now use coordsArr as you need
//...
//coordsArr is no more useful, release it
coordsArr=MEDCoupling::DataArrayDouble::New();
tmp=(double *)malloc(3*nbOfNodes*sizeof(double));
std::copy(coords,coords+3*nbOfNodes,tmp);
- coordsArr->useArray(tmp,true,MEDCoupling::C_DEALLOC,nbOfNodes,3);
+ coordsArr->useArray(tmp,true,MEDCoupling::DeallocType::C_DEALLOC,nbOfNodes,3);
//now use coordsArr as you need
//...
//coordsArr is no more useful here : release it
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// source
DataArrayDouble *coordsSrc(DataArrayDouble::New());
const double coordsSrcData[18]={-6.25,3.6084391824351605,264.85199999999998,-6.25,3.6084391824351605,289.05200000000002,-6.2499999999999991,-3.6084391824351618,264.85199999999998,-6.2499999999999991,-3.6084391824351618,289.05200000000002,-1.7763568394002505e-15,4.4408920985006262e-15,264.85199999999998,-1.7763568394002505e-15,4.4408920985006262e-15,289.05200000000002};
- coordsSrc->useArray(coordsSrcData,false,CPP_DEALLOC,6,3);
+ coordsSrc->useArray(coordsSrcData,false,DeallocType::CPP_DEALLOC,6,3);
DataArrayInt *connSrc(DataArrayInt::New()),*connISrc(DataArrayInt::New());
const int connSrcData[7]={16,2,0,4,3,1,5};
- connSrc->useArray(connSrcData,false,CPP_DEALLOC,7,1);
+ connSrc->useArray(connSrcData,false,DeallocType::CPP_DEALLOC,7,1);
const int connISrcData[2]={0,7};
- connISrc->useArray(connISrcData,false,CPP_DEALLOC,2,1);
+ connISrc->useArray(connISrcData,false,DeallocType::CPP_DEALLOC,2,1);
MEDCouplingUMesh *srcMesh(MEDCouplingUMesh::New("source",3));
srcMesh->setCoords(coordsSrc);
srcMesh->setConnectivity(connSrc,connISrc,true);
// target
DataArrayDouble *coordsTrg(DataArrayDouble::New());
const double coordsTrgData[36]={-2,1.1547005383792521,264.85199999999998,-2,0.57735026918962618,264.85199999999998,-2.5,0.2886751345948132,264.85199999999998,-2.5,1.443375672974065,264.85199999999998,-3.0000000000000004,1.1547005383792526,264.85199999999998,-3.0000000000000004,0.57735026918962662,264.85199999999998,-2,1.1547005383792521,289.05200000000002,-2,0.57735026918962618,289.05200000000002,-2.5,0.2886751345948132,289.05200000000002,-2.5,1.443375672974065,289.05200000000002,-3.0000000000000004,1.1547005383792526,289.05200000000002,-3.0000000000000004,0.57735026918962662,289.05200000000002};
- coordsTrg->useArray(coordsTrgData,false,CPP_DEALLOC,12,3);
+ coordsTrg->useArray(coordsTrgData,false,DeallocType::CPP_DEALLOC,12,3);
DataArrayInt *connTrg=DataArrayInt::New();
const int connTrgData[44]={31,0,1,2,5,4,3,-1,7,6,9,10,11,8,-1,3,9,6,0,-1,4,10,9,3,-1,5,11,10,4,-1,2,8,11,5,-1,1,7,8,2,-1,0,6,7,1};
- connTrg->useArray(connTrgData,false,CPP_DEALLOC,44,1);
+ connTrg->useArray(connTrgData,false,DeallocType::CPP_DEALLOC,44,1);
DataArrayInt *connITrg=DataArrayInt::New();
const int connITrgData[2]={0,44};
- connITrg->useArray(connITrgData,false,CPP_DEALLOC,2,1);
+ connITrg->useArray(connITrgData,false,DeallocType::CPP_DEALLOC,2,1);
MEDCouplingUMesh *trgMesh=MEDCouplingUMesh::New("target",3);
trgMesh->setCoords(coordsTrg);
trgMesh->setConnectivity(connTrg,connITrg,true);
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-# Copyright (C) 2012-2017 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
INSTALL(FILES ${MC_Swig_interf} DESTINATION ${MEDCOUPLING_INSTALL_HEADERS})
INSTALL(FILES ${MC_pyTestFiles} DESTINATION ${MEDCOUPLING_INSTALL_SCRIPT_PYTHON})
+SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH ${CMAKE_CURRENT_BINARY_DIR}/../PyWrappings)
SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
FOREACH(test ${BASE_TESTS})
-# Copyright (C) 2015-2017 CEA/DEN, EDF R&D
+# Copyright (C) 2015-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
# -*- coding: utf-8 -*-
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
if sys.platform == "win32":
from MEDCouplingCompat import *
else:
- from MEDCoupling import *
+ from medcoupling import *
import unittest
from math import pi,e,sqrt,cos,sin
f3=MEDCouplingFieldDouble.MergeFields(f1,f2);
f3.checkConsistencyLight();
m4=MEDCouplingDataForTest.build2DTargetMeshMerged_1();
+ m4.setName(f1.getMesh().getName())
self.assertTrue(f3.getMesh().isEqual(m4,1.e-12));
name=f3.getName();
self.assertEqual(name,"MeasureOfMesh_");
self.assertTrue(abs(3.6-values4[0])<1.e-12);
self.assertTrue(abs(7.2-values4[1])<1.e-12);
values4=f1.integral(True);
+ #0.4 == 0.25/4*-0.6+(0.25/4+0.125/3)*-0.1+0.4*(0.125/3.+0.125/3)+(-0.1)*(0.25/4+0.25/4)+0.4*(0.25/4+0.125/3+0.125/3+0.25/4+0.25/4)+0.9*(0.25/4+0.125/3)+0.4*0.25/4+0.9*(0.25/4+0.25/4)+1.4*0.25/4
self.assertEqual(2,len(values4))
- self.assertTrue(abs(0.5-values4[0])<1.e-12);
- self.assertTrue(abs(1.-values4[1])<1.e-12);
+ self.assertTrue(abs(0.4-values4[0])<1.e-12);
+ self.assertTrue(abs(0.8-values4[1])<1.e-12);
#
self.assertRaises(InterpKernelException,m.fillFromAnalytic,ON_NODES,1,"1./(x-0.2)");
pass
self.assertTrue(abs(3.6-values4[0])<1.e-12);
self.assertTrue(abs(7.2-values4[1])<1.e-12);
values4=f1.integral(True);
- self.assertTrue(abs(0.5-values4[0])<1.e-12);
- self.assertTrue(abs(1.-values4[1])<1.e-12);
+ self.assertTrue(abs(0.4-values4[0])<1.e-12);
+ self.assertTrue(abs(0.8-values4[1])<1.e-12);
pass
def testApplyFunc(self):
self.assertEqual(mesh.getNodalConnectivityIndex().getValues(), cIRef)
pass
+ def testCellOrientation5(self):
+ """ Non regression for NORM_QPOLYG """
+ mesh = MEDCouplingUMesh('Mesh_3', 2)
+ coo = DataArrayDouble([(-34.3035,5.1),(-35.2018,4.59163),(-34.9509,6.21985),(-35.0858,5.4072),(-34.7527,4.84582),(-34.6641,5.63857)])
+ mesh.setCoords(coo)
+ c = DataArrayInt([6, 2, 1, 0, 3, 4, 5])
+ cI = DataArrayInt([0, 7])
+ mesh.setConnectivity(c, cI)
+ vec = [0., 0., -1.]
+ mesh.changeSpaceDimension(3)
+ mesh.orientCorrectly2DCells(vec, False)
+ mesh.changeSpaceDimension(2)
+ cRef = [6, 2, 0, 1, 5, 4, 3]
+ cIRef = [0, 7]
+ self.assertEqual(mesh.getNodalConnectivity().getValues(), cRef)
+ self.assertEqual(mesh.getNodalConnectivityIndex().getValues(), cIRef)
+ # Second call doest not change anything:
+ mesh.changeSpaceDimension(3)
+ mesh.orientCorrectly2DCells(vec, False)
+ mesh.changeSpaceDimension(2)
+ self.assertEqual(mesh.getNodalConnectivity().getValues(), cRef)
+ self.assertEqual(mesh.getNodalConnectivityIndex().getValues(), cIRef)
+ pass
+
def testPolyhedronBarycenter(self):
connN=[0,3,2,1, -1, 4,5,6,7, -1, 0,4,7,3, -1, 3,7,6,2, -1, 2,6,5,1, -1, 1,5,4,0];
coords=[0.,0.,0., 1.,0.,0., 1.,1.,0., 0.,1.,0., 0.,0.,1., 1.,0.,1., 1.,1.,1., 0.,1.,1., 0.5, 0.5, 0.5];
# -*- coding: utf-8 -*-
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
if sys.platform == "win32":
from MEDCouplingCompat import *
else:
- from MEDCoupling import *
+ from medcoupling import *
import unittest
from math import pi,e,sqrt,cos,sin
from datetime import datetime
self.assertTrue(f1.isEqualWithoutConsideringStr(f2,1e-12,1e-12));
#
pass
-
+
def testGetNodeIdsOfCell1(self):
mesh1=MEDCouplingDataForTest.build2DTargetMesh_1();
li=mesh1.getNodeIdsOfCell(1)
self.assertTrue(abs(3.6-values4[0])<1.e-12);
self.assertTrue(abs(7.2-values4[1])<1.e-12);
values4=f1.integral(True);
- self.assertTrue(abs(0.5-values4[0])<1.e-12);
- self.assertTrue(abs(1.-values4[1])<1.e-12);
+ self.assertTrue(abs(0.4-values4[0])<1.e-12);
+ self.assertTrue(abs(0.8-values4[1])<1.e-12);
#
f1=MEDCouplingFieldDouble.New(ON_NODES,NO_TIME);
f1.setMesh(m);
132.680430393685,255.37973247196,96.15235602819];
volHexa8=3258520.29637466;
baryHexa8=[43.925705821778, 155.31893955289, 65.874418109644]
-
+
coordsForPenta6=[-68.199829618726,178.938498373416,62.608505919588,
8.461744647847,76.653979804423,165.00018874933,
-27.273893776752,167.567731083961,192.830034145464,
132.680430393685,255.37973247196,96.15235602819];
volPenta6=944849.868507338;
baryPenta6=[39.631002313543,182.692711783428,106.98540473964]
-
+
coordsForPyra5=[132.680430393685,255.37973247196,96.15235602819,
-27.273893776752,167.567731083961,192.830034145464,
8.461744647847,76.653979804423,165.00018874933,
self.assertEqual(arr2[i],da3.getIJ(i,0));
pass
pass
-
+
def testKeepSetSelectedComponent1(self):
arr1=[1.,2.,3.,4., 11.,12.,13.,14., 21.,22.,23.,24., 31.,32.,33.,34., 41.,42.,43.,44.]
a1=DataArrayDouble.New();
pass
#
pass
-
+
def testElementaryDAThrowAndSpecialCases(self):
da=DataArrayInt.New();
self.assertRaises(InterpKernelException, da.checkAllocated);
da.alloc(7,1);
da.fillWithValue(11); #11,11,11,11...
da.iota(10); #10,11,12,13...
-
+
db=DataArrayInt.New();
db.alloc(7,2);
-
+
dbl2=DataArrayDouble.New();
dbl2.alloc(7,2);
self.assertRaises(InterpKernelException, dbl2.isUniform, 10., 1e-15);
self.assertRaises(InterpKernelException, dbl2.sort);
self.assertRaises(InterpKernelException, dbl2.iota, 10.);
-
+
dbl=DataArrayDouble.New();
#DataArrayDouble not allocated yet
self.assertRaises(InterpKernelException, dbl.iota, 10.);
self.assertRaises(InterpKernelException, dbl.sort);
self.assertRaises(InterpKernelException, dbl.fromNoInterlace);
self.assertRaises(InterpKernelException, dbl.toNoInterlace);
-
+
dbl.alloc(7,1);
dbl.iota(10.);
self.assertTrue(not dbl.isUniform(10.,1e-15));
self.assertTrue(dbl.isMonotonic(False, .99));
self.assertTrue(not dbl.isMonotonic(False, 1.1));
self.assertTrue(not dbl.isMonotonic(False, -1.1));
-
+
dc=DataArrayInt.New();
dc.alloc(14,1);
-
+
dd=DataArrayDouble.New();
self.assertRaises(InterpKernelException, dd.checkAllocated);
self.assertRaises(InterpKernelException, dd.fillWithValue, 1.);
self.assertRaises(InterpKernelException, dd.iota, 1.);
self.assertTrue(not ((dd.repr().find("No data"))==-1));
-
+
dd.alloc(0,1); #Allocated but nbOfElements==0!
self.assertTrue(not ((dd.repr().find("Number of tuples : 0"))==-1));
self.assertTrue(not ((dd.repr().find("Empty Data"))==-1));
dd.iota(10); #?!...ok
self.assertTrue(dd.isMonotonic(True, 1.)); #nothing is monotonic
self.assertTrue(dd.isMonotonic(False, 1.));
-
+
self.assertRaises(InterpKernelException, db.copyStringInfoFrom, da);
self.assertRaises(InterpKernelException, db.copyStringInfoFrom, da);
cIds=[2,2]
cIds[0]=1;
cIds[0]=-1;
self.assertRaises(InterpKernelException, da.copyPartOfStringInfoFrom, db, cIds);
-
+
info=["infoOfOneComponent"]*2;
self.assertRaises(InterpKernelException, da.setInfoOnComponents, info);
self.assertRaises(InterpKernelException, da.setInfoOnComponent, 1, info[0]);
db.setInfoOnComponents(info);
-
+
self.assertRaises(InterpKernelException, da.getInfoOnComponent, -1);
self.assertRaises(InterpKernelException, da.getInfoOnComponent, 2);
self.assertTrue(db.getInfoOnComponent(1)==db.getInfoOnComponent(0));
self.assertRaises(InterpKernelException, db.getVarOnComponent, 2);
self.assertRaises(InterpKernelException, db.getUnitOnComponent, -1);
self.assertRaises(InterpKernelException, db.getUnitOnComponent, 2);
-
+
self.assertTrue(da.GetVarNameFromInfo("varname unit ")=="varname unit ");
self.assertTrue(da.GetVarNameFromInfo("varname]unit[")=="varname]unit[");
self.assertTrue(da.GetVarNameFromInfo("[unit]")=="");
self.assertTrue(da.GetVarNameFromInfo("varname [unit]")=="varname");
-
+
self.assertTrue(da.GetUnitFromInfo("varname unit ")=="");
self.assertTrue(da.GetUnitFromInfo("varname]unit[")=="");
self.assertTrue(da.GetUnitFromInfo("[unit]")=="unit");
self.assertTrue(da.GetUnitFromInfo("varname [unit]")=="unit");
-
+
self.assertRaises(InterpKernelException, da.checkNbOfTuplesAndComp, db, "theMessageInThrow");
self.assertRaises(InterpKernelException, da.checkNbOfTuplesAndComp, dc, "theMessageInThrow");
self.assertRaises(InterpKernelException, db.checkNbOfTuplesAndComp, dc, "theMessageInThrow");
-
+
self.assertRaises(InterpKernelException, da.checkNbOfTuplesAndComp, 7, 2, "theMessageInThrow");
da.checkNbOfTuplesAndComp(7,1,"theMessageInThrow");
-
+
self.assertRaises(InterpKernelException, db.checkNbOfElems, 7*2+1, "theMessageInThrow");
db.checkNbOfElems(7*2,"theMessageInThrow");
-
+
self.assertRaises(InterpKernelException, db.GetNumberOfItemGivenBES, 10, 9, 1, "theMessageInThrow");
self.assertRaises(InterpKernelException, db.GetNumberOfItemGivenBES, 0, 1, -1, "theMessageInThrow");
self.assertEqual(10,db.GetNumberOfItemGivenBES(0,10,1,"theMessageInThrow"));
self.assertEqual(5,db.GetNumberOfItemGivenBES(0,10,2,"theMessageInThrow"));
self.assertEqual(6,db.GetNumberOfItemGivenBES(0,11,2,"theMessageInThrow"));
-
+
self.assertTrue(not ((da.repr().find("Number of components : 1"))==-1));
self.assertTrue(not ((dd.repr().find("Number of components : 1"))==-1));
self.assertTrue(not ((dbl.repr().find("Number of components : 1"))==-1));
-
+
self.assertTrue(not ((da.reprZip().find("Number of components : 1"))==-1));
self.assertTrue(not ((dd.reprZip().find("Number of components : 1"))==-1));
self.assertTrue(not ((dbl.reprZip().find("Number of components : 1"))==-1));
-
+
self.assertRaises(InterpKernelException, dbl.selectByTupleIdSafeSlice, 0, 1, -1);
self.assertRaises(InterpKernelException, dbl.subArray, -1, 1);
self.assertRaises(InterpKernelException, dbl.subArray, 8, 1);
self.assertRaises(InterpKernelException, dbl.subArray, 0, 8);
self.assertRaises(InterpKernelException, dbl.meldWith, dd);
-
+
self.assertRaises(InterpKernelException, dbl.setPartOfValuesAdv, dbl2, da); #dbl dbl2 not have the same number of components
self.assertRaises(InterpKernelException, dbl.setPartOfValuesAdv, dd, da); #da tuple selector DataArrayInt instance not have exactly 2 components
-
+
dbl3=DataArrayDouble.New();
dbl3.alloc(6,2);
dbl3.fillWithValue(11.);
self.assertRaises(InterpKernelException, dbl3.inverse);
self.assertRaises(InterpKernelException, dbl3.trace);
self.assertRaises(InterpKernelException, dbl3.deviator);
-
+
dbl3.setIJ(5,1,12.);
self.assertTrue(dbl3.getMaxValueInArray()==12.);
self.assertTrue(dbl3.getMinValueInArray()==11.);
-
+
db.fillWithValue(100); #bad Ids
self.assertRaises(InterpKernelException, dbl3.setPartOfValuesAdv, dbl2, db);
db.fillWithValue(-1); #bad Ids
self.assertRaises(InterpKernelException, dbl3.setPartOfValuesAdv, dbl2, db);
db.fillWithValue(6); #bad Ids for dbl3
self.assertRaises(InterpKernelException, dbl3.setPartOfValuesAdv, dbl2, db);
-
+
dbl3.checkNoNullValues();
dbl3.setIJ(5,0,0.);
self.assertRaises(InterpKernelException, dbl3.checkNoNullValues);
a=[]
self.assertRaises(InterpKernelException, DataArrayDouble_Aggregate, a);
self.assertRaises(InterpKernelException, DataArrayDouble_Meld, a);
-
+
a=[dbl2,dbl]; #Nb of components mismatch
self.assertRaises(InterpKernelException, DataArrayDouble_Aggregate, a);
-
+
self.assertRaises(InterpKernelException, DataArrayDouble_Dot, dbl2, dbl);
-
+
self.assertRaises(InterpKernelException, DataArrayDouble_CrossProduct, dbl2, dbl); #Nb of components mismatch
self.assertRaises(InterpKernelException, DataArrayDouble_CrossProduct, dbl2, dbl2); #Nb of components must be equal to 3
dbl4=DataArrayDouble.New();
dbl5=DataArrayDouble.New();
dbl5.alloc(7,3);
self.assertRaises(InterpKernelException, DataArrayDouble_CrossProduct, dbl4, dbl5); #Nb of tuples mismatch
-
+
a[0]=dbl4; #Nb of tuple mismatch
a[1]=dbl5; #Nb of tuple mismatch
self.assertRaises(InterpKernelException, DataArrayDouble_Meld, a);
self.assertAlmostEqual(expected1[i],da4.getIJ(0,i),14);
pass
pass
-
+
def testDAToNoInterlace1(self):
tab1=[1,2,3,11,12,13,21,22,23,31,32,33,41,42,43]
da=DataArrayInt.New();
self.assertAlmostEqual(expected1[i],da4.getIJ(0,i),14);
pass
pass
-
+
def testDAIsUniform1(self):
tab1=[1,1,1,1,1]
da=DataArrayInt.New();
da=DataArrayInt() # non allocated array
self.assertRaises(InterpKernelException, da.hasUniqueValues)
pass
-
+
def testDADFromPolarToCart1(self):
tab1=[2.,0.2,2.5,0.7]
da=DataArrayDouble.New();
self.assertAlmostEqual(expected1[i],da2.getIJ(0,i),13);
pass
pass
-
+
def testDADFromCylToCart1(self):
tab1=[2.,0.2,4.,2.5,0.7,9.]
da=DataArrayDouble.New();
self.assertAlmostEqual(expected1[i],da2.getIJ(0,i),13);
pass
pass
-
+
def testDADFromSpherToCart1(self):
tab1=[2.,0.2,0.3,2.5,0.7,0.8]
da=DataArrayDouble.New();
coo = DataArrayDouble([0.0]*10) # Just to have some. Values do not matter.
mesh = MEDCouplingUMesh("m", 2)
mesh.setCoords(coo)
-
+
# Linear
c = [NORM_QUAD4, 0,1,0,2, NORM_TRI3, 0,1,1, NORM_TRI3, 0,1,2, NORM_QUAD4, 1,0,2,1, NORM_POLYGON, 1,0,1,1]
cI = [0, 5, 9, 13, 18, 23]
c, cI = mesh.getNodalConnectivity().getValues(), mesh.getNodalConnectivityIndex().getValues()
self.assertEqual(c, [NORM_QUAD4, 0,1,0,2, NORM_POLYGON, 0,1, NORM_TRI3, 0,1,2, NORM_TRI3, 1,0,2, NORM_POLYGON, 1,0])
self.assertEqual(cI, [0, 5, 8, 12, 16, 19])
-
+
res = mesh2.convertDegeneratedCellsAndRemoveFlatOnes()
c, cI = mesh2.getNodalConnectivity().getValues(), mesh2.getNodalConnectivityIndex().getValues()
self.assertEqual(c, [NORM_QUAD4, 0,1,0,2, NORM_TRI3, 0,1,2, NORM_TRI3, 1,0,2])
self.assertEqual(cI, [0, 5, 9, 13])
self.assertEqual(res.getValues(), [1,4])
-
+
# Quadratics now:
c = [NORM_TRI6, 0,1,0, 2,3,0, NORM_QUAD8, 0,1,1,3, 4,1,6,7, NORM_QPOLYG, 0,1, NORM_QPOLYG, 0,1,2,2, NORM_TRI6, 0,1,2, 3,4,5]
cI = [0, 7, 16, 19, 24, 31]
mesh3.setConnectivity(DataArrayInt(c),DataArrayInt(cI))
-
+
mesh3.convertDegeneratedCells()
c, cI = mesh3.getNodalConnectivity().getValues(), mesh3.getNodalConnectivityIndex().getValues()
self.assertEqual(c, [NORM_QPOLYG, 0,1, 2,3, NORM_TRI6, 0,1,3, 4,6,7, NORM_QPOLYG, 0,1, NORM_QPOLYG, 0,1,2,2, NORM_TRI6, 0,1,2, 3,4,5])
self.assertEqual(cI, [0, 5, 12, 15, 20, 27])
mesh4 = mesh3.deepCopy()
-
+
res = mesh4.convertDegeneratedCellsAndRemoveFlatOnes()
c, cI = mesh4.getNodalConnectivity().getValues(), mesh4.getNodalConnectivityIndex().getValues()
self.assertEqual(c, [NORM_QPOLYG, 0,1, 2,3, NORM_TRI6, 0,1,3, 4,6,7, NORM_TRI6, 0,1,2, 3,4,5])
self.assertEqual(cI, [0, 5, 12, 19])
self.assertEqual(res.getValues(), [2,3])
-
+
pass
def testGetNodeIdsNearPoints1(self):
self.assertEqual(0,a.getIJ(1,0));
self.assertEqual(4,a.getIJ(2,0));
pass
-
+
def testSwigErrorDaIntSelectByTupleId1(self):
a=DataArrayInt.New();
arr1=[1,11,2,12,3,13,4,14,5,15,6,16,7,17]
da.renumberInPlace(d)
da.renumber(d)
pass
-
+
pass
if __name__ == '__main__':
# -*- coding: utf-8 -*-
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
if sys.platform == "win32":
from MEDCouplingCompat import *
else:
- from MEDCoupling import *
+ from medcoupling import *
import unittest
from math import pi,e,sqrt,cos,sin
from datetime import datetime
res = d.normMaxPerComponent()
self.assertAlmostEqual(-1.0, res[0],14)
self.assertAlmostEqual(-1.0, res[1],14)
-
+
tab=[2.3,-1.2,6.3,-7.8,2.9,7.7,2.1,0.,3.6,-7.6]
d.setValues(tab,5,2);
-
+
res = d.normMaxPerComponent()
self.assertAlmostEqual(6.3, res[0],14)
self.assertAlmostEqual(7.8, res[1],14)
-
+
f.setArray(d);
f.checkConsistencyLight();
#
#
self.assertAlmostEqual(6.3,f.normMax(0),14);
self.assertAlmostEqual(7.8,f.normMax(1),14);
-
+
pass
def testFindAndCorrectBadOriented3DExtrudedCells1(self):
# -*- coding: utf-8 -*-
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
if sys.platform == "win32":
from MEDCouplingCompat import *
else:
- from MEDCoupling import *
+ from medcoupling import *
import unittest
from math import pi,e,sqrt,cos,sin
from datetime import datetime
dic['free'] = tmp
dic['used'] = int(dic['total']) - int(dic['free'])
ret = dic['free'] > size
- #TODO: extend this method for Windows OS
+ #TODO: extend this method for Windows OS
return ret
pass
#
pass
-
+
def testComputeNeighborsOfCells1(self):
m=MEDCouplingDataForTest.build2DTargetMesh_1();
d1,d2=m.computeNeighborsOfCells();
self.assertTrue(subMesh.isEqual(m5,1e-12))
self.assertRaises(InterpKernelException,m.buildPartOfMySelf,[1,5],True);
pass
-
+
def testSwigGetItem3(self):
da=DataArrayInt.New([4,5,6])
self.assertEqual(5,da[1])
d-=2
d%=7
pass
-
+
def testSwigDAIOp5(self):
d=DataArrayInt.New([4,5,6,10,3,-1],2,3)
self.toSeeIfDaIIopsAreOK(d)
dExp=DataArrayInt.New([2,4,6,0,0,6],2,3)
self.assertTrue(d.isEqual(dExp));
pass
-
+
def toSeeIfDaDIopsAreOK(self,d):
d+=5
d*=6
self.assertAlmostEqual(expected4[i],ard2.getIJ(i,0),12)
pass
pass
-
+
def testPartitionBySpreadZone1(self):
m=MEDCouplingDataForTest.build2DTargetMesh_1();
m4=MEDCouplingUMesh.MergeUMeshes([m,m[-3:],m[0:2]]);
#
m0=MEDCouplingUMesh("m",3) ; m0.allocateCells(0); m0.insertNextCell(NORM_TETRA4,[0,1,2,3]); #Well oriented
m1=MEDCouplingUMesh("m",3) ; m1.allocateCells(0); m1.insertNextCell(NORM_PYRA5,[0,1,2,3,4]); #Well oriented
- m2=MEDCouplingUMesh("m",3) ; m2.allocateCells(0); m2.insertNextCell(NORM_PENTA6,[0,1,2,3,4,5]); #Well oriented
+ m2=MEDCouplingUMesh("m",3) ; m2.allocateCells(0); m2.insertNextCell(NORM_PENTA6,[0,1,2,3,4,5]); #Well oriented
m3=MEDCouplingUMesh("m",3) ; m3.allocateCells(0); m3.insertNextCell(NORM_HEXA8,[0,1,2,3,4,5,6,7]); #Well oriented
m4=MEDCouplingUMesh("m",3) ; m4.allocateCells(0)
self.assertRaises(InterpKernelException,m4.insertNextCell,NORM_HEXGP12,[0,1,2,3,4,5,6,7,8,9,10,11,12]);
#
mOK=m.deepCopy()
m0=MEDCouplingUMesh("m",3) ; m0.allocateCells(0); m0.insertNextCell(NORM_TETRA4,[0,2,1,3]); #Not well oriented
- m1=MEDCouplingUMesh("m",3) ; m1.allocateCells(0); m1.insertNextCell(NORM_PYRA5,[0,1,2,3,4]); #Well oriented
- m2=MEDCouplingUMesh("m",3) ; m2.allocateCells(0); m2.insertNextCell(NORM_PENTA6,[0,1,2,3,4,5]); #Well oriented
+ m1=MEDCouplingUMesh("m",3) ; m1.allocateCells(0); m1.insertNextCell(NORM_PYRA5,[0,1,2,3,4]); #Well oriented
+ m2=MEDCouplingUMesh("m",3) ; m2.allocateCells(0); m2.insertNextCell(NORM_PENTA6,[0,1,2,3,4,5]); #Well oriented
m3=MEDCouplingUMesh("m",3) ; m3.allocateCells(0); m3.insertNextCell(NORM_HEXA8,[0,3,2,1,4,7,6,5]); #Not well oriented
m4=MEDCouplingUMesh("m",3) ; m4.allocateCells(0); m4.insertNextCell(NORM_HEXGP12,[0,5,4,3,2,1,6,11,10,9,8,7]); #Not well oriented
m0.setCoords(c0) ; m1.setCoords(c1) ; m2.setCoords(c2) ; m3.setCoords(c3) ; m4.setCoords(c4)
pass
#
m0=MEDCouplingUMesh("m",3) ; m0.allocateCells(0); m0.insertNextCell(NORM_TETRA4,[0,1,2,3]); #Well oriented
- m1=MEDCouplingUMesh("m",3) ; m1.allocateCells(0); m1.insertNextCell(NORM_PYRA5,[0,3,2,1,4]); #Not well oriented
- m2=MEDCouplingUMesh("m",3) ; m2.allocateCells(0); m2.insertNextCell(NORM_PENTA6,[0,2,1,3,5,4]); #Not well oriented
+ m1=MEDCouplingUMesh("m",3) ; m1.allocateCells(0); m1.insertNextCell(NORM_PYRA5,[0,3,2,1,4]); #Not well oriented
+ m2=MEDCouplingUMesh("m",3) ; m2.allocateCells(0); m2.insertNextCell(NORM_PENTA6,[0,2,1,3,5,4]); #Not well oriented
m3=MEDCouplingUMesh("m",3) ; m3.allocateCells(0); m3.insertNextCell(NORM_HEXA8,[0,1,2,3,4,5,6,7]); #Well oriented
m4 = MEDCouplingUMesh("m", 3) ; m4.allocateCells(0); m4.insertNextCell(NORM_HEXGP12, list(range(12))); # Well oriented
m0.setCoords(c0) ; m1.setCoords(c1) ; m2.setCoords(c2) ; m3.setCoords(c3) ; m4.setCoords(c4)
pass
def testSwigSetItem3(self):
- # 1-2
+ # 1-2
d=DataArrayDouble([0,0,0,0,0,0,0,0,0,0,0,0],6,2)
d[3]=[1,2]
self.assertTrue(d.isEqual(DataArrayDouble([0,0,0,0,0,0,1,2,0,0,0,0],6,2),1e-14))
d=DataArrayDouble([0,0,0,0,0,0,0,0,0,0,0,0],6,2)
d[1::2,:]=[3,9]
self.assertTrue(d.isEqual(DataArrayDouble([0,0,3,9,0,0,3,9,0,0,3,9],6,2),1e-14))
- # 1-2
+ # 1-2
d=DataArrayInt([0,0,0,0,0,0,0,0,0,0,0,0],6,2)
d[3]=[1,2]
self.assertTrue(d.isEqual(DataArrayInt([0,0,0,0,0,0,1,2,0,0,0,0],6,2)))
d4**=d3
self.assertTrue(d4.isEqual(DataArrayDouble([1.,sqrt(2.),1.4422495703074083,sqrt(2.)]),1e-14))
pass
-
+
def testSwig2Baryenter3DForCellsWithVolumeZero1(self):
coo=DataArrayDouble([0.,0.,0.,1.,0.,0.,0.,1.,0.],3,3)
m2=MEDCouplingUMesh("mesh",2)
d.alloc(1000,3) ; d.fillWithValue(127)
self.assertTrue(len(d.__repr__())<500)
pass
-
+
def testSwig2MeshComputeIsoBarycenterOfNodesPerCell1(self):
coo=DataArrayDouble([26.17509821414239,5.0374,200.,26.175098214142388,-5.0374,200.,17.450065476094927,20.1496,200.,8.725032738047464,25.187,200.,43.62516369023732,5.0374,200.,34.90013095218986,10.0748,200.,34.900130952189855,-10.0748,200.,43.625163690237315,-5.0374,200.,26.175098214142402,25.187,200.,26.175098214142395,35.2618,200.,17.45006547609493,40.2992,200.,8.725032738047469,35.2618,200.,26.17509821414239,5.0374,200.,26.175098214142388,-5.0374,200.,17.450065476094927,20.1496,200.,8.725032738047464,25.187,200.,43.62516369023732,5.0374,200.,34.90013095218986,10.0748,200.,34.900130952189855,-10.0748,200.,43.625163690237315,-5.0374,200.,26.175098214142402,25.187,200.,26.175098214142395,35.2618,200.,17.45006547609493,40.2992,200.,8.725032738047469,35.2618,200.],24,3)
m=MEDCouplingUMesh.New("toto",3)
self.assertTrue(d.isEqual(DataArrayInt([0,0,0,0,0,0])))
self.assertTrue(e.isEqual(DataArrayInt([0,1,2,3,4,5,6])))
pass
-
+
def testSwigAdvGauss(self):
f=MEDCouplingFieldTemplate(ON_GAUSS_PT)
f.setDiscretization(None)
# -*- coding: utf-8 -*-
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
if sys.platform == "win32":
from MEDCouplingCompat import *
else:
- from MEDCoupling import *
+ from medcoupling import *
import unittest
from math import pi,e,sqrt,cos,sin
# -*- coding: utf-8 -*-
-# Copyright (C) 2017 CEA/DEN, EDF R&D
+# Copyright (C) 2017-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
if sys.platform == "win32":
from MEDCouplingCompat import *
else:
- from MEDCoupling import *
+ from medcoupling import *
import unittest
from math import pi,e,sqrt,cos,sin
from datetime import datetime
a1.rearrange(3)
self.assertRaises(InterpKernelException,a1.findIdForEach,b1) # a1 is not single component
pass
-
+
def testAttractSeg3MidPtsAroundNodes1(self):
""" Test of MEDCouplingUMesh.attractSeg3MidPtsAroundNodes methods """
ptsExpToBeModified=DataArrayInt([95,96,97,98,101,103,104,106,108,110])
arrOfDisc=fGauss.getLocalizationOfDiscr()
self.assertTrue(arrOfDisc.isEqual(DataArrayDouble([0.2,0.2,0.2,0.5,0.5,0.5,0.9,0.9,0.9],3,3),1e-12))
pass
-
+
def testUMeshGetCellsContainingPtOn2DNonDynQuadraticCells(self):
"""getCellsContainingPoint is now dealing curves of quadratic 2D elements.
This test is a mesh containing 2 QUAD8 cells. The input point is located at a special loc.
self.assertTrue(m.getNodalConnectivityIndex().isEqual(expConnI))
pass
+ def testMergeFieldsOnGauss1(self):
+ mName="mesh"
+ fieldName="field"
+ #
+ _a=0.446948490915965;
+ _b=0.091576213509771;
+ _p1=0.11169079483905;
+ _p2=0.0549758718227661;
+ refCoo1=[ 0.,0., 1.,0., 0.,1. ]
+ gsCoo1=[ 2*_b-1, 1-4*_b, 2*_b-1, 2.07*_b-1, 1-4*_b,
+ 2*_b-1, 1-4*_a, 2*_a-1, 2*_a-1, 1-4*_a, 2*_a-1, 2*_a-1 ]
+ wg1=[ 4*_p2, 4*_p2, 4*_p2, 4*_p1, 4*_p1, 4*_p1 ]
+ #
+ refCoo2=[ -1.,-1., 1.,-1., 1.,1., -1.,1. ]
+ gsCoo2=[0.1,0.1, 0.2,0.2, 0.5,0.5, 0.6,0.6, 0.7,0.7]
+ wg2=[0.1,0.2,0.3,0.4,0.5]
+ #
+ coo=DataArrayDouble([0,0,1,0,2,0,0,1,1,1,2,1,0,2,1,2,2,2],9,2)
+ m1=MEDCouplingUMesh(mName,2)
+ m1.allocateCells() ; m1.setCoords(coo)
+ m1.insertNextCell(NORM_TRI3,[1,4,2])
+ m1.insertNextCell(NORM_TRI3,[4,5,2])
+ m1.insertNextCell(NORM_QUAD4,[4,7,8,5])
+ f1=MEDCouplingFieldDouble(ON_GAUSS_PT) ; f1.setName(fieldName)
+ f1.setMesh(m1)
+ f1.setGaussLocalizationOnType(NORM_TRI3,refCoo1,gsCoo1,wg1)
+ f1.setGaussLocalizationOnType(NORM_QUAD4,refCoo2,gsCoo2,wg2)
+ arr=DataArrayDouble(f1.getNumberOfTuplesExpected())
+ arr.iota()
+ f1.setArray(arr)
+ f1.checkConsistencyLight()
+ #
+ m2=MEDCouplingUMesh(mName,2)
+ m2.allocateCells() ; m2.setCoords(coo)
+ m2.insertNextCell(NORM_QUAD4,[0,3,4,1])
+ m2.insertNextCell(NORM_QUAD4,[3,6,7,4])
+ ###################
+ self.assertTrue(f1.getMesh().getCoords().isEqual(m2.getCoords(),1e-12))
+ f1.getMesh().setCoords(m2.getCoords())
+ #
+ f2=MEDCouplingFieldDouble(ON_GAUSS_PT)
+ f2.setMesh(m2)
+ for gt in m2.getAllGeoTypes(): # on recopie les localisation en utilisant f1
+ glt=f1.getGaussLocalizationIdOfOneType(gt)
+ gloc=f1.getGaussLocalization(glt)
+ f2.setGaussLocalizationOnType(gt,gloc.getRefCoords(),gloc.getGaussCoords(),gloc.getWeights())
+ arr2=DataArrayDouble(f2.getNumberOfTuplesExpected())
+ arr2[:]=0
+ f2.setArray(arr2)
+ f2.checkConsistencyLight()
+ #
+ fout1=MEDCouplingFieldDouble.MergeFields([f1,f2])
+ fout2=MEDCouplingFieldDouble.MergeFields(f1,f2)
+ #
+ fOut=MEDCouplingFieldDouble(ON_GAUSS_PT)
+ mOut=MEDCouplingUMesh.MergeUMeshes([f1.getMesh(),m2])
+ mOut.setName(f1.getMesh().getName())
+ fOut.setMesh(mOut)
+ for gt in f1.getMesh().getAllGeoTypes(): # on recopie les localisation en utilisant f1
+ glt=f1.getGaussLocalizationIdOfOneType(gt)
+ gloc=f1.getGaussLocalization(glt)
+ fOut.setGaussLocalizationOnType(gt,gloc.getRefCoords(),gloc.getGaussCoords(),gloc.getWeights())
+ fOut.setArray(DataArrayDouble.Aggregate([f1.getArray(),arr2]))
+ fOut.checkConsistencyLight()
+ fOut.setName(f1.getName())
+ fOut.getMesh().setName(f1.getMesh().getName())
+ #
+ self.assertTrue(fout1.isEqual(fOut,1e-12,1e-12))
+ self.assertTrue(fout2.isEqual(fOut,1e-12,1e-12))
+ pass
+
pass
if __name__ == '__main__':
-// Copyright (C) 2017 CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
%nodefaultctor;
+// ABN: Instruct SWIG that INTERP_KERNEL::Exception is an exception class and that it should inherit Exception
+// on the Python side. Must be put BEFORE the %rename clause:
+%exceptionclass INTERP_KERNEL::Exception;
%rename (InterpKernelException) INTERP_KERNEL::Exception;
%include "MEDCouplingRefCountObject.i"
{
public:
BoxSplittingOptions();
- void init() throw(INTERP_KERNEL::Exception);
- double getEfficiencyGoal() const throw(INTERP_KERNEL::Exception);
- void setEfficiencyGoal(double efficiency) throw(INTERP_KERNEL::Exception);
- double getEfficiencyThreshold() const throw(INTERP_KERNEL::Exception);
- void setEfficiencyThreshold(double efficiencyThreshold) throw(INTERP_KERNEL::Exception);
- int getMinimumPatchLength() const throw(INTERP_KERNEL::Exception);
- void setMinimumPatchLength(int minPatchLength) throw(INTERP_KERNEL::Exception);
- int getMaximumPatchLength() const throw(INTERP_KERNEL::Exception);
- void setMaximumPatchLength(int maxPatchLength) throw(INTERP_KERNEL::Exception);
- int getMaximumNbOfCellsInPatch() const throw(INTERP_KERNEL::Exception);
- void setMaximumNbOfCellsInPatch(int maxNbCellsInPatch) throw(INTERP_KERNEL::Exception);
- void copyOptions(const BoxSplittingOptions & other) throw(INTERP_KERNEL::Exception);
- std::string printOptions() const throw(INTERP_KERNEL::Exception);
+ void init();
+ double getEfficiencyGoal() const;
+ void setEfficiencyGoal(double efficiency);
+ double getEfficiencyThreshold() const;
+ void setEfficiencyThreshold(double efficiencyThreshold);
+ int getMinimumPatchLength() const;
+ void setMinimumPatchLength(int minPatchLength);
+ int getMaximumPatchLength() const;
+ void setMaximumPatchLength(int maxPatchLength);
+ int getMaximumNbOfCellsInPatch() const;
+ void setMaximumNbOfCellsInPatch(int maxNbCellsInPatch);
+ void copyOptions(const BoxSplittingOptions & other);
+ std::string printOptions() const;
%extend
{
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->printOptions();
}
%extend MEDCouplingGaussLocalization
{
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->getStringRepr();
}
- std::string __repr__() const throw(INTERP_KERNEL::Exception)
+ std::string __repr__() const
{
std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
oss << self->getStringRepr();
void setTime(double val, int iteration, int order);
void setTimeUnit(const std::string& unit);
std::string getTimeUnit() const;
- virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
- bool isStructured() const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingMesh *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
- virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
- virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
- virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
- virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
- virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
- virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
- virtual void checkConsistency(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
- virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
- virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
- virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
- virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
- virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
- virtual DataArrayDouble *computeCellCenterOfMass() const throw(INTERP_KERNEL::Exception);
- virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
- virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
- virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
- virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
- virtual DataArrayInt *computeEffectiveNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
- virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
- virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
- virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
- virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
- std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
+ virtual MEDCouplingMeshType getType() const;
+ bool isStructured() const;
+ virtual MEDCouplingMesh *deepCopy() const;
+ virtual MEDCouplingMesh *clone(bool recDeepCpy) const;
+ virtual bool isEqual(const MEDCouplingMesh *other, double prec) const;
+ virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const;
+ virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const;
+ virtual void copyTinyStringsFrom(const MEDCouplingMesh *other);
+ virtual void copyTinyInfoFrom(const MEDCouplingMesh *other);
+ virtual void checkConsistencyLight() const;
+ virtual void checkConsistency(double eps=1e-12) const;
+ virtual int getNumberOfCells() const;
+ virtual int getNumberOfNodes() const;
+ virtual int getSpaceDimension() const;
+ virtual int getMeshDimension() const;
+ virtual DataArrayDouble *getCoordinatesAndOwner() const;
+ virtual DataArrayDouble *computeCellCenterOfMass() const;
+ virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const;
+ virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const;
+ virtual DataArrayInt *computeNbOfNodesPerCell() const;
+ virtual DataArrayInt *computeNbOfFacesPerCell() const;
+ virtual DataArrayInt *computeEffectiveNbOfNodesPerCell() const;
+ virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const;
+ virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const;
+ virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const;
+ virtual std::string simpleRepr() const;
+ virtual std::string advancedRepr() const;
+ std::string writeVTK(const std::string& fileName, bool isBinary=true) const;
virtual std::string getVTKFileExtension() const;
std::string getVTKFileNameOf(const std::string& fileName) const;
// tools
- virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingFieldDouble *fillFromAnalyticCompo(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingFieldDouble *fillFromAnalyticNamedCompo(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
- virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
- virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
- virtual void unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2, const std::vector<std::string>& littleStrings) throw(INTERP_KERNEL::Exception);
- static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
- static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
- static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
- static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
- static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
- static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
- static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
+ virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const;
+ virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const;
+ virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const;
+ virtual MEDCouplingFieldDouble *fillFromAnalyticCompo(TypeOfField t, int nbOfComp, const std::string& func) const;
+ virtual MEDCouplingFieldDouble *fillFromAnalyticNamedCompo(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const;
+ virtual MEDCouplingFieldDouble *buildOrthogonalField() const;
+ virtual MEDCouplingUMesh *buildUnstructured() const;
+ virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const;
+ virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const;
+ virtual DataArrayInt *simplexize(int policy);
+ virtual void unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2, const std::vector<std::string>& littleStrings);
+ static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2);
+ static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type);
+ static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type);
+ static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type);
+ static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type);
+ static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type);
+ static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type);
%extend
{
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->simpleRepr();
}
- PyObject *getTime() throw(INTERP_KERNEL::Exception)
+ PyObject *getTime()
{
int tmp1,tmp2;
double tmp0=self->getTime(tmp1,tmp2);
return res;
}
- DataArrayDouble *getDirectAccessOfCoordsArrIfInStructure() const throw(INTERP_KERNEL::Exception)
+ DataArrayDouble *getDirectAccessOfCoordsArrIfInStructure() const
{
const DataArrayDouble *ret(self->getDirectAccessOfCoordsArrIfInStructure());
DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
return ret2;
}
- int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
+ int getCellContainingPoint(PyObject *p, double eps) const
{
double val;
DataArrayDouble *a;
return self->getCellContainingPoint(pos,eps);
}
- PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
+ PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const
{
double val;
DataArrayDouble *a;
return ret;
}
- PyObject *getCellsContainingPointsLinearPartOnlyOnNonDynType(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
+ PyObject *getCellsContainingPointsLinearPartOnlyOnNonDynType(PyObject *p, int nbOfPoints, double eps) const
{
double val;
DataArrayDouble *a;
return ret;
}
- PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
+ PyObject *getCellsContainingPoints(PyObject *p, double eps) const
{
auto getCellsContainingPointsFunc=[self](const double *a, int b,double c, MCAuto<DataArrayInt>& d, MCAuto<DataArrayInt>& e) { self->getCellsContainingPoints(a,b,c,d,e); };
return Mesh_getCellsContainingPointsLike(p,eps,self,getCellsContainingPointsFunc);
}
- PyObject *getCellsContainingPointsLinearPartOnlyOnNonDynType(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
+ PyObject *getCellsContainingPointsLinearPartOnlyOnNonDynType(PyObject *p, double eps) const
{
auto getCellsContainingPointsFunc=[self](const double *a, int b,double c, MCAuto<DataArrayInt>& d, MCAuto<DataArrayInt>& e) { self->getCellsContainingPointsLinearPartOnlyOnNonDynType(a,b,c,d,e); };
return Mesh_getCellsContainingPointsLike(p,eps,self,getCellsContainingPointsFunc);
}
- PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
+ PyObject *getCellsContainingPoint(PyObject *p, double eps) const
{
double val;
DataArrayDouble *a;
return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
- virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
+ virtual PyObject *getReverseNodalConnectivity() const
{
MCAuto<DataArrayInt> d0=DataArrayInt::New();
MCAuto<DataArrayInt> d1=DataArrayInt::New();
return ret;
}
- void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
+ void renumberCells(PyObject *li, bool check=true)
{
int sw,sz(-1);
int v0; std::vector<int> v1;
self->renumberCells(ids,check);
}
- PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
+ PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const
{
DataArrayInt *cellCor, *nodeCor;
self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
return res;
}
- PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
+ PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const
{
DataArrayInt *cellCor=0,*nodeCor=0;
self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
return res;
}
- DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
+ DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const
{
DataArrayInt *cellCor=0;
self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
return cellCor;
}
- DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
+ DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const
{
void *da=0;
int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
}
}
- PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
+ PyObject *getNodeIdsOfCell(int cellId) const
{
std::vector<int> conn;
self->getNodeIdsOfCell(cellId,conn);
return convertIntArrToPyList2(conn);
}
- PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
+ PyObject *getCoordinatesOfNode(int nodeId) const
{
std::vector<double> coo;
self->getCoordinatesOfNode(nodeId,coo);
return convertDblArrToPyList2(coo);
}
- void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
+ void scale(PyObject *point, double factor)
{
double val;
DataArrayDouble *a;
self->scale(pointPtr,factor);
}
- PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
+ PyObject *getBoundingBox() const
{
int spaceDim=self->getSpaceDimension();
INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
return ret;
}
- PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
+ PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const
{
std::string ret1;
bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
return ret;
}
- PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
+ PyObject *buildPart(PyObject *li) const
{
int szArr,sw,iTypppArr;
std::vector<int> stdvecTyyppArr;
return convertMesh(ret, SWIG_POINTER_OWN | 0 );
}
- PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
+ PyObject *buildPartAndReduceNodes(PyObject *li) const
{
int szArr,sw,iTypppArr;
std::vector<int> stdvecTyyppArr;
return res;
}
- PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
+ PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const
{
int a,b,c;
DataArrayInt *arr=0;
return res;
}
- PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
+ PyObject *getDistributionOfTypes() const
{
std::vector<int> vals=self->getDistributionOfTypes();
if(vals.size()%3!=0)
return ret;
}
- DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
+ DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const
{
std::vector<int> code;
std::vector<const DataArrayInt *> idsPerType;
return self->checkTypeConsistencyAndContig(code,idsPerType);
}
- PyObject *splitProfilePerType(const DataArrayInt *profile, bool smartPflKiller=true) const throw(INTERP_KERNEL::Exception)
+ PyObject *splitProfilePerType(const DataArrayInt *profile, bool smartPflKiller=true) const
{
std::vector<int> code;
std::vector<DataArrayInt *> idsInPflPerType;
return ret;
}
- void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
+ void translate(PyObject *vector)
{
double val;
DataArrayDouble *a;
self->translate(vectorPtr);
}
- void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
+ void rotate(PyObject *center, double alpha)
{
const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
double val;
self->rotate(centerPtr,0,alpha);
}
- void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
+ void rotate(PyObject *center, PyObject *vector, double alpha)
{
const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
double val,val2;
self->rotate(centerPtr,vectorPtr,alpha);
}
- PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
+ PyObject *getAllGeoTypes() const
{
std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
return res;
}
- virtual PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
+ virtual PyObject *getTinySerializationInformation() const
{
std::vector<double> a0;
std::vector<int> a1;
return ret;
}
- virtual PyObject *serialize() const throw(INTERP_KERNEL::Exception)
+ virtual PyObject *serialize() const
{
DataArrayInt *a0Tmp(0);
DataArrayDouble *a1Tmp(0);
return ret;
}
- void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2) const throw(INTERP_KERNEL::Exception)
+ void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2) const
{
std::vector<std::string> littleStrings;
self->resizeForUnserialization(tinyInfo,a1,a2,littleStrings);
}
- PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
+ PyObject *__getstate__() const
{
PyObject *ret0(MEDCoupling_MEDCouplingMesh_getTinySerializationInformation(self));
PyObject *ret1(MEDCoupling_MEDCouplingMesh_serialize(self));
return ret;
}
- void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
+ void __setstate__(PyObject *inp)
{
static const char MSG[]="MEDCouplingMesh.__setstate__ : expected input is a tuple of size 2 !";
if(!PyTuple_Check(inp))
self->unserialization(a0,a1,b0,b1,a2);
}
- static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
+ static MEDCouplingMesh *MergeMeshes(PyObject *li)
{
std::vector<const MEDCoupling::MEDCouplingMesh *> tmp;
convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,"MEDCouplingMesh",tmp);
class MEDCouplingNatureOfField
{
public:
- static const char *GetRepr(NatureOfField nat) throw(INTERP_KERNEL::Exception);
+ static const char *GetRepr(NatureOfField nat);
static std::string GetReprNoThrow(NatureOfField nat);
static std::string GetAllPossibilitiesStr();
};
{
public:
MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
- const std::vector<double>& gsCoo, const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
- MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
- INTERP_KERNEL::NormalizedCellType getType() const throw(INTERP_KERNEL::Exception);
- void setType(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
- int getNumberOfGaussPt() const throw(INTERP_KERNEL::Exception);
- int getDimension() const throw(INTERP_KERNEL::Exception);
- int getNumberOfPtsInRefCell() const throw(INTERP_KERNEL::Exception);
- std::string getStringRepr() const throw(INTERP_KERNEL::Exception);
- void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
- bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const throw(INTERP_KERNEL::Exception);
+ const std::vector<double>& gsCoo, const std::vector<double>& w);
+ MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ);
+ INTERP_KERNEL::NormalizedCellType getType() const;
+ void setType(INTERP_KERNEL::NormalizedCellType typ);
+ int getNumberOfGaussPt() const;
+ int getDimension() const;
+ int getNumberOfPtsInRefCell() const;
+ std::string getStringRepr() const;
+ void checkConsistencyLight() const;
+ bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const;
//
- const std::vector<double>& getRefCoords() const throw(INTERP_KERNEL::Exception);
- double getRefCoord(int ptIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
- const std::vector<double>& getGaussCoords() const throw(INTERP_KERNEL::Exception);
- double getGaussCoord(int gaussPtIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
- const std::vector<double>& getWeights() const throw(INTERP_KERNEL::Exception);
- double getWeight(int gaussPtIdInCell, double newVal) const throw(INTERP_KERNEL::Exception);
- void setRefCoord(int ptIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
- void setGaussCoord(int gaussPtIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
- void setWeight(int gaussPtIdInCell, double newVal) throw(INTERP_KERNEL::Exception);
- void setRefCoords(const std::vector<double>& refCoo) throw(INTERP_KERNEL::Exception);
- void setGaussCoords(const std::vector<double>& gsCoo) throw(INTERP_KERNEL::Exception);
- void setWeights(const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
+ const std::vector<double>& getRefCoords() const;
+ double getRefCoord(int ptIdInCell, int comp) const;
+ const std::vector<double>& getGaussCoords() const;
+ double getGaussCoord(int gaussPtIdInCell, int comp) const;
+ const std::vector<double>& getWeights() const;
+ double getWeight(int gaussPtIdInCell, double newVal) const;
+ void setRefCoord(int ptIdInCell, int comp, double newVal);
+ void setGaussCoord(int gaussPtIdInCell, int comp, double newVal);
+ void setWeight(int gaussPtIdInCell, double newVal);
+ void setRefCoords(const std::vector<double>& refCoo);
+ void setGaussCoords(const std::vector<double>& gsCoo);
+ void setWeights(const std::vector<double>& w);
//
static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
//
%extend
{
- DataArrayDouble *localizePtsInRefCooForEachCell(const DataArrayDouble *ptsInRefCoo, const MEDCouplingUMesh *mesh) const throw(INTERP_KERNEL::Exception)
+ DataArrayDouble *localizePtsInRefCooForEachCell(const DataArrayDouble *ptsInRefCoo, const MEDCouplingUMesh *mesh) const
{
MCAuto<DataArrayDouble> ret(self->localizePtsInRefCooForEachCell(ptsInRefCoo,mesh));
return ret.retn();
}
- MEDCouplingUMesh *buildRefCell() const throw(INTERP_KERNEL::Exception)
+ MEDCouplingUMesh *buildRefCell() const
{
MCAuto<MEDCouplingUMesh> ret(self->buildRefCell());
return ret.retn();
class MEDCouplingSkyLineArray
{
public:
- static MEDCouplingSkyLineArray *BuildFromPolyhedronConn( const DataArrayInt* c, const DataArrayInt* cI ) throw(INTERP_KERNEL::Exception);
+ static MEDCouplingSkyLineArray *BuildFromPolyhedronConn( const DataArrayInt* c, const DataArrayInt* cI );
void set( DataArrayInt* index, DataArrayInt* value );
void set3( DataArrayInt* superIndex, DataArrayInt* index, DataArrayInt* value );
int getNumberOf() const;
int getLength() const;
- void deletePack(const int i, const int j) throw(INTERP_KERNEL::Exception);
+ void deletePack(const int i, const int j);
- void deleteSimplePack(const int i) throw(INTERP_KERNEL::Exception);
- void deleteSimplePacks(const DataArrayInt* idx) throw(INTERP_KERNEL::Exception);
+ void deleteSimplePack(const int i);
+ void deleteSimplePacks(const DataArrayInt* idx);
%extend
{
- MEDCouplingSkyLineArray() throw(INTERP_KERNEL::Exception)
+ MEDCouplingSkyLineArray()
{
return MEDCouplingSkyLineArray::New();
}
- MEDCouplingSkyLineArray( const std::vector<int>& index, const std::vector<int>& value) throw(INTERP_KERNEL::Exception)
+ MEDCouplingSkyLineArray( const std::vector<int>& index, const std::vector<int>& value)
{
return MEDCouplingSkyLineArray::New(index, value);
}
- MEDCouplingSkyLineArray( DataArrayInt* index, DataArrayInt* value ) throw(INTERP_KERNEL::Exception)
+ MEDCouplingSkyLineArray( DataArrayInt* index, DataArrayInt* value )
{
return MEDCouplingSkyLineArray::New(index, value);
}
- MEDCouplingSkyLineArray( const MEDCouplingSkyLineArray & other ) throw(INTERP_KERNEL::Exception)
+ MEDCouplingSkyLineArray( const MEDCouplingSkyLineArray & other )
{
return MEDCouplingSkyLineArray::New(other);
}
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->simpleRepr();
}
return ret;
}
- PyObject *getSimplePackSafe(int absolutePackId) const throw(INTERP_KERNEL::Exception)
+ PyObject *getSimplePackSafe(int absolutePackId) const
{
std::vector<int> ret;
self->getSimplePackSafe(absolutePackId,ret);
return convertIntArrToPyList2(ret);
}
- PyObject *findPackIds(PyObject *superPackIndices, PyObject *pack) const throw(INTERP_KERNEL::Exception)
+ PyObject *findPackIds(PyObject *superPackIndices, PyObject *pack) const
{
std::vector<int> vpack, vspIdx, out;
return convertIntArrToPyList2(out);
}
- void pushBackPack(const int i, PyObject *pack) throw(INTERP_KERNEL::Exception)
+ void pushBackPack(const int i, PyObject *pack)
{
std::vector<int> vpack;
convertPyToNewIntArr3(pack,vpack);
self->pushBackPack(i,vpack.data(), vpack.data()+vpack.size());
}
- void replaceSimplePack(const int idx, PyObject *pack) throw(INTERP_KERNEL::Exception)
+ void replaceSimplePack(const int idx, PyObject *pack)
{
std::vector<int> vpack;
convertPyToNewIntArr3(pack,vpack);
self->replaceSimplePack(idx, vpack.data(), vpack.data()+vpack.size());
}
- void replaceSimplePacks(const DataArrayInt* idx, PyObject *listePacks) throw(INTERP_KERNEL::Exception)
+ void replaceSimplePacks(const DataArrayInt* idx, PyObject *listePacks)
{
std::vector<const DataArrayInt*> packs;
convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt*>(listePacks,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",packs);
self->replaceSimplePacks(idx, packs);
}
- void replacePack(const int superIdx, const int idx, PyObject *pack) throw(INTERP_KERNEL::Exception)
+ void replacePack(const int superIdx, const int idx, PyObject *pack)
{
std::vector<int> vpack;
convertPyToNewIntArr3(pack,vpack);
self->replacePack(superIdx, idx, vpack.data(), vpack.data()+vpack.size());
}
- PyObject *convertToPolyhedronConn() const throw(INTERP_KERNEL::Exception)
+ PyObject *convertToPolyhedronConn() const
{
MCAuto<DataArrayInt> d0=DataArrayInt::New();
MCAuto<DataArrayInt> d1=DataArrayInt::New();
class MEDCouplingPointSet : public MEDCoupling::MEDCouplingMesh
{
public:
- void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
- DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
- bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
- void zipCoords() throw(INTERP_KERNEL::Exception);
- double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
- void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
- void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
- void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
- virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingPointSet *buildPartOfMySelfSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
- virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
- static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
- static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
- static DataArrayInt *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps) throw(INTERP_KERNEL::Exception);
- virtual DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
- virtual int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
- virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
- virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
+ void setCoords(const DataArrayDouble *coords);
+ DataArrayDouble *getCoordinatesAndOwner() const;
+ bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const;
+ void zipCoords();
+ double getCaracteristicDimension() const;
+ void recenterForMaxPrecision(double eps);
+ void changeSpaceDimension(int newSpaceDim, double dftVal=0.);
+ void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon);
+ virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other);
+ virtual MEDCouplingPointSet *buildPartOfMySelfSlice(int start, int end, int step) const;
+ virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon);
+ static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2);
+ static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type);
+ static DataArrayInt *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps);
+ virtual DataArrayInt *computeFetchedNodeIds() const;
+ virtual int getNumberOfNodesInCell(int cellId) const;
+ virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const;
+ virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps);
+ virtual DataArrayInt *zipCoordsTraducer();
virtual DataArrayInt *findBoundaryNodes() const;
- virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
- virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
- virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingPointSet *deepCopyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
- virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
- virtual void renumberNodesWithOffsetInConn(int offset) throw(INTERP_KERNEL::Exception);
- virtual bool areAllNodesFetched() const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingFieldDouble *computeDiameterField() const throw(INTERP_KERNEL::Exception);
- virtual void invertOrientationOfAllCells() throw(INTERP_KERNEL::Exception);
+ virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0);
+ virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const;
+ virtual void checkFullyDefined() const;
+ virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const;
+ virtual MEDCouplingPointSet *deepCopyConnectivityOnly() const;
+ virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const;
+ virtual void renumberNodesWithOffsetInConn(int offset);
+ virtual bool areAllNodesFetched() const;
+ virtual MEDCouplingFieldDouble *computeDiameterField() const;
+ virtual void invertOrientationOfAllCells();
%extend
{
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->simpleRepr();
}
- PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
+ PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const
{
int newNbOfNodes;
DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
return res;
}
- PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
+ PyObject *findCommonNodes(double prec, int limitTupleId=-1) const
{
DataArrayInt *comm, *commIndex;
self->findCommonNodes(prec,limitTupleId,comm,commIndex);
return res;
}
- PyObject *getCoords() throw(INTERP_KERNEL::Exception)
+ PyObject *getCoords()
{
DataArrayDouble *ret1=self->getCoords();
if (ret1)
return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIG_POINTER_OWN | 0);
}
- PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
+ PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const
{
int szArr,sw,iTypppArr;
std::vector<int> stdvecTyyppArr;
return convertMesh(ret, SWIG_POINTER_OWN | 0 );
}
- PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
+ PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const
{
int szArr,sw,iTypppArr;
std::vector<int> stdvecTyyppArr;
return convertMesh(ret, SWIG_POINTER_OWN | 0 );
}
- virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
+ virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const
{
int szArr,sw,iTypppArr;
std::vector<int> stdvecTyyppArr;
return convertMesh(ret, SWIG_POINTER_OWN | 0 );
}
- virtual PyObject *buildPartOfMySelfKeepCoordsSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
+ virtual PyObject *buildPartOfMySelfKeepCoordsSlice(int start, int end, int step) const
{
MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoordsSlice(start,end,step);
return convertMesh(ret, SWIG_POINTER_OWN | 0 );
}
- PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
+ PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const
{
int szArr,sw,iTypppArr;
std::vector<int> stdvecTyyppArr;
return convertMesh(ret, SWIG_POINTER_OWN | 0 );
}
- void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
+ void renumberNodes(PyObject *li, int newNbOfNodes)
{
int szArr,sw,iTypppArr;
std::vector<int> stdvecTyyppArr;
self->renumberNodes(tmp,newNbOfNodes);
}
- void renumberNodesCenter(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
+ void renumberNodesCenter(PyObject *li, int newNbOfNodes)
{
int szArr,sw,iTypppArr;
std::vector<int> stdvecTyyppArr;
self->renumberNodesCenter(tmp,newNbOfNodes);
}
- PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
+ PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const
{
int spaceDim=self->getSpaceDimension();
double val,val2;
std::copy(nodes.begin(),nodes.end(),ret->getPointer());
return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
- PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
+ PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const
{
int spaceDim=self->getSpaceDimension();
double val,val2;
return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
- PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
+ PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const
{
double val;
DataArrayDouble *a;
return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
- PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
+ PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const
{
DataArrayInt *c=0,*cI=0;
//
return ret;
}
- PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
+ PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const
{
DataArrayInt *c=0,*cI=0;
int spaceDim=self->getSpaceDimension();
return ret;
}
- PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
+ PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const
{
double val;
DataArrayDouble *a;
return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
- void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
+ void duplicateNodesInCoords(PyObject *li)
{
int sw;
int singleVal;
}
}
- virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
+ virtual PyObject *findCommonCells(int compType, int startCellId=0) const
{
DataArrayInt *v0(nullptr),*v1(nullptr);
self->findCommonCells(compType,startCellId,v0,v1);
}
- virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
+ virtual void renumberNodesInConn(PyObject *li)
{
void *da(nullptr);
{
}
}
- virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
+ virtual PyObject *getNodeIdsInUse() const
{
int ret1=-1;
DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
return ret;
}
- virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
+ virtual PyObject *mergeNodes(double precision)
{
bool ret1;
int ret2;
return res;
}
- virtual PyObject *mergeNodesCenter(double precision) throw(INTERP_KERNEL::Exception)
+ virtual PyObject *mergeNodesCenter(double precision)
{
bool ret1;
int ret2;
return res;
}
- DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
+ DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const
{
void *da=0;
int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
}
}
- MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
+ MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI)
{
int sw;
int singleVal;
}
}
- static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
+ static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords)
{
int sz;
INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
}
- static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
+ static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords)
{
int sz;
INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,const_cast<double *>(coo));
}
- static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
+ static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords)
{
int sz,sz2;
INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
}
- static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
+ static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords)
{
int sz,sz2;
INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
INTERP_KERNEL::NormalizedCellType getType() const;
%extend
{
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->repr();
}
- PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
+ PyObject *getAllConn() const
{
int ret2;
const int *r=self->getAllConn(ret2);
class MEDCouplingUMesh : public MEDCoupling::MEDCouplingPointSet
{
public:
- static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
- static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
- void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
- void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
- void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
- void finishInsertingCells() throw(INTERP_KERNEL::Exception);
- MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
- void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
- INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
- void setPartOfMySelfSlice(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
- int getNodalConnectivityArrayLen() const throw(INTERP_KERNEL::Exception);
- void computeTypes() throw(INTERP_KERNEL::Exception);
- std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
- MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
+ static MEDCouplingUMesh *New();
+ static MEDCouplingUMesh *New(const char *meshName, int meshDim);
+ void checkConsistencyLight() const;
+ void setMeshDimension(int meshDim);
+ void allocateCells(int nbOfCells=0);
+ void finishInsertingCells();
+ MEDCouplingUMeshCellByTypeEntry *cellsByType();
+ void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true);
+ INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const;
+ void setPartOfMySelfSlice(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis);
+ int getNodalConnectivityArrayLen() const;
+ void computeTypes();
+ std::string reprConnectivityOfThis() const;
+ MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const;
//tools
- DataArrayInt *conformize2D(double eps) throw(INTERP_KERNEL::Exception);
- DataArrayInt *conformize3D(double eps) throw(INTERP_KERNEL::Exception);
- DataArrayInt *colinearize2D(double eps) throw(INTERP_KERNEL::Exception);
- DataArrayInt *colinearizeKeepingConform2D(double eps) throw(INTERP_KERNEL::Exception);
- void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
- std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
- DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
- MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
- bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
- bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
- DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
- DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
- DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
- DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
- MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
- MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
- MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
- MEDCouplingUMesh *explodeMeshIntoMicroEdges(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
- void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
- bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
- bool isFullyQuadratic() const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
- bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
- void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
- void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
- DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
- void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
- DataArrayInt *convertDegeneratedCellsAndRemoveFlatOnes() throw(INTERP_KERNEL::Exception);
- bool removeDegenerated1DCells() throw(INTERP_KERNEL::Exception);
- bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *computePlaneEquationOf3DFaces() const throw(INTERP_KERNEL::Exception);
- DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
- std::string cppRepr() const throw(INTERP_KERNEL::Exception);
- DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
- DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
- MEDCoupling::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
- MEDCouplingSkyLineArray *generateGraph() const throw(INTERP_KERNEL::Exception);
- DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
- DataArrayInt *buildUnionOf2DMesh() const throw(INTERP_KERNEL::Exception);
- DataArrayInt *buildUnionOf3DMesh() const throw(INTERP_KERNEL::Exception);
- DataArrayInt *orderConsecutiveCells1D() const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *getBoundingBoxForBBTreeFast() const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
- void changeOrientationOfCells() throw(INTERP_KERNEL::Exception);
- int split2DCells(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *subNodesInSeg, const DataArrayInt *subNodesInSegI, const DataArrayInt *midOpt=0, const DataArrayInt *midOptI=0) throw(INTERP_KERNEL::Exception);
- static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
- static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
- static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
- static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
- static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
+ DataArrayInt *conformize2D(double eps);
+ DataArrayInt *conformize3D(double eps);
+ DataArrayInt *colinearize2D(double eps);
+ DataArrayInt *colinearizeKeepingConform2D(double eps);
+ void shiftNodeNumbersInConn(int delta);
+ std::vector<bool> getQuadraticStatus() const;
+ DataArrayInt *findCellIdsOnBoundary() const;
+ MEDCouplingUMesh *computeSkin() const;
+ bool checkConsecutiveCellTypes() const;
+ bool checkConsecutiveCellTypesForMEDFileFrmt() const;
+ DataArrayInt *rearrange2ConsecutiveCellTypes();
+ DataArrayInt *sortCellsInMEDFileFrmt();
+ DataArrayInt *getRenumArrForMEDFileFrmt() const;
+ DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const;
+ MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const;
+ MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const;
+ MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const;
+ MEDCouplingUMesh *explodeMeshIntoMicroEdges(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const;
+ void orientCorrectlyPolyhedrons();
+ bool isPresenceOfQuadratic() const;
+ bool isFullyQuadratic() const;
+ MEDCouplingFieldDouble *buildDirectionVectorField() const;
+ bool isContiguous1D() const;
+ void tessellate2D(double eps);
+ void convertQuadraticCellsToLinear();
+ DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0);
+ void convertDegeneratedCells();
+ DataArrayInt *convertDegeneratedCellsAndRemoveFlatOnes();
+ bool removeDegenerated1DCells();
+ bool areOnlySimplexCells() const;
+ MEDCouplingFieldDouble *getEdgeRatioField() const;
+ MEDCouplingFieldDouble *getAspectRatioField() const;
+ MEDCouplingFieldDouble *getWarpField() const;
+ MEDCouplingFieldDouble *getSkewField() const;
+ DataArrayDouble *computePlaneEquationOf3DFaces() const;
+ DataArrayInt *convexEnvelop2D();
+ std::string cppRepr() const;
+ DataArrayInt *findAndCorrectBadOriented3DExtrudedCells();
+ DataArrayInt *findAndCorrectBadOriented3DCells();
+ MEDCoupling::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const;
+ MEDCouplingSkyLineArray *generateGraph() const;
+ DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const;
+ DataArrayInt *buildUnionOf2DMesh() const;
+ DataArrayInt *buildUnionOf3DMesh() const;
+ DataArrayInt *orderConsecutiveCells1D() const;
+ DataArrayDouble *getBoundingBoxForBBTreeFast() const;
+ DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const;
+ DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const;
+ void changeOrientationOfCells();
+ DataArrayDouble *computeCellCenterOfMassWithPrecision(double eps);
+ int split2DCells(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *subNodesInSeg, const DataArrayInt *subNodesInSegI, const DataArrayInt *midOpt=0, const DataArrayInt *midOptI=0);
+ static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da);
+ static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2);
+ static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2);
+ static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn);
+ static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code);
%extend {
- MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
+ MEDCouplingUMesh()
{
return MEDCouplingUMesh::New();
}
- MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
+ MEDCouplingUMesh(const char *meshName, int meshDim)
{
return MEDCouplingUMesh::New(meshName,meshDim);
}
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->simpleRepr();
}
- std::string __repr__() const throw(INTERP_KERNEL::Exception)
+ std::string __repr__() const
{
std::ostringstream oss;
self->reprQuickOverview(oss);
return oss.str();
}
- MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
+ MEDCouplingUMeshCellIterator *__iter__()
{
return self->cellIterator();
}
- static MEDCouplingUMesh *Build1DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
+ static MEDCouplingUMesh *Build1DMeshFromCoords(DataArrayDouble *da)
{
MCAuto<MEDCouplingUMesh> ret(MEDCouplingUMesh::Build1DMeshFromCoords(da));
return ret.retn();
}
- PyObject *getAllGeoTypesSorted() const throw(INTERP_KERNEL::Exception)
+ PyObject *getAllGeoTypesSorted() const
{
std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
return res;
}
- void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
+ void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis)
{
int sw;
int singleVal;
}
}
- void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
+ void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis)
{
int sw;
int singleVal;
}
}
- void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
+ void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li)
{
int szArr,sw,iTypppArr;
std::vector<int> stdvecTyyppArr;
self->insertNextCell(type,size,tmp);
}
- void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
+ void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li)
{
int szArr,sw,iTypppArr;
std::vector<int> stdvecTyyppArr;
self->insertNextCell(type,szArr,tmp);
}
- DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
+ DataArrayInt *getNodalConnectivity()
{
DataArrayInt *ret=self->getNodalConnectivity();
if(ret)
ret->incrRef();
return ret;
}
- DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
+ DataArrayInt *getNodalConnectivityIndex()
{
DataArrayInt *ret=self->getNodalConnectivityIndex();
if(ret)
return ret;
}
- static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
+ static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1)
{
int szArr,sw,iTypppArr;
std::vector<int> stdvecTyyppArr;
return res;
}
- static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
+ static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI)
{
DataArrayInt *v0=0,*v1=0;
MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
return res;
}
- PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
+ PyObject *distanceToPoint(PyObject *point) const
{
double val;
DataArrayDouble *a;
return ret;
}
- PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
+ PyObject *distanceToPoints(const DataArrayDouble *pts) const
{
DataArrayInt *ret1=0;
DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
return ret;
}
- PyObject *tetrahedrize(int policy) throw(INTERP_KERNEL::Exception)
+ PyObject *tetrahedrize(int policy)
{
int ret2(-1);
DataArrayInt *ret1(0);
return ret;
}
- PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
+ PyObject *checkButterflyCells(double eps=1e-12)
{
std::vector<int> cells;
self->checkButterflyCells(cells,eps);
return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
- PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
+ PyObject *splitByType() const
{
std::vector<MEDCouplingUMesh *> ms=self->splitByType();
int sz=ms.size();
return ret;
}
- PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
+ PyObject *partitionBySpreadZone() const
{
std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
int sz=retCpp.size();
return ret;
}
- static PyObject *PartitionBySpreadZone(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
+ static PyObject *PartitionBySpreadZone(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn)
{
std::vector<DataArrayInt *> retCpp(MEDCouplingUMesh::PartitionBySpreadZone(arrIn,arrIndxIn));
int sz=retCpp.size();
return ret;
}
- PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
+ PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const
{
int size;
INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
}
- bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
+ bool checkConsecutiveCellTypesAndOrder(PyObject *li) const
{
int sz;
INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
return ret;
}
- DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
+ DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const
{
int sz;
INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
return ret;
}
- PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
+ PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const
{
DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
return ret;
}
- PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
+ PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const
{
DataArrayInt *tmp0=0,*tmp1=0;
self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
return ret;
}
- void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
+ void duplicateNodes(PyObject *li)
{
int sw;
int singleVal;
}
}
- void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
+ void duplicateNodesInConn(PyObject *li, int offset)
{
int sw;
int singleVal;
}
}
- void attractSeg3MidPtsAroundNodes(double ratio, PyObject *nodeIds) throw(INTERP_KERNEL::Exception)
+ void attractSeg3MidPtsAroundNodes(double ratio, PyObject *nodeIds)
{
int szArr,sw,iTypppArr;
std::vector<int> stdvecTyyppArr;
self->attractSeg3MidPtsAroundNodes(ratio,nodeIdsPtr,nodeIdsPtr+szArr);
}
- PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
+ PyObject *getLevArrPerCellTypes(PyObject *li) const
{
int sz;
INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
return ret;
}
- PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
+ PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const
{
DataArrayInt *ret0=0,*ret1=0;
self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
return ret;
}
- static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
+ static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms)
{
std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
return ret;
}
- static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
+ static PyObject *MergeUMeshesOnSameCoords(PyObject *ms)
{
std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
return convertMesh(ret, SWIG_POINTER_OWN | 0 );
}
- static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
+ static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType)
{
int sz;
std::vector<const MEDCouplingUMesh *> meshes;
return ret;
}
- static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
+ static void PutUMeshesOnSameAggregatedCoords(PyObject *ms)
{
std::vector<MEDCouplingUMesh *> meshes;
convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
}
- static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
+ static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps)
{
std::vector<MEDCouplingUMesh *> meshes;
convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
}
- static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
- {
- int sw;
- int singleVal;
- std::vector<int> multiVal;
- std::pair<int, std::pair<int,int> > slic;
- MEDCoupling::DataArrayInt *daIntTyypp=0;
- if(!arrIndx)
- throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
- convertIntStarOrSliceLikePyObjToCpp(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
- switch(sw)
- {
- case 1:
- return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
- case 2:
- return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
- case 4:
- return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
- default:
- throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
- }
- }
-
- static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
- {
- DataArrayInt *arrOut=0,*arrIndexOut=0;
- int sw;
- int singleVal;
- std::vector<int> multiVal;
- std::pair<int, std::pair<int,int> > slic;
- MEDCoupling::DataArrayInt *daIntTyypp=0;
- if(!arrIndxIn)
- throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
- convertIntStarOrSliceLikePyObjToCpp(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
- switch(sw)
- {
- case 1:
- {
- MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
- break;
- }
- case 2:
- {
- MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
- break;
- }
- case 4:
- {
- MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
- break;
- }
- default:
- throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
- }
- PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- return ret;
- }
-
- static PyObject *ExtractFromIndexedArraysSlice(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
- {
- DataArrayInt *arrOut=0,*arrIndexOut=0;
- MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
- PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- return ret;
- }
-
- static PyObject *ExtractFromIndexedArraysSlice(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
- {
- if(!PySlice_Check(slic))
- throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : the first param is not a pyslice !");
- Py_ssize_t strt=2,stp=2,step=2;
- if(!arrIndxIn)
- throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : last array is null !");
- arrIndxIn->checkAllocated();
- if(arrIndxIn->getNumberOfComponents()!=1)
- throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : number of components of last argument must be equal to one !");
- GetIndicesOfSlice(slic,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArraysSlice (wrap) : Invalid slice regarding nb of elements !");
- DataArrayInt *arrOut=0,*arrIndexOut=0;
- MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
- PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- return ret;
- }
-
- static PyObject *SetPartOfIndexedArrays(PyObject *li,
- const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
- const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
- {
- DataArrayInt *arrOut=0,*arrIndexOut=0;
- int sw;
- int singleVal;
- std::vector<int> multiVal;
- std::pair<int, std::pair<int,int> > slic;
- MEDCoupling::DataArrayInt *daIntTyypp=0;
- if(!arrIndxIn)
- throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
- convertIntStarOrSliceLikePyObjToCpp(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
- switch(sw)
- {
- case 1:
- {
- MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
- break;
- }
- case 2:
- {
- MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
- break;
- }
- case 4:
- {
- MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
- break;
- }
- default:
- throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
- }
- PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- return ret;
- }
-
- static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
- const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
- {
- int sw;
- int singleVal;
- std::vector<int> multiVal;
- std::pair<int, std::pair<int,int> > slic;
- MEDCoupling::DataArrayInt *daIntTyypp=0;
- if(!arrIndxIn)
- throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
- convertIntStarOrSliceLikePyObjToCpp(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
- switch(sw)
- {
- case 1:
- {
- MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
- break;
- }
- case 2:
- {
- MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
- break;
- }
- case 4:
- {
- MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
- break;
- }
- default:
- throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
- }
- }
-
- PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
+ PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const
{
double val;
DataArrayDouble *a;
return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
- void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
+ void orientCorrectly2DCells(PyObject *vec, bool polyOnly)
{
double val;
DataArrayDouble *a;
self->orientCorrectly2DCells(v,polyOnly);
}
- PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
+ PyObject *arePolyhedronsNotCorrectlyOriented() const
{
std::vector<int> cells;
self->arePolyhedronsNotCorrectlyOriented(cells);
return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
- PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
+ PyObject *getFastAveragePlaneOfThis() const
{
double vec[3];
double pos[3];
return convertDblArrToPyListOfTuple<double>(vals,3,2);
}
- static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
+ static MEDCouplingUMesh *MergeUMeshes(PyObject *li)
{
std::vector<const MEDCoupling::MEDCouplingUMesh *> tmp;
convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
return MEDCouplingUMesh::MergeUMeshes(tmp);
}
- PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
+ PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const
{
DataArrayInt *ret1;
bool ret0=self->areCellsIncludedIn(other,compType,ret1);
return ret;
}
- PyObject *areCellsIncludedInPolicy7(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
+ PyObject *areCellsIncludedInPolicy7(const MEDCouplingUMesh *other) const
{
DataArrayInt *ret1;
bool ret0=self->areCellsIncludedInPolicy7(other,ret1);
return ret;
}
- PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
+ PyObject *explode3DMeshTo1D() const
{
MCAuto<DataArrayInt> d0=DataArrayInt::New();
MCAuto<DataArrayInt> d1=DataArrayInt::New();
return ret;
}
- PyObject *explodeIntoEdges() const throw(INTERP_KERNEL::Exception)
+ PyObject *explodeIntoEdges() const
{
MCAuto<DataArrayInt> desc,descIndex,revDesc,revDescIndx;
MCAuto<MEDCouplingUMesh> m(self->explodeIntoEdges(desc,descIndex,revDesc,revDescIndx));
return ret;
}
- PyObject *explodeMeshIntoMicroEdges() const throw(INTERP_KERNEL::Exception)
+ PyObject *explodeMeshIntoMicroEdges() const
{
MCAuto<DataArrayInt> d0=DataArrayInt::New();
MCAuto<DataArrayInt> d1=DataArrayInt::New();
return ret;
}
- PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
+ PyObject *buildDescendingConnectivity() const
{
MCAuto<DataArrayInt> d0=DataArrayInt::New();
MCAuto<DataArrayInt> d1=DataArrayInt::New();
return ret;
}
- PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
+ PyObject *buildDescendingConnectivity2() const
{
MCAuto<DataArrayInt> d0=DataArrayInt::New();
MCAuto<DataArrayInt> d1=DataArrayInt::New();
return ret;
}
- PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
+ PyObject *computeNeighborsOfCells() const
{
DataArrayInt *neighbors=0,*neighborsIdx=0;
self->computeNeighborsOfCells(neighbors,neighborsIdx);
return ret;
}
- PyObject *computeNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
+ PyObject *computeNeighborsOfNodes() const
{
DataArrayInt *neighbors=0,*neighborsIdx=0;
self->computeNeighborsOfNodes(neighbors,neighborsIdx);
return ret;
}
- PyObject *computeEnlargedNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
+ PyObject *computeEnlargedNeighborsOfNodes() const
{
MCAuto<DataArrayInt> neighbors,neighborsIdx;
self->computeEnlargedNeighborsOfNodes(neighbors,neighborsIdx);
return ret;
}
- PyObject *computeCellNeighborhoodFromNodesOne(const DataArrayInt *nodeNeigh, const DataArrayInt *nodeNeighI) const throw(INTERP_KERNEL::Exception)
+ PyObject *computeCellNeighborhoodFromNodesOne(const DataArrayInt *nodeNeigh, const DataArrayInt *nodeNeighI) const
{
MCAuto<DataArrayInt> cellNeigh,cellNeighIndex;
self->computeCellNeighborhoodFromNodesOne(nodeNeigh,nodeNeighI,cellNeigh,cellNeighIndex);
return ret;
}
- static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
+ static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI)
{
DataArrayInt *neighbors=0,*neighborsIdx=0;
MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
return ret;
}
- DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
+ DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const
{
if(!da)
throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
}
- DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
+ DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const
{
if(!da)
throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
}
- MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
+ MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const
{
if(!da)
throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
}
- PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
+ PyObject *getTypesOfPart(DataArrayInt *da) const
{
if(!da)
throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
return res;
}
- DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
+ DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const
{
if(!da)
throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
return ret;
}
- static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
+ static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps)
{
DataArrayInt *cellNb1=0,*cellNb2=0;
MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
return ret;
}
- static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps) throw(INTERP_KERNEL::Exception)
+ static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps)
{
MEDCouplingUMesh *splitMesh2D(0),*splitMesh1D(0);
DataArrayInt *cellIdInMesh2D(0),*cellIdInMesh1D(0);
return ret;
}
- PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
+ PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const
{
int spaceDim=self->getSpaceDimension();
if(spaceDim!=3)
return ret;
}
- PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
+ PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const
{
int spaceDim=self->getSpaceDimension();
if(spaceDim!=3)
return ret;
}
- MEDCouplingUMesh *clipSingle3DCellByPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
+ MEDCouplingUMesh *clipSingle3DCellByPlane(PyObject *origin, PyObject *vec, double eps) const
{
double val,val2;
DataArrayDouble *a,*a2;
return ret.retn();
}
- DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
+ DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const
{
int spaceDim=self->getSpaceDimension();
if(spaceDim!=3)
return self->getCellIdsCrossingPlane(orig,vect,eps);
}
- void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
+ void convertToPolyTypes(PyObject *li)
{
int sw;
int pos1;
}
}
void convertAllToPoly();
- void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
- bool unPolyze() throw(INTERP_KERNEL::Exception);
- void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
- MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
- MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
+ void convertExtrudedPolyhedra();
+ bool unPolyze();
+ void simplifyPolyhedra(double eps);
+ MEDCouplingUMesh *buildSpreadZonesWithPoly() const;
+ MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy);
};
//== MEDCouplingUMesh End
class MEDCouplingMappedExtrudedMesh : public MEDCoupling::MEDCouplingMesh
{
public:
- static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
- static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception);
- MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
+ static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId);
+ static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingCMesh *mesh3D);
+ MEDCouplingUMesh *build3DUnstructuredMesh() const;
int get2DCellIdForExtrusion() const;
%extend {
- MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
+ MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId)
{
return MEDCouplingMappedExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
}
- MEDCouplingMappedExtrudedMesh(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception)
+ MEDCouplingMappedExtrudedMesh(const MEDCouplingCMesh *mesh3D)
{
return MEDCouplingMappedExtrudedMesh::New(mesh3D);
}
return MEDCouplingMappedExtrudedMesh::New();
}
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->simpleRepr();
}
- std::string __repr__() const throw(INTERP_KERNEL::Exception)
+ std::string __repr__() const
{
std::ostringstream oss;
self->reprQuickOverview(oss);
return oss.str();
}
- PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
+ PyObject *getMesh2D() const
{
MEDCouplingUMesh *ret=self->getMesh2D();
if(ret)
ret->incrRef();
return convertMesh(ret, SWIG_POINTER_OWN | 0 );
}
- PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
+ PyObject *getMesh1D() const
{
MEDCouplingUMesh *ret=self->getMesh1D();
if(ret)
ret->incrRef();
return convertMesh(ret, SWIG_POINTER_OWN | 0 );
}
- PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
+ PyObject *getMesh3DIds() const
{
DataArrayInt *ret=self->getMesh3DIds();
if(ret)
class MEDCoupling1GTUMesh : public MEDCoupling::MEDCouplingPointSet
{
public:
- static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
- static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
- INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
- int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
- virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
- virtual void checkConsistencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
+ static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type);
+ static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m);
+ INTERP_KERNEL::NormalizedCellType getCellModelEnum() const;
+ int getNodalConnectivityLength() const;
+ virtual void allocateCells(int nbOfCells=0);
+ virtual void checkConsistencyOfConnectivity() const;
%extend
{
- virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
+ virtual void insertNextCell(PyObject *li)
{
int szArr,sw,iTypppArr;
std::vector<int> stdvecTyyppArr;
self->insertNextCell(tmp,tmp+szArr);
}
- virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
+ virtual DataArrayInt *getNodalConnectivity() const
{
DataArrayInt *ret=self->getNodalConnectivity();
if(ret) ret->incrRef();
return ret;
}
- static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
+ static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li)
{
std::vector< const MEDCoupling1GTUMesh *> parts;
convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
class MEDCoupling1SGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
{
public:
- static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
- static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
- void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
- int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
- static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
- MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
- MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
- MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const throw(INTERP_KERNEL::Exception);
- DataArrayInt *sortHexa8EachOther() throw(INTERP_KERNEL::Exception);
+ static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type);
+ static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m);
+ void setNodalConnectivity(DataArrayInt *nodalConn);
+ int getNumberOfNodesPerCell() const;
+ static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2);
+ MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const;
+ MEDCoupling1GTUMesh *computeDualMesh() const;
+ MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const;
+ DataArrayInt *sortHexa8EachOther();
%extend
{
MEDCoupling1SGTUMesh()
return MEDCoupling1SGTUMesh::New();
}
- MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
+ MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type)
{
return MEDCoupling1SGTUMesh::New(name,type);
}
- MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
+ MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m)
{
return MEDCoupling1SGTUMesh::New(m);
}
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->simpleRepr();
}
- std::string __repr__() const throw(INTERP_KERNEL::Exception)
+ std::string __repr__() const
{
std::ostringstream oss;
self->reprQuickOverview(oss);
return oss.str();
}
- PyObject *structurizeMe(double eps=1e-12) const throw(INTERP_KERNEL::Exception)
+ PyObject *structurizeMe(double eps=1e-12) const
{
DataArrayInt *cellPerm(0),*nodePerm(0);
MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
return ret;
}
- static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
+ static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li)
{
std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
}
- static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
+ static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li)
{
std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
class MEDCoupling1DGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
{
public:
- static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
- static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
- void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
- MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
- bool isPacked() const throw(INTERP_KERNEL::Exception);
+ static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type);
+ static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m);
+ void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex);
+ MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const;
+ bool isPacked() const;
%extend
{
MEDCoupling1DGTUMesh()
{
return MEDCoupling1DGTUMesh::New();
}
- MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
+ MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type)
{
return MEDCoupling1DGTUMesh::New(name,type);
}
- MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
+ MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m)
{
return MEDCoupling1DGTUMesh::New(m);
}
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->simpleRepr();
}
- std::string __repr__() const throw(INTERP_KERNEL::Exception)
+ std::string __repr__() const
{
std::ostringstream oss;
self->reprQuickOverview(oss);
return oss.str();
}
- DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
+ DataArrayInt *getNodalConnectivityIndex() const
{
DataArrayInt *ret=self->getNodalConnectivityIndex();
if(ret) ret->incrRef();
return ret;
}
- PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
+ PyObject *retrievePackedNodalConnectivity() const
{
DataArrayInt *ret1=0,*ret2=0;
bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
return ret;
}
- PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
+ PyObject *copyWithNodalConnectivityPacked() const
{
bool ret1;
MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
return ret;
}
- static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
+ static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li)
{
std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
}
- static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
+ static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li)
{
std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
}
- static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
+ static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt)
{
std::vector<const MEDCoupling::DataArrayInt *> tmp;
convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
class MEDCouplingStructuredMesh : public MEDCoupling::MEDCouplingMesh
{
public:
- int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
- int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
- int getNumberOfCellsOfSubLevelMesh() const throw(INTERP_KERNEL::Exception);
- int getSpaceDimensionOnNodeStruct() const throw(INTERP_KERNEL::Exception);
- double computeSquareness() const throw(INTERP_KERNEL::Exception);
- virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
- std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
- MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
- std::vector<int> getLocationFromCellId(int cellId) const throw(INTERP_KERNEL::Exception);
- std::vector<int> getLocationFromNodeId(int cellId) const throw(INTERP_KERNEL::Exception);
- static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
- MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const throw(INTERP_KERNEL::Exception);
- static int DeduceNumberOfGivenStructure(const std::vector<int>& st) throw(INTERP_KERNEL::Exception);
- static DataArrayInt *ComputeCornersGhost(const std::vector<int>& st, int ghostLev) throw(INTERP_KERNEL::Exception);
- static std::vector<int> GetSplitVectFromStruct(const std::vector<int>& strct) throw(INTERP_KERNEL::Exception);
+ int getCellIdFromPos(int i, int j, int k) const;
+ int getNodeIdFromPos(int i, int j, int k) const;
+ int getNumberOfCellsOfSubLevelMesh() const;
+ int getSpaceDimensionOnNodeStruct() const;
+ double computeSquareness() const;
+ virtual std::vector<int> getNodeGridStructure() const;
+ std::vector<int> getCellGridStructure() const;
+ MEDCoupling1SGTUMesh *build1SGTUnstructured() const;
+ std::vector<int> getLocationFromCellId(int cellId) const;
+ std::vector<int> getLocationFromNodeId(int cellId) const;
+ static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim);
+ MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const;
+ static int DeduceNumberOfGivenStructure(const std::vector<int>& st);
+ static DataArrayInt *ComputeCornersGhost(const std::vector<int>& st, int ghostLev);
+ static std::vector<int> GetSplitVectFromStruct(const std::vector<int>& strct);
%extend
{
- virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
+ virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const
{
int tmpp1=-1,tmpp2=-1;
std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
return self->buildStructuredSubPart(inp);
}
- static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
+ static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part)
{
std::vector< std::pair<int,int> > inp;
convertPyToVectorPairInt(part,inp);
return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
}
- static void MultiplyPartOf(const std::vector<int>& st, PyObject *part, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
+ static void MultiplyPartOf(const std::vector<int>& st, PyObject *part, double factor, DataArrayDouble *da)
{
std::vector< std::pair<int,int> > inp;
convertPyToVectorPairInt(part,inp);
MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
}
- static void MultiplyPartOfByGhost(const std::vector<int>& st, PyObject *part, int ghostSize, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
+ static void MultiplyPartOfByGhost(const std::vector<int>& st, PyObject *part, int ghostSize, double factor, DataArrayDouble *da)
{
std::vector< std::pair<int,int> > inp;
convertPyToVectorPairInt(part,inp);
MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
}
- static PyObject *PutInGhostFormat(int ghostSize, const std::vector<int>& st, PyObject *part) throw(INTERP_KERNEL::Exception)
+ static PyObject *PutInGhostFormat(int ghostSize, const std::vector<int>& st, PyObject *part)
{
std::vector< std::pair<int,int> > inp;
convertPyToVectorPairInt(part,inp);
return ret;
}
- static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<int>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
+ static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<int>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat)
{
std::vector< std::pair<int,int> > inp;
convertPyToVectorPairInt(partCompactFormat,inp);
return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
}
- static void AssignPartOfFieldOfDoubleUsing(const std::vector<int>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
+ static void AssignPartOfFieldOfDoubleUsing(const std::vector<int>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other)
{
std::vector< std::pair<int,int> > inp;
convertPyToVectorPairInt(partCompactFormat,inp);
MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
}
- static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part) throw(INTERP_KERNEL::Exception)
+ static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part)
{
std::vector< std::pair<int,int> > inp;
convertPyToVectorPairInt(part,inp);
return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
}
- static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
+ static DataArrayInt *Build1GTNodalConnectivity(PyObject *li)
{
int szArr,sw,iTypppArr;
std::vector<int> stdvecTyyppArr;
return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
}
- static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
+ static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li)
{
int szArr,sw,iTypppArr;
std::vector<int> stdvecTyyppArr;
return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
}
- static std::vector<int> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
+ static std::vector<int> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat)
{
std::vector< std::pair<int,int> > inp;
convertPyToVectorPairInt(partCompactFormat,inp);
return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
}
- static PyObject *GetCompactFrmtFromDimensions(const std::vector<int>& dims) throw(INTERP_KERNEL::Exception)
+ static PyObject *GetCompactFrmtFromDimensions(const std::vector<int>& dims)
{
std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
PyObject *retPy=PyList_New(ret.size());
return retPy;
}
- static PyObject *IntersectRanges(PyObject *r1, PyObject *r2) throw(INTERP_KERNEL::Exception)
+ static PyObject *IntersectRanges(PyObject *r1, PyObject *r2)
{
std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
convertPyToVectorPairInt(r1,r1Cpp);
return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
}
- static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
+ static PyObject *IsPartStructured(PyObject *li, PyObject *st)
{
int szArr,sw,iTypppArr;
std::vector<int> stdvecTyyppArr;
return ret;
}
- static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true) throw(INTERP_KERNEL::Exception)
+ static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true)
{
std::vector< std::pair<int,int> > param0,param1,ret;
convertPyToVectorPairInt(bigInAbs,param0);
return retPy;
}
- static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<int>& translation) throw(INTERP_KERNEL::Exception)
+ static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<int>& translation)
{
std::vector< std::pair<int,int> > param0;
convertPyToVectorPairInt(part,param0);
return retPy;
}
- static std::vector<int> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo) throw(INTERP_KERNEL::Exception)
+ static std::vector<int> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo)
{
std::vector< std::pair<int,int> > param0,param1;
convertPyToVectorPairInt(startingFrom,param0);
return MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
}
- static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true) throw(INTERP_KERNEL::Exception)
+ static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true)
{
std::vector< std::pair<int,int> > param0,param1,ret;
convertPyToVectorPairInt(bigInAbs,param0);
class MEDCouplingCMesh : public MEDCoupling::MEDCouplingStructuredMesh
{
public:
- static MEDCouplingCMesh *New() throw(INTERP_KERNEL::Exception);
- static MEDCouplingCMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
+ static MEDCouplingCMesh *New();
+ static MEDCouplingCMesh *New(const std::string& meshName);
void setCoords(const DataArrayDouble *coordsX,
const DataArrayDouble *coordsY=0,
- const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
- void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
- MEDCouplingCurveLinearMesh *buildCurveLinear() const throw(INTERP_KERNEL::Exception);
+ const DataArrayDouble *coordsZ=0);
+ void setCoordsAt(int i, const DataArrayDouble *arr);
+ MEDCouplingCurveLinearMesh *buildCurveLinear() const;
%extend {
- MEDCouplingCMesh() throw(INTERP_KERNEL::Exception)
+ MEDCouplingCMesh()
{
return MEDCouplingCMesh::New();
}
- MEDCouplingCMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
+ MEDCouplingCMesh(const std::string& meshName)
{
return MEDCouplingCMesh::New(meshName);
}
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->simpleRepr();
}
- std::string __repr__() const throw(INTERP_KERNEL::Exception)
+ std::string __repr__() const
{
std::ostringstream oss;
self->reprQuickOverview(oss);
return oss.str();
}
- DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
+ DataArrayDouble *getCoordsAt(int i)
{
DataArrayDouble *ret=self->getCoordsAt(i);
if(ret)
class MEDCouplingCurveLinearMesh : public MEDCoupling::MEDCouplingStructuredMesh
{
public:
- static MEDCouplingCurveLinearMesh *New() throw(INTERP_KERNEL::Exception);
- static MEDCouplingCurveLinearMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
- void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
+ static MEDCouplingCurveLinearMesh *New();
+ static MEDCouplingCurveLinearMesh *New(const std::string& meshName);
+ void setCoords(const DataArrayDouble *coords);
%extend {
- MEDCouplingCurveLinearMesh() throw(INTERP_KERNEL::Exception)
+ MEDCouplingCurveLinearMesh()
{
return MEDCouplingCurveLinearMesh::New();
}
- MEDCouplingCurveLinearMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
+ MEDCouplingCurveLinearMesh(const std::string& meshName)
{
return MEDCouplingCurveLinearMesh::New(meshName);
}
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->simpleRepr();
}
- std::string __repr__() const throw(INTERP_KERNEL::Exception)
+ std::string __repr__() const
{
std::ostringstream oss;
self->reprQuickOverview(oss);
return oss.str();
}
- DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
+ DataArrayDouble *getCoords()
{
DataArrayDouble *ret=self->getCoords();
if(ret)
ret->incrRef();
return ret;
}
- void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
+ void setNodeGridStructure(PyObject *gridStruct)
{
int szArr,sw,iTypppArr;
std::vector<int> stdvecTyyppArr;
class MEDCouplingIMesh : public MEDCoupling::MEDCouplingStructuredMesh
{
public:
- static MEDCouplingIMesh *New() throw(INTERP_KERNEL::Exception);
+ static MEDCouplingIMesh *New();
//
- void setSpaceDimension(int spaceDim) throw(INTERP_KERNEL::Exception);
- std::vector<int> getNodeStruct() const throw(INTERP_KERNEL::Exception);
- std::vector<double> getOrigin() const throw(INTERP_KERNEL::Exception);
- std::vector<double> getDXYZ() const throw(INTERP_KERNEL::Exception);
- void setAxisUnit(const std::string& unitName) throw(INTERP_KERNEL::Exception);
- std::string getAxisUnit() const throw(INTERP_KERNEL::Exception);
- double getMeasureOfAnyCell() const throw(INTERP_KERNEL::Exception);
- MEDCouplingCMesh *convertToCartesian() const throw(INTERP_KERNEL::Exception);
- void refineWithFactor(const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
- MEDCouplingIMesh *asSingleCell() const throw(INTERP_KERNEL::Exception);
- MEDCouplingIMesh *buildWithGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
+ void setSpaceDimension(int spaceDim);
+ std::vector<int> getNodeStruct() const;
+ std::vector<double> getOrigin() const;
+ std::vector<double> getDXYZ() const;
+ void setAxisUnit(const std::string& unitName);
+ std::string getAxisUnit() const;
+ double getMeasureOfAnyCell() const;
+ MEDCouplingCMesh *convertToCartesian() const;
+ void refineWithFactor(const std::vector<int>& factors);
+ MEDCouplingIMesh *asSingleCell() const;
+ MEDCouplingIMesh *buildWithGhost(int ghostLev) const;
%extend
{
MEDCouplingIMesh()
{
return MEDCouplingIMesh::New();
}
- static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
+ static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
{
static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
}
- MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
+ MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
{
return MEDCoupling_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
}
- void setNodeStruct(PyObject *nodeStrct) throw(INTERP_KERNEL::Exception)
+ void setNodeStruct(PyObject *nodeStrct)
{
int sw,sz,val0;
std::vector<int> bb0;
self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
}
- void setOrigin(PyObject *origin) throw(INTERP_KERNEL::Exception)
+ void setOrigin(PyObject *origin)
{
static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
double val;
self->setOrigin(originPtr,originPtr+nbTuples);
}
- void setDXYZ(PyObject *dxyz) throw(INTERP_KERNEL::Exception)
+ void setDXYZ(PyObject *dxyz)
{
static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
double val;
self->setDXYZ(originPtr,originPtr+nbTuples);
}
- static void CondenseFineToCoarse(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA) throw(INTERP_KERNEL::Exception)
+ static void CondenseFineToCoarse(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA)
{
std::vector< std::pair<int,int> > inp;
convertPyToVectorPairInt(fineLocInCoarse,inp);
MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
}
- static void CondenseFineToCoarseGhost(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA, int ghostSize) throw(INTERP_KERNEL::Exception)
+ static void CondenseFineToCoarseGhost(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA, int ghostSize)
{
std::vector< std::pair<int,int> > inp;
convertPyToVectorPairInt(fineLocInCoarse,inp);
MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
}
- static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts) throw(INTERP_KERNEL::Exception)
+ static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts)
{
std::vector< std::pair<int,int> > inp;
convertPyToVectorPairInt(fineLocInCoarse,inp);
MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
}
- static void SpreadCoarseToFineGhost(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, int ghostSize) throw(INTERP_KERNEL::Exception)
+ static void SpreadCoarseToFineGhost(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, int ghostSize)
{
std::vector< std::pair<int,int> > inp;
convertPyToVectorPairInt(fineLocInCoarse,inp);
MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
}
- static void SpreadCoarseToFineGhostZone(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, int ghostSize) throw(INTERP_KERNEL::Exception)
+ static void SpreadCoarseToFineGhostZone(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, int ghostSize)
{
std::vector< std::pair<int,int> > inp;
convertPyToVectorPairInt(fineLocInCoarse,inp);
MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
}
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->simpleRepr();
}
- std::string __repr__() const throw(INTERP_KERNEL::Exception)
+ std::string __repr__() const
{
std::ostringstream oss;
self->reprQuickOverview(oss);
class MEDCouplingField : public MEDCoupling::RefCountObject, public MEDCoupling::TimeLabel
{
public:
- virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
- virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
- virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
- void setMesh(const MEDCoupling::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
- void setName(const char *name) throw(INTERP_KERNEL::Exception);
- std::string getDescription() const throw(INTERP_KERNEL::Exception);
- void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
- std::string getName() const throw(INTERP_KERNEL::Exception);
- TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
- NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
- virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
- DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
- int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
- int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
+ virtual void checkConsistencyLight() const;
+ virtual bool areCompatibleForMerge(const MEDCouplingField *other) const;
+ virtual void copyTinyStringsFrom(const MEDCouplingField *other);
+ void setMesh(const MEDCoupling::MEDCouplingMesh *mesh);
+ void setName(const char *name);
+ std::string getDescription() const;
+ void setDescription(const char *desc);
+ std::string getName() const;
+ TypeOfField getTypeOfField() const;
+ NatureOfField getNature() const;
+ virtual void setNature(NatureOfField nat);
+ DataArrayDouble *getLocalizationOfDiscr() const;
+ MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const;
+ int getNumberOfTuplesExpected() const;
+ int getNumberOfMeshPlacesExpected() const;
void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
- const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
- void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
- MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
- int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
- int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
- const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
- int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
+ const std::vector<double>& gsCoo, const std::vector<double>& wg);
+ void clearGaussLocalizations();
+ MEDCouplingGaussLocalization& getGaussLocalization(int locId);
+ int getNbOfGaussLocalization() const;
+ int getGaussLocalizationIdOfOneCell(int cellId) const;
+ const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const;
+ int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const;
void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
%extend {
- PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
+ PyObject *getMesh() const
{
MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
if(ret1)
return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
}
- PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
+ PyObject *getDiscretization()
{
MEDCouplingFieldDiscretization *ret=self->getDiscretization();
if(ret)
return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
}
- PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
+ PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const
{
std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
return convertIntArrToPyList3(ret);
}
- PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
+ PyObject *buildSubMeshData(PyObject *li) const
{
DataArrayInt *ret1=0;
MEDCouplingMesh *ret0=0;
return res;
}
- PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
+ PyObject *buildSubMeshDataRange(int begin, int end, int step) const
{
DataArrayInt *ret1=0;
int bb,ee,ss;
}
void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
- const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
+ const std::vector<double>& gsCoo, const std::vector<double>& wg)
{
void *da=0;
int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
}
}
- PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
+ PyObject *getCellIdsHavingGaussLocalization(int locId) const
{
std::vector<int> tmp;
self->getCellIdsHavingGaussLocalization(locId,tmp);
return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
- int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
+ int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const
{
std::vector<int> inp0;
convertPyToNewIntArr4(code,1,3,inp0);
class MEDCouplingFieldTemplate : public MEDCoupling::MEDCouplingField
{
public:
- static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
- static MEDCouplingFieldTemplate *New(const MEDCouplingFieldFloat& f) throw(INTERP_KERNEL::Exception);
- static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception);
+ static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f);
+ static MEDCouplingFieldTemplate *New(const MEDCouplingFieldFloat& f);
+ static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt& f);
static MEDCouplingFieldTemplate *New(TypeOfField type);
- std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
- std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
- bool isEqual(const MEDCouplingFieldTemplate *other, double meshPrec) const throw(INTERP_KERNEL::Exception);
- bool isEqualWithoutConsideringStr(const MEDCouplingFieldTemplate *other, double meshPrec) const throw(INTERP_KERNEL::Exception);
+ std::string simpleRepr() const;
+ std::string advancedRepr() const;
+ bool isEqual(const MEDCouplingFieldTemplate *other, double meshPrec) const;
+ bool isEqualWithoutConsideringStr(const MEDCouplingFieldTemplate *other, double meshPrec) const;
%extend
{
- MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
+ MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f)
{
return MEDCouplingFieldTemplate::New(f);
}
- MEDCouplingFieldTemplate(const MEDCouplingFieldFloat& f) throw(INTERP_KERNEL::Exception)
+ MEDCouplingFieldTemplate(const MEDCouplingFieldFloat& f)
{
return MEDCouplingFieldTemplate::New(f);
}
- MEDCouplingFieldTemplate(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception)
+ MEDCouplingFieldTemplate(const MEDCouplingFieldInt& f)
{
return MEDCouplingFieldTemplate::New(f);
}
- MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
+ MEDCouplingFieldTemplate(TypeOfField type)
{
return MEDCouplingFieldTemplate::New(type);
}
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->simpleRepr();
}
- std::string __repr__() const throw(INTERP_KERNEL::Exception)
+ std::string __repr__() const
{
std::ostringstream oss;
self->reprQuickOverview(oss);
return oss.str();
}
- PyObject *isEqualIfNotWhy(const MEDCouplingFieldTemplate *other, double meshPrec) const throw(INTERP_KERNEL::Exception)
+ PyObject *isEqualIfNotWhy(const MEDCouplingFieldTemplate *other, double meshPrec) const
{
std::string ret1;
bool ret0=self->isEqualIfNotWhy(other,meshPrec,ret1);
class MEDCouplingFieldT : public MEDCoupling::MEDCouplingField
{
public:
- TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
+ TypeOfTimeDiscretization getTimeDiscretization() const;
protected:
MEDCouplingFieldT();
~MEDCouplingFieldT();
public:
static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
- bool isEqual(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
- bool isEqualWithoutConsideringStr(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
+ bool isEqual(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const;
+ bool isEqualWithoutConsideringStr(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const;
void setTimeUnit(const std::string& unit);
std::string getTimeUnit() const;
- void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
- void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
- void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
- std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
- std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
- std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldInt *convertToIntField() const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldFloat *convertToFloatField() const throw(INTERP_KERNEL::Exception);
+ void synchronizeTimeWithSupport();
+ void copyTinyAttrFrom(const MEDCouplingFieldDouble *other);
+ void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other);
+ std::string simpleRepr() const;
+ std::string advancedRepr() const;
+ std::string writeVTK(const std::string& fileName, bool isBinary=true) const;
+ MEDCouplingFieldInt *convertToIntField() const;
+ MEDCouplingFieldFloat *convertToFloatField() const;
MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
MEDCouplingFieldDouble *deepCopy() const;
- MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *cellToNodeDiscretization() const throw(INTERP_KERNEL::Exception);
- double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
- double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
- void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
- void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
- void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
- void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
- void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
- void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
- void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
- void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
- int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
- int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
- int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
- void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
- double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
- void setIteration(int it) throw(INTERP_KERNEL::Exception);
- void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
- void setOrder(int order) throw(INTERP_KERNEL::Exception);
- void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
- void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
- void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
- void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
- void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
- bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
- bool mergeNodesCenter(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
- bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
- bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
- bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
- void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
- void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
- void fillFromAnalytic(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
- void fillFromAnalyticCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
- void fillFromAnalyticNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
- void applyFunc(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
- void applyFuncCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
- void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
- void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
- void applyFunc(const std::string& func) throw(INTERP_KERNEL::Exception);
- void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
- void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
- double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
- double getMaxValue() const throw(INTERP_KERNEL::Exception);
- double getMinValue() const throw(INTERP_KERNEL::Exception);
- double getAverageValue() const throw(INTERP_KERNEL::Exception);
- double norm2() const throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const;
+ MEDCouplingFieldDouble *nodeToCellDiscretization() const;
+ MEDCouplingFieldDouble *cellToNodeDiscretization() const;
+ double getIJ(int tupleId, int compoId) const;
+ double getIJK(int cellId, int nodeIdInCell, int compoId) const;
+ void synchronizeTimeWithMesh();
+ void setArray(DataArrayDouble *array);
+ void setEndArray(DataArrayDouble *array);
+ void setTime(double val, int iteration, int order);
+ void setStartTime(double val, int iteration, int order);
+ void setEndTime(double val, int iteration, int order);
+ void applyLin(double a, double b, int compoId);
+ void applyLin(double a, double b);
+ int getNumberOfComponents() const;
+ int getNumberOfTuples() const;
+ int getNumberOfValues() const;
+ void setTimeTolerance(double val);
+ double getTimeTolerance() const;
+ void setIteration(int it);
+ void setEndIteration(int it);
+ void setOrder(int order);
+ void setEndOrder(int order);
+ void setTimeValue(double val);
+ void setEndTimeValue(double val);
+ void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15);
+ void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15);
+ bool mergeNodes(double eps, double epsOnVals=1e-15);
+ bool mergeNodesCenter(double eps, double epsOnVals=1e-15);
+ bool zipCoords(double epsOnVals=1e-15);
+ bool zipConnectivity(int compType,double epsOnVals=1e-15);
+ bool simplexize(int policy);
+ MEDCouplingFieldDouble *doublyContractedProduct() const;
+ MEDCouplingFieldDouble *determinant() const;
+ MEDCouplingFieldDouble *eigenValues() const;
+ MEDCouplingFieldDouble *eigenVectors() const;
+ MEDCouplingFieldDouble *inverse() const;
+ MEDCouplingFieldDouble *trace() const;
+ MEDCouplingFieldDouble *deviator() const;
+ MEDCouplingFieldDouble *magnitude() const;
+ MEDCouplingFieldDouble *maxPerTuple() const;
+ void changeNbOfComponents(int newNbOfComp, double dftValue=0.);
+ void sortPerTuple(bool asc);
+ MEDCouplingFieldDouble &operator=(double value);
+ void fillFromAnalytic(int nbOfComp, const std::string& func);
+ void fillFromAnalyticCompo(int nbOfComp, const std::string& func);
+ void fillFromAnalyticNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func);
+ void applyFunc(int nbOfComp, const std::string& func);
+ void applyFuncCompo(int nbOfComp, const std::string& func);
+ void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func);
+ void applyFunc(int nbOfComp, double val);
+ void applyFunc(const std::string& func);
+ void applyFuncFast32(const std::string& func);
+ void applyFuncFast64(const std::string& func);
+ double accumulate(int compId) const;
+ double getMaxValue() const;
+ double getMinValue() const;
+ double getAverageValue() const;
+ double norm2() const;
//do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
- double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
- double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
- double normL1(int compId) const throw(INTERP_KERNEL::Exception);
- double normL2(int compId) const throw(INTERP_KERNEL::Exception);
- double normMax(int compId) const throw(INTERP_KERNEL::Exception);
- DataArrayInt *findIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
- static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
- static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
- static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
- static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
- static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
- static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
- static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
- static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
- static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
- static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
+ double getWeightedAverageValue(int compId, bool isWAbs) const;
+ double integral(int compId, bool isWAbs) const;
+ double normL1(int compId) const;
+ double normL2(int compId) const;
+ double normMax(int compId) const;
+ DataArrayInt *findIdsInRange(double vmin, double vmax) const;
+ MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const;
+ static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
+ static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
+ static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
+ MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const;
+ static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
+ MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const;
+ static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
+ MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const;
+ static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
+ static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
+ static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
+ static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
+ static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
+ MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const;
+ MEDCouplingFieldDouble *negate() const;
%extend {
MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
{
return MEDCouplingFieldDouble::New(ft,td);
}
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->simpleRepr();
}
- std::string __repr__() const throw(INTERP_KERNEL::Exception)
+ std::string __repr__() const
{
std::ostringstream oss;
self->reprQuickOverview(oss);
return oss.str();
}
- PyObject *isEqualIfNotWhy(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
+ PyObject *isEqualIfNotWhy(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const
{
std::string ret1;
bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
return ret;
}
- MEDCouplingFieldDouble *voronoize(double eps) const throw(INTERP_KERNEL::Exception)
+ MEDCouplingFieldDouble *voronoize(double eps) const
{
MCAuto<MEDCouplingFieldDouble> ret(self->voronoize(eps));
return ret.retn();
}
- MEDCouplingFieldDouble *convertQuadraticCellsToLinear() const throw(INTERP_KERNEL::Exception)
+ MEDCouplingFieldDouble *convertQuadraticCellsToLinear() const
{
MCAuto<MEDCouplingFieldDouble> ret(self->convertQuadraticCellsToLinear());
return ret.retn();
return self->computeVectorFieldCyl(centerPtr,vectorPtr);
}
- DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
+ DataArrayDouble *getArray()
{
DataArrayDouble *ret=self->getArray();
if(ret)
return ret;
}
- PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
+ PyObject *getArrays() const
{
std::vector<DataArrayDouble *> arrs=self->getArrays();
for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
return ret;
}
- void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
+ void setArrays(PyObject *ls)
{
std::vector<const DataArrayDouble *> tmp;
convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
self->setArrays(arrs);
}
- DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
+ DataArrayDouble *getEndArray()
{
DataArrayDouble *ret=self->getEndArray();
if(ret)
return ret;
}
- PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
+ PyObject *getValueOn(PyObject *sl) const
{
double val;
DataArrayDouble *a;
return convertDblArrToPyList<double>(res,sz);
}
- PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
+ PyObject *getValueOnPos(int i, int j, int k) const
{
int sz=self->getNumberOfComponents();
INTERP_KERNEL::AutoPtr<double> res=new double[sz];
return convertDblArrToPyList<double>(res,sz);
}
- DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
+ DataArrayDouble *getValueOnMulti(PyObject *locs) const
{
const MEDCouplingMesh *mesh(self->getMesh());
if(!mesh)
return self->getValueOnMulti(inp,nbPts);
}
- PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
+ PyObject *getValueOn(PyObject *sl, double time) const
{
double val;
DataArrayDouble *a;
return convertDblArrToPyList<double>(res,sz);
}
- void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
+ void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0)
{
if(self->getArray()!=0)
MEDCoupling_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
}
}
- PyObject *getTime() throw(INTERP_KERNEL::Exception)
+ PyObject *getTime()
{
int tmp1,tmp2;
double tmp0=self->getTime(tmp1,tmp2);
return res;
}
- PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
+ PyObject *getStartTime()
{
int tmp1,tmp2;
double tmp0=self->getStartTime(tmp1,tmp2);
return res;
}
- PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
+ PyObject *getEndTime()
{
int tmp1,tmp2;
double tmp0=self->getEndTime(tmp1,tmp2);
PyList_SetItem(res,2,SWIG_From_int(tmp2));
return res;
}
- PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
+ PyObject *accumulate() const
{
int sz=self->getNumberOfComponents();
INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
self->accumulate(tmp);
return convertDblArrToPyList<double>(tmp,sz);
}
- PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
+ PyObject *integral(bool isWAbs) const
{
int sz=self->getNumberOfComponents();
INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
self->integral(isWAbs,tmp);
return convertDblArrToPyList<double>(tmp,sz);
}
- PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
+ PyObject *getWeightedAverageValue(bool isWAbs=true) const
{
int sz=self->getNumberOfComponents();
INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
self->getWeightedAverageValue(tmp,isWAbs);
return convertDblArrToPyList<double>(tmp,sz);
}
- PyObject *normL1() const throw(INTERP_KERNEL::Exception)
+ PyObject *normL1() const
{
int sz=self->getNumberOfComponents();
INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
self->normL1(tmp);
return convertDblArrToPyList<double>(tmp,sz);
}
- PyObject *normL2() const throw(INTERP_KERNEL::Exception)
+ PyObject *normL2() const
{
int sz=self->getNumberOfComponents();
INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
self->normL2(tmp);
return convertDblArrToPyList<double>(tmp,sz);
}
- PyObject *normMax() const throw(INTERP_KERNEL::Exception)
+ PyObject *normMax() const
{
int sz=self->getNumberOfComponents();
INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
self->normMax(tmp);
return convertDblArrToPyList<double>(tmp,sz);
}
- void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
+ void renumberCells(PyObject *li, bool check=true)
{
int szArr,sw,iTypppArr;
std::vector<int> stdvecTyyppArr;
self->renumberCells(tmp,check);
}
- void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
+ void renumberCellsWithoutMesh(PyObject *li, bool check=true)
{
int szArr,sw,iTypppArr;
std::vector<int> stdvecTyyppArr;
self->renumberCellsWithoutMesh(tmp,check);
}
- void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
+ void renumberNodes(PyObject *li, double eps=1e-15)
{
int szArr,sw,iTypppArr;
std::vector<int> stdvecTyyppArr;
self->renumberNodes(tmp,eps);
}
- void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
+ void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15)
{
int szArr,sw,iTypppArr;
std::vector<int> stdvecTyyppArr;
self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
}
- MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
+ MEDCouplingFieldDouble *buildSubPart(PyObject *li) const
{
return fieldT_buildSubPart(self,li);
}
- MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
+ MEDCouplingFieldDouble *__getitem__(PyObject *li) const
{
return fieldT__getitem__(self,li);
}
- PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
+ PyObject *getMaxValue2() const
{
DataArrayInt *tmp;
double r1=self->getMaxValue2(tmp);
return ret;
}
- PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
+ PyObject *getMinValue2() const
{
DataArrayInt *tmp;
double r1=self->getMinValue2(tmp);
return ret;
}
- MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
+ MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const
{
std::vector<int> tmp;
convertPyToNewIntArr3(li,tmp);
return self->keepSelectedComponents(tmp);
}
- void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
+ void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li)
{
std::vector<int> tmp;
convertPyToNewIntArr3(li,tmp);
self->setSelectedComponents(f,tmp);
}
- MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
+ MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const
{
double val,val2;
DataArrayDouble *a,*a2;
return self->extractSlice3D(orig,vect,eps);
}
- MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ MEDCouplingFieldDouble *__add__(PyObject *obj)
{
return MEDCoupling_MEDCouplingFieldDouble___add__Impl(self,obj);
}
- MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ MEDCouplingFieldDouble *__radd__(PyObject *obj)
{
return MEDCoupling_MEDCouplingFieldDouble___radd__Impl(self,obj);
}
- MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ MEDCouplingFieldDouble *__sub__(PyObject *obj)
{
const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__sub__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(ret);
}
}
- MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ MEDCouplingFieldDouble *__rsub__(PyObject *obj)
{
return MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(self,obj);
}
- MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ MEDCouplingFieldDouble *__mul__(PyObject *obj)
{
return MEDCoupling_MEDCouplingFieldDouble___mul__Impl(self,obj);
}
- MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ MEDCouplingFieldDouble *__rmul__(PyObject *obj)
{
return MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(self,obj);
}
- MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ MEDCouplingFieldDouble *__div__(PyObject *obj)
{
const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__div__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(ret);
}
}
- MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ MEDCouplingFieldDouble *__rdiv__(PyObject *obj)
{
return MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
}
- MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ MEDCouplingFieldDouble *__pow__(PyObject *obj)
{
const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__pow__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(ret);
}
}
- MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
+ MEDCouplingFieldDouble *__neg__() const
{
return self->negate();
}
- PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *___iadd___(PyObject *trueSelf, PyObject *obj)
{
const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__iadd__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
self->getArray()->addEqual(aaa);
Py_XINCREF(trueSelf);
return trueSelf;
}
}
- PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *___isub___(PyObject *trueSelf, PyObject *obj)
{
const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__isub__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
self->getArray()->substractEqual(aaa);
Py_XINCREF(trueSelf);
return trueSelf;
}
}
- PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *___imul___(PyObject *trueSelf, PyObject *obj)
{
const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__imul__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
self->getArray()->multiplyEqual(aaa);
Py_XINCREF(trueSelf);
return trueSelf;
}
}
- PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *___idiv___(PyObject *trueSelf, PyObject *obj)
{
const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__idiv__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
self->getArray()->divideEqual(aaa);
Py_XINCREF(trueSelf);
return trueSelf;
}
}
- PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *___ipow___(PyObject *trueSelf, PyObject *obj)
{
const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__ipow__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
self->getArray()->powEqual(aaa);
Py_XINCREF(trueSelf);
return trueSelf;
}
}
- static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
+ static MEDCouplingFieldDouble *MergeFields(PyObject *li)
{
std::vector<const MEDCouplingFieldDouble *> tmp;
convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
return MEDCouplingFieldDouble::MergeFields(tmp);
}
- static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
+ static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true)
{
std::vector<const MEDCouplingFieldDouble *> tmp;
convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
}
- PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
+ PyObject *getTinySerializationInformation() const
{
return field_getTinySerializationInformation<MEDCouplingFieldDouble>(self);
}
- PyObject *serialize() const throw(INTERP_KERNEL::Exception)
+ PyObject *serialize() const
{
return field_serialize<double>(self);
}
- PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
+ PyObject *__getstate__() const
{
return field__getstate__<MEDCouplingFieldDouble>(self,MEDCoupling_MEDCouplingFieldDouble_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldDouble_serialize);
}
- void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
+ void __setstate__(PyObject *inp)
{
field__setstate__<double>(self,inp);
}
public:
int getNumberOfFields() const;
MEDCouplingMultiFields *deepCopy() const;
- virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
- virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
+ virtual std::string simpleRepr() const;
+ virtual std::string advancedRepr() const;
virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
- virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
+ virtual void checkConsistencyLight() const;
%extend
{
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->simpleRepr();
}
- static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
+ static MEDCouplingMultiFields *New(PyObject *li)
{
std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
return MEDCouplingMultiFields::New(fs);
}
- MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
+ MEDCouplingMultiFields(PyObject *li)
{
std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
}
return res;
}
- PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
+ PyObject *getFieldAtPos(int id) const
{
const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
if(ret)
else
return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 );
}
- PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
+ PyObject *getMeshes() const
{
std::vector<MEDCouplingMesh *> ms=self->getMeshes();
int sz=ms.size();
}
return res;
}
- PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
+ PyObject *getDifferentMeshes() const
{
std::vector<int> refs;
std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
return ret;
}
- PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
+ PyObject *getArrays() const
{
std::vector<DataArrayDouble *> ms=self->getArrays();
int sz=ms.size();
}
return res;
}
- PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
+ PyObject *getDifferentArrays() const
{
std::vector< std::vector<int> > refs;
std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
public:
static MEDCouplingFieldInt *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
static MEDCouplingFieldInt *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
- bool isEqual(const MEDCouplingFieldInt *other, double meshPrec, int valsPrec) const throw(INTERP_KERNEL::Exception);
- bool isEqualWithoutConsideringStr(const MEDCouplingFieldInt *other, double meshPrec, int valsPrec) const throw(INTERP_KERNEL::Exception);
- void setTimeUnit(const std::string& unit) throw(INTERP_KERNEL::Exception);
- std::string getTimeUnit() const throw(INTERP_KERNEL::Exception);
- void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
- void setArray(DataArrayInt *array) throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldInt *deepCopy() const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldInt *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldInt *cloneWithMesh(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *convertToDblField() const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldInt *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
+ bool isEqual(const MEDCouplingFieldInt *other, double meshPrec, int valsPrec) const;
+ bool isEqualWithoutConsideringStr(const MEDCouplingFieldInt *other, double meshPrec, int valsPrec) const;
+ void setTimeUnit(const std::string& unit);
+ std::string getTimeUnit() const;
+ void setTime(double val, int iteration, int order);
+ void setArray(DataArrayInt *array);
+ MEDCouplingFieldInt *deepCopy() const;
+ MEDCouplingFieldInt *clone(bool recDeepCpy) const;
+ MEDCouplingFieldInt *cloneWithMesh(bool recDeepCpy) const;
+ MEDCouplingFieldDouble *convertToDblField() const;
+ MEDCouplingFieldInt *buildSubPartRange(int begin, int end, int step) const;
%extend {
MEDCouplingFieldInt(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
{
return MEDCouplingFieldInt::New(ft,td);
}
- PyObject *isEqualIfNotWhy(const MEDCouplingFieldInt *other, double meshPrec, int valsPrec) const throw(INTERP_KERNEL::Exception)
+ PyObject *isEqualIfNotWhy(const MEDCouplingFieldInt *other, double meshPrec, int valsPrec) const
{
std::string ret1;
bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
return ret;
}
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->simpleRepr();
}
- std::string __repr__() const throw(INTERP_KERNEL::Exception)
+ std::string __repr__() const
{
std::ostringstream oss;
self->reprQuickOverview(oss);
return oss.str();
}
- MEDCouplingFieldInt *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
+ MEDCouplingFieldInt *buildSubPart(PyObject *li) const
{
return fieldT_buildSubPart(self,li);
}
- MEDCouplingFieldInt *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
+ MEDCouplingFieldInt *__getitem__(PyObject *li) const
{
return fieldT__getitem__(self,li);
}
- DataArrayInt *getArray() throw(INTERP_KERNEL::Exception)
+ DataArrayInt *getArray()
{
DataArrayInt *ret=self->getArray();
if(ret)
return ret;
}
- PyObject *getTime() throw(INTERP_KERNEL::Exception)
+ PyObject *getTime()
{
int tmp1,tmp2;
double tmp0=self->getTime(tmp1,tmp2);
return res;
}
- PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
+ PyObject *getTinySerializationInformation() const
{
return field_getTinySerializationInformation<MEDCouplingFieldInt>(self);
}
- PyObject *serialize() const throw(INTERP_KERNEL::Exception)
+ PyObject *serialize() const
{
return field_serialize<int>(self);
}
- PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
+ PyObject *__getstate__() const
{
return field__getstate__<MEDCouplingFieldInt>(self,MEDCoupling_MEDCouplingFieldInt_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldInt_serialize);
}
- void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
+ void __setstate__(PyObject *inp)
{
field__setstate__<int>(self,inp);
}
public:
static MEDCouplingFieldFloat *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
static MEDCouplingFieldFloat *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
- bool isEqual(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const throw(INTERP_KERNEL::Exception);
- bool isEqualWithoutConsideringStr(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const throw(INTERP_KERNEL::Exception);
- void setTimeUnit(const std::string& unit) throw(INTERP_KERNEL::Exception);
- std::string getTimeUnit() const throw(INTERP_KERNEL::Exception);
- void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
- void setArray(DataArrayFloat *array) throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldFloat *deepCopy() const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldFloat *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldFloat *cloneWithMesh(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *convertToDblField() const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldFloat *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
+ bool isEqual(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const;
+ bool isEqualWithoutConsideringStr(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const;
+ void setTimeUnit(const std::string& unit);
+ std::string getTimeUnit() const;
+ void setTime(double val, int iteration, int order);
+ void setArray(DataArrayFloat *array);
+ MEDCouplingFieldFloat *deepCopy() const;
+ MEDCouplingFieldFloat *clone(bool recDeepCpy) const;
+ MEDCouplingFieldFloat *cloneWithMesh(bool recDeepCpy) const;
+ MEDCouplingFieldDouble *convertToDblField() const;
+ MEDCouplingFieldFloat *buildSubPartRange(int begin, int end, int step) const;
%extend {
MEDCouplingFieldFloat(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
{
return MEDCouplingFieldFloat::New(ft,td);
}
- PyObject *isEqualIfNotWhy(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const throw(INTERP_KERNEL::Exception)
+ PyObject *isEqualIfNotWhy(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const
{
std::string ret1;
bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
return ret;
}
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->simpleRepr();
}
- std::string __repr__() const throw(INTERP_KERNEL::Exception)
+ std::string __repr__() const
{
std::ostringstream oss;
self->reprQuickOverview(oss);
return oss.str();
}
- MEDCouplingFieldFloat *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
+ MEDCouplingFieldFloat *buildSubPart(PyObject *li) const
{
return fieldT_buildSubPart(self,li);
}
- MEDCouplingFieldFloat *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
+ MEDCouplingFieldFloat *__getitem__(PyObject *li) const
{
return fieldT__getitem__(self,li);
}
- DataArrayFloat *getArray() throw(INTERP_KERNEL::Exception)
+ DataArrayFloat *getArray()
{
DataArrayFloat *ret=self->getArray();
if(ret)
return ret;
}
- PyObject *getTime() throw(INTERP_KERNEL::Exception)
+ PyObject *getTime()
{
int tmp1,tmp2;
double tmp0=self->getTime(tmp1,tmp2);
return res;
}
- PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
+ PyObject *getTinySerializationInformation() const
{
return field_getTinySerializationInformation<MEDCouplingFieldFloat>(self);
}
- PyObject *serialize() const throw(INTERP_KERNEL::Exception)
+ PyObject *serialize() const
{
return field_serialize<float>(self);
}
- PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
+ PyObject *__getstate__() const
{
return field__getstate__<MEDCouplingFieldFloat>(self,MEDCoupling_MEDCouplingFieldFloat_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldFloat_serialize);
}
- void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
+ void __setstate__(PyObject *inp)
{
field__setstate__<float>(self,inp);
}
std::vector<double> getHotSpotsTime() const;
%extend
{
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
std::ostringstream oss;
self->appendRepr(oss);
return oss.str();
}
- PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
+ PyObject *getIdsOnTimeRight(double tm) const
{
int meshId,arrId,arrIdInField,fieldId;
self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
return res;
}
- PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
+ PyObject *getIdsOnTimeLeft(double tm) const
{
int meshId,arrId,arrIdInField,fieldId;
self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
{
public:
- double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
+ double getTimeTolerance() const;
MEDCouplingDefinitionTime getDefinitionTimeZone() const;
%extend
{
- MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
+ MEDCouplingFieldOverTime(PyObject *li)
{
std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
return MEDCouplingFieldOverTime::New(fs);
}
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->simpleRepr();
}
- static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
+ static MEDCouplingFieldOverTime *New(PyObject *li)
{
std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
class MEDCouplingCartesianAMRPatchGen : public RefCountObject
{
public:
- int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
- int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
- int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
+ int getNumberOfCellsRecursiveWithOverlap() const;
+ int getNumberOfCellsRecursiveWithoutOverlap() const;
+ int getMaxNumberOfLevelsRelativeToThis() const;
%extend
{
- MEDCouplingCartesianAMRMeshGen *getMesh() const throw(INTERP_KERNEL::Exception)
+ MEDCouplingCartesianAMRMeshGen *getMesh() const
{
MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
if(ret)
class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
{
public:
- int getNumberOfOverlapedCellsForFather() const throw(INTERP_KERNEL::Exception);
- bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const throw(INTERP_KERNEL::Exception);
- std::vector<int> computeCellGridSt() const throw(INTERP_KERNEL::Exception);
+ int getNumberOfOverlapedCellsForFather() const;
+ bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const;
+ std::vector<int> computeCellGridSt() const;
%extend
{
- PyObject *getBLTRRange() const throw(INTERP_KERNEL::Exception)
+ PyObject *getBLTRRange() const
{
const std::vector< std::pair<int,int> >& ret(self->getBLTRRange());
return convertFromVectorPairInt(ret);
}
- PyObject *getBLTRRangeRelativeToGF() const throw(INTERP_KERNEL::Exception)
+ PyObject *getBLTRRangeRelativeToGF() const
{
std::vector< std::pair<int,int> > ret(self->getBLTRRangeRelativeToGF());
return convertFromVectorPairInt(ret);
}
- void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
+ void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors)
{
std::vector< std::pair<int,int> > inp;
convertPyToVectorPairInt(bottomLeftTopRight,inp);
self->addPatch(inp,factors);
}
- MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
+ MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const
{
const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
if(!mesh)
return ret;
}
- void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
+ void __delitem__(int patchId)
{
MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
if(!mesh)
mesh->removePatch(patchId);
}
- int __len__() const throw(INTERP_KERNEL::Exception)
+ int __len__() const
{
const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
if(!mesh)
class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
{
public:
- int getAbsoluteLevel() const throw(INTERP_KERNEL::Exception);
- int getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
- std::vector<int> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
- int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
- const std::vector<int>& getFactors() const throw(INTERP_KERNEL::Exception);
- void setFactors(const std::vector<int>& newFactors) throw(INTERP_KERNEL::Exception);
- int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
- int getNumberOfCellsAtCurrentLevel() const throw(INTERP_KERNEL::Exception);
- int getNumberOfCellsAtCurrentLevelGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
- int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
- int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
- bool isPatchInNeighborhoodOf(int patchId1, int patchId2, int ghostLev) const throw(INTERP_KERNEL::Exception);
- virtual void detachFromFather() throw(INTERP_KERNEL::Exception);
+ int getAbsoluteLevel() const;
+ int getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const;
+ std::vector<int> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const;
+ int getSpaceDimension() const;
+ const std::vector<int>& getFactors() const;
+ void setFactors(const std::vector<int>& newFactors);
+ int getMaxNumberOfLevelsRelativeToThis() const;
+ int getNumberOfCellsAtCurrentLevel() const;
+ int getNumberOfCellsAtCurrentLevelGhost(int ghostLev) const;
+ int getNumberOfCellsRecursiveWithOverlap() const;
+ int getNumberOfCellsRecursiveWithoutOverlap() const;
+ bool isPatchInNeighborhoodOf(int patchId1, int patchId2, int ghostLev) const;
+ virtual void detachFromFather();
//
- int getNumberOfPatches() const throw(INTERP_KERNEL::Exception);
- int getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception);
- MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *extractGhostFrom(int ghostSz, const DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception);
- std::vector<int> getPatchIdsInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
- MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const throw(INTERP_KERNEL::Exception);
- MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const throw(INTERP_KERNEL::Exception);
- void removeAllPatches() throw(INTERP_KERNEL::Exception);
- void removePatch(int patchId) throw(INTERP_KERNEL::Exception);
- void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
- void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<int>& factors, double eps) throw(INTERP_KERNEL::Exception);
- DataArrayDouble *createCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis) const throw(INTERP_KERNEL::Exception);
- void fillCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
- void fillCellFieldOnPatchGhost(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
- void fillCellFieldOnPatchOnlyOnGhostZone(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const throw(INTERP_KERNEL::Exception);
+ int getNumberOfPatches() const;
+ int getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const;
+ MEDCouplingUMesh *buildUnstructured() const;
+ DataArrayDouble *extractGhostFrom(int ghostSz, const DataArrayDouble *arr) const;
+ std::vector<int> getPatchIdsInTheNeighborhoodOf(int patchId, int ghostLev) const;
+ MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const;
+ MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const;
+ void removeAllPatches();
+ void removePatch(int patchId);
+ void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<int>& factors);
+ void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<int>& factors, double eps);
+ DataArrayDouble *createCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis) const;
+ void fillCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const;
+ void fillCellFieldOnPatchGhost(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev, bool isConservative=true) const;
+ void fillCellFieldOnPatchOnlyOnGhostZone(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const;
void fillCellFieldOnPatchOnlyOnGhostZoneWith(int ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
- void fillCellFieldComingFromPatch(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
- void fillCellFieldComingFromPatchGhost(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
- DataArrayInt *findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
- std::string buildPythonDumpOfThis() const throw(INTERP_KERNEL::Exception);
+ void fillCellFieldComingFromPatch(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const;
+ void fillCellFieldComingFromPatchGhost(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, int ghostLev, bool isConservative=true) const;
+ DataArrayInt *findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const;
+ std::string buildPythonDumpOfThis() const;
%extend
{
- void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
+ void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors)
{
std::vector< std::pair<int,int> > inp;
convertPyToVectorPairInt(bottomLeftTopRight,inp);
self->addPatch(inp,factors);
}
- PyObject *getPatches() const throw(INTERP_KERNEL::Exception)
+ PyObject *getPatches() const
{
std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
int sz(ps.size());
}
// agy : don't know why typemap fails here ??? let it in the extend section
- PyObject *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const throw(INTERP_KERNEL::Exception)
+ PyObject *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const
{
return convertCartesianAMRMesh(self->deepCopy(father), SWIG_POINTER_OWN | 0 );
}
- MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
+ MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<int>& pos) const
{
const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
return ret2;
}
- MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
+ MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<int>& pos) const
{
const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
return ret2;
}
- virtual PyObject *positionRelativeToGodFather() const throw(INTERP_KERNEL::Exception)
+ virtual PyObject *positionRelativeToGodFather() const
{
std::vector<int> out1;
std::vector< std::pair<int,int> > out0(self->positionRelativeToGodFather(out1));
return ret;
}
- virtual PyObject *retrieveGridsAt(int absoluteLev) const throw(INTERP_KERNEL::Exception)
+ virtual PyObject *retrieveGridsAt(int absoluteLev) const
{
std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
int sz(ps.size());
return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
}
- virtual MEDCouplingCartesianAMRMeshGen *getFather() const throw(INTERP_KERNEL::Exception)
+ virtual MEDCouplingCartesianAMRMeshGen *getFather() const
{
MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
if(ret)
return ret;
}
- virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const throw(INTERP_KERNEL::Exception)
+ virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const
{
MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
if(ret)
return ret;
}
- MEDCouplingCartesianAMRPatch *getPatch(int patchId) const throw(INTERP_KERNEL::Exception)
+ MEDCouplingCartesianAMRPatch *getPatch(int patchId) const
{
MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
if(ret)
return ret;
}
- MEDCouplingIMesh *getImageMesh() const throw(INTERP_KERNEL::Exception)
+ MEDCouplingIMesh *getImageMesh() const
{
const MEDCouplingIMesh *ret(self->getImageMesh());
if(ret)
return const_cast<MEDCouplingIMesh *>(ret);
}
- MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
+ MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const
{
if(patchId==self->getNumberOfPatches())
{
return ret;
}
- void fillCellFieldOnPatchGhostAdv(int patchId, const DataArrayDouble *cellFieldOnThis, int ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const throw(INTERP_KERNEL::Exception)
+ void fillCellFieldOnPatchGhostAdv(int patchId, const DataArrayDouble *cellFieldOnThis, int ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const
{
std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
}
- void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
+ void __delitem__(int patchId)
{
self->removePatch(patchId);
}
- int __len__() const throw(INTERP_KERNEL::Exception)
+ int __len__() const
{
return self->getNumberOfPatches();
}
class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
{
public:
- static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception);
+ static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh);
%extend
{
- static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
+ static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
{
static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
}
- void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps) throw(INTERP_KERNEL::Exception)
+ void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps)
{
std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
}
- MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
+ MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
{
return MEDCoupling_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
}
- MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception)
+ MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh)
{
return MEDCouplingCartesianAMRMesh::New(mesh);
}
class MEDCouplingDataForGodFather : public RefCountObject
{
public:
- virtual void synchronizeFineToCoarse() throw(INTERP_KERNEL::Exception);
- virtual void synchronizeFineToCoarseBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
- virtual void synchronizeCoarseToFine() throw(INTERP_KERNEL::Exception);
- virtual void synchronizeCoarseToFineBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
- virtual void synchronizeAllGhostZones() throw(INTERP_KERNEL::Exception);
- virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh) throw(INTERP_KERNEL::Exception);
- virtual void synchronizeAllGhostZonesAtASpecifiedLevel(int level) throw(INTERP_KERNEL::Exception);
- virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(int level) throw(INTERP_KERNEL::Exception);
- virtual void alloc() throw(INTERP_KERNEL::Exception);
- virtual void dealloc() throw(INTERP_KERNEL::Exception);
+ virtual void synchronizeFineToCoarse();
+ virtual void synchronizeFineToCoarseBetween(int fromLev, int toLev);
+ virtual void synchronizeCoarseToFine();
+ virtual void synchronizeCoarseToFineBetween(int fromLev, int toLev);
+ virtual void synchronizeAllGhostZones();
+ virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh);
+ virtual void synchronizeAllGhostZonesAtASpecifiedLevel(int level);
+ virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(int level);
+ virtual void alloc();
+ virtual void dealloc();
%extend
{
- MEDCouplingCartesianAMRMesh *getMyGodFather() throw(INTERP_KERNEL::Exception)
+ MEDCouplingCartesianAMRMesh *getMyGodFather()
{
MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
if(ret)
class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
{
public:
- int getNumberOfLevels() const throw(INTERP_KERNEL::Exception);
- MEDCouplingAMRAttribute *deepCopy() const throw(INTERP_KERNEL::Exception);
- MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
- bool changeGodFather(MEDCouplingCartesianAMRMesh *gf) throw(INTERP_KERNEL::Exception);
- MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const throw(INTERP_KERNEL::Exception);
- std::string writeVTHB(const std::string& fileName) const throw(INTERP_KERNEL::Exception);
+ int getNumberOfLevels() const;
+ MEDCouplingAMRAttribute *deepCopy() const;
+ MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const;
+ MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const;
+ MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const;
+ MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const;
+ bool changeGodFather(MEDCouplingCartesianAMRMesh *gf);
+ MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const;
+ std::string writeVTHB(const std::string& fileName) const;
%extend
{
- static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
+ static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev)
{
std::vector< std::pair<std::string,int> > fieldNamesCpp0;
std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
return ret;
}
- MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
+ MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev)
{
return MEDCoupling_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
}
- DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception)
+ DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const
{
const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
return ret2;
}
- void spillInfoOnComponents(PyObject *compNames) throw(INTERP_KERNEL::Exception)
+ void spillInfoOnComponents(PyObject *compNames)
{
std::vector< std::vector<std::string> > compNamesCpp;
convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
self->spillInfoOnComponents(compNamesCpp);
}
- void spillNatures(PyObject *nfs) throw(INTERP_KERNEL::Exception)
+ void spillNatures(PyObject *nfs)
{
std::vector<int> inp0;
if(!fillIntVector(nfs,inp0))
self->spillNatures(inp00);
}
- PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception)
+ PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const
{
std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
int sz((int)ret.size());
class DenseMatrix : public RefCountObject, public TimeLabel
{
public:
- static DenseMatrix *New(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
- static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
- DenseMatrix *deepCopy() const throw(INTERP_KERNEL::Exception);
- DenseMatrix *shallowCpy() const throw(INTERP_KERNEL::Exception);
+ static DenseMatrix *New(int nbRows, int nbCols);
+ static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols);
+ DenseMatrix *deepCopy() const;
+ DenseMatrix *shallowCpy() const;
//
- int getNumberOfRows() const throw(INTERP_KERNEL::Exception);
- int getNumberOfCols() const throw(INTERP_KERNEL::Exception);
- int getNbOfElems() const throw(INTERP_KERNEL::Exception);
- void reBuild(DataArrayDouble *array, int nbRows=-1, int nbCols=-1) throw(INTERP_KERNEL::Exception);
- void reShape(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
- void transpose() throw(INTERP_KERNEL::Exception);
+ int getNumberOfRows() const;
+ int getNumberOfCols() const;
+ int getNbOfElems() const;
+ void reBuild(DataArrayDouble *array, int nbRows=-1, int nbCols=-1);
+ void reShape(int nbRows, int nbCols);
+ void transpose();
//
- bool isEqual(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *matVecMult(const DataArrayDouble *vec) const throw(INTERP_KERNEL::Exception);
- static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec) throw(INTERP_KERNEL::Exception);
+ bool isEqual(const DenseMatrix& other, double eps) const;
+ DataArrayDouble *matVecMult(const DataArrayDouble *vec) const;
+ static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec);
%extend
{
- DenseMatrix(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
+ DenseMatrix(int nbRows, int nbCols)
{
return DenseMatrix::New(nbRows,nbCols);
}
- DenseMatrix(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
+ DenseMatrix(DataArrayDouble *array, int nbRows, int nbCols)
{
return DenseMatrix::New(array,nbRows,nbCols);
}
- PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception)
+ PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const
{
std::string ret1;
bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
return ret;
}
- DataArrayDouble *getData() throw(INTERP_KERNEL::Exception)
+ DataArrayDouble *getData()
{
DataArrayDouble *ret(self->getData());
if(ret)
return ret;
}
- DenseMatrix *__add__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
+ DenseMatrix *__add__(const DenseMatrix *other)
{
return MEDCoupling::DenseMatrix::Add(self,other);
}
- DenseMatrix *__sub__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
+ DenseMatrix *__sub__(const DenseMatrix *other)
{
return MEDCoupling::DenseMatrix::Substract(self,other);
}
- DenseMatrix *__mul__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
+ DenseMatrix *__mul__(const DenseMatrix *other)
{
return MEDCoupling::DenseMatrix::Multiply(self,other);
}
- DenseMatrix *__mul__(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
+ DenseMatrix *__mul__(const DataArrayDouble *other)
{
return MEDCoupling::DenseMatrix::Multiply(self,other);
}
- PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
+ PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other)
{
self->addEqual(other);
Py_XINCREF(trueSelf);
return trueSelf;
}
- PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
+ PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other)
{
self->substractEqual(other);
Py_XINCREF(trueSelf);
return trueSelf;
}
#ifdef WITH_NUMPY
- PyObject *toNumPyMatrix() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
+ PyObject *toNumPyMatrix() // not const. It is not a bug !
{
PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
return obj;
self.checkConsistencyLight()
d=(self.getTypeOfField(),self.getTimeDiscretization())
return MEDCouplingStdReduceFunct,(MEDCouplingFieldFloat,(d,(self.__getstate__()),))
+
+#
+# Forwarding DataArrayInt functions to MEDCouplingUMesh:
+#
+MEDCouplingUMesh.ExtractFromIndexedArrays = DataArrayInt.ExtractFromIndexedArrays
+MEDCouplingUMesh.ExtractFromIndexedArraysSlice = DataArrayInt.ExtractFromIndexedArraysSlice
+MEDCouplingUMesh.SetPartOfIndexedArrays = DataArrayInt.SetPartOfIndexedArrays
+##MEDCouplingUMesh.SetPartOfIndexedArraysSlice = DataArrayInt.SetPartOfIndexedArraysSlice
+MEDCouplingUMesh.SetPartOfIndexedArraysSameIdx = DataArrayInt.SetPartOfIndexedArraysSameIdx
+MEDCouplingUMesh.RemoveIdsFromIndexedArrays = DataArrayInt.RemoveIdsFromIndexedArrays
+##MEDCouplingUMesh.SetPartOfIndexedArraysSameIdxSlice = DataArrayInt.SetPartOfIndexedArraysSameIdxSlice
+
%}
%pythoncode %{
-// Copyright (C) 2007-2017 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
{
typedef void (*MyDeallocator)(void *,void *);
MyDeallocator deall=(MyDeallocator)wronc[1];
- deall(pt,NULL);
+ int64_t *offset=reinterpret_cast<int64_t*>(wronc[2]);
+ deall(pt,offset);
+ delete offset;
Py_XDECREF(weakRefOnOwner);
}
delete [] wronc;
-// Copyright (C) 2007-2017 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
std::size_t nbOfElems(sz0*sz1);
T *dataCpy=(T*)malloc(sizeof(T)*nbOfElems);
std::copy(reinterpret_cast<const T*>(data),reinterpret_cast<const T*>(data)+nbOfElems,dataCpy);
- ret->useArray(dataCpy,true,MEDCoupling::C_DEALLOC,sz0,sz1);
+ ret->useArray(dataCpy,true,MEDCoupling::DeallocType::C_DEALLOC,sz0,sz1);
return ret.retn();
}
typename MEDCoupling::MemArray<T>& mma=ret->accessToMemArray();
{
PyCallBackDataArraySt<MCData> *cb=PyObject_GC_New(PyCallBackDataArraySt<MCData>,pytype);
cb->_pt_mc=ret;
- ret->useArray(reinterpret_cast<const T *>(data),true,MEDCoupling::C_DEALLOC,sz0,sz1);
+ ret->useArray(reinterpret_cast<const T *>(data),true,MEDCoupling::DeallocType::C_DEALLOC,sz0,sz1);
PyObject *ref=PyWeakref_NewRef(deepestObj,(PyObject *)cb);
void **objs=new void *[2]; objs[0]=cb; objs[1]=ref;
mma.setParameterForDeallocator(objs);
}
else
{
- ret->useArray(reinterpret_cast<const T *>(data),true,MEDCoupling::C_DEALLOC,sz0,sz1);
+ ret->useArray(reinterpret_cast<const T *>(data),true,MEDCoupling::DeallocType::C_DEALLOC_WITH_OFFSET,sz0,sz1);
PyObject *ref=PyWeakref_NewRef(reinterpret_cast<PyObject *>(eltOwning),NULL);
- typename MEDCoupling::MemArray<T>::Deallocator tmp(MEDCoupling::MemArray<T>::CDeallocator);
+ typename MEDCoupling::MemArray<T>::Deallocator tmp(MEDCoupling::MemArray<T>::COffsetDeallocator);
void **tmp2 = reinterpret_cast<void**>(&tmp); // MSVC2010 does not support constructor()
- void **objs=new void *[2]; objs[0]=ref; objs[1]=*tmp2;
+ const char *dataEltOwning(PyArray_BYTES(eltOwning));//In case of input array is a sub array of a 2D,3D... array there is an offset
+ int64_t offset(0);
+ if(data!=dataEltOwning)
+ {
+ offset=data>dataEltOwning?-((int64_t)(std::distance(dataEltOwning,data))):(int64_t)std::distance(data,dataEltOwning);
+ }
+ void **objs=new void *[3]; objs[0]=ref; objs[1]=*tmp2; objs[2]=new int64_t(offset);
mma.setParameterForDeallocator(objs);
mma.setSpecificDeallocator(numarrdeal);
}
}
else if(PyArray_ISBEHAVED_RO(elt0))
- ret->useArray(reinterpret_cast<const T *>(data),false,MEDCoupling::CPP_DEALLOC,sz0,sz1);
+ ret->useArray(reinterpret_cast<const T *>(data),false,MEDCoupling::DeallocType::CPP_DEALLOC,sz0,sz1);
return ret.retn();
}
PyObject *ref(PyWeakref_NewRef(ret,NULL));
typename MEDCoupling::MemArray<T>::Deallocator tmp(mem.getDeallocator());
void **tmp2 = reinterpret_cast<void**>(&tmp); // MSVC2010 does not support constructor()
- void **objs=new void *[2]; objs[0]=reinterpret_cast<void*>(ref); objs[1]=*tmp2;
+ void **objs=new void *[3]; objs[0]=reinterpret_cast<void*>(ref); objs[1]=*tmp2; objs[2]=new int64_t(0);
mem.setParameterForDeallocator(objs);
mem.setSpecificDeallocator(numarrdeal);
return ret;
return self;
case 2:
tmp=MEDCoupling::Traits<T>::ArrayType::New();
- tmp->useArray(&v1[0],false,MEDCoupling::CPP_DEALLOC,1,v1.size());
+ tmp->useArray(&v1[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,v1.size());
self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
return self;
case 3:
return self;
case 2:
tmp=MEDCoupling::Traits<T>::ArrayType::New();
- tmp->useArray(&v1[0],false,MEDCoupling::CPP_DEALLOC,1,v1.size());
+ tmp->useArray(&v1[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,v1.size());
self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
return self;
case 3:
return self;
case 2:
tmp=MEDCoupling::Traits<T>::ArrayType::New();
- tmp->useArray(&v1[0],false,MEDCoupling::CPP_DEALLOC,1,v1.size());
+ tmp->useArray(&v1[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,v1.size());
self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
return self;
case 3:
return self;
case 2:
tmp=MEDCoupling::Traits<T>::ArrayType::New();
- tmp->useArray(&v1[0],false,MEDCoupling::CPP_DEALLOC,1,v1.size());
+ tmp->useArray(&v1[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,v1.size());
self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
return self;
case 3:
return self;
case 2:
tmp=MEDCoupling::Traits<T>::ArrayType::New();
- tmp->useArray(&v1[0],false,MEDCoupling::CPP_DEALLOC,1,v1.size());
+ tmp->useArray(&v1[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,v1.size());
self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
return self;
case 3:
return self;
case 2:
tmp=MEDCoupling::Traits<T>::ArrayType::New();
- tmp->useArray(&v1[0],false,MEDCoupling::CPP_DEALLOC,1,v1.size());
+ tmp->useArray(&v1[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,v1.size());
self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
return self;
case 3:
return self;
case 2:
tmp=MEDCoupling::Traits<T>::ArrayType::New();
- tmp->useArray(&v1[0],false,MEDCoupling::CPP_DEALLOC,1,v1.size());
+ tmp->useArray(&v1[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,v1.size());
self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
return self;
case 3:
return self;
case 2:
tmp=MEDCoupling::Traits<T>::ArrayType::New();
- tmp->useArray(&v1[0],false,MEDCoupling::CPP_DEALLOC,1,v1.size());
+ tmp->useArray(&v1[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,v1.size());
self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
return self;
case 3:
return self;
case 2:
tmp=MEDCoupling::Traits<T>::ArrayType::New();
- tmp->useArray(&v1[0],false,MEDCoupling::CPP_DEALLOC,1,v1.size());
+ tmp->useArray(&v1[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,v1.size());
self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
return self;
case 3:
return self;
case 2:
tmp=MEDCoupling::Traits<T>::ArrayType::New();
- tmp->useArray(&v1[0],false,MEDCoupling::CPP_DEALLOC,1,v1.size());
+ tmp->useArray(&v1[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,v1.size());
self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
return self;
case 3:
return self;
case 2:
tmp=MEDCoupling::Traits<T>::ArrayType::New();
- tmp->useArray(&v1[0],false,MEDCoupling::CPP_DEALLOC,1,v1.size());
+ tmp->useArray(&v1[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,v1.size());
self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size(),false);
return self;
case 3:
return self;
case 2:
tmp=MEDCoupling::Traits<T>::ArrayType::New();
- tmp->useArray(&v1[0],false,MEDCoupling::CPP_DEALLOC,1,v1.size());
+ tmp->useArray(&v1[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,v1.size());
self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
return self;
case 3:
return self;
case 2:
tmp=MEDCoupling::Traits<T>::ArrayType::New();
- tmp->useArray(&v1[0],false,MEDCoupling::CPP_DEALLOC,1,v1.size());
+ tmp->useArray(&v1[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,v1.size());
self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
return self;
case 3:
return self;
case 2:
tmp=MEDCoupling::Traits<T>::ArrayType::New();
- tmp->useArray(&v1[0],false,MEDCoupling::CPP_DEALLOC,1,v1.size());
+ tmp->useArray(&v1[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,v1.size());
self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
return self;
case 3:
return self;
case 2:
tmp=MEDCoupling::Traits<T>::ArrayType::New();
- tmp->useArray(&v1[0],false,MEDCoupling::CPP_DEALLOC,1,v1.size());
+ tmp->useArray(&v1[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,v1.size());
self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
return self;
case 3:
return self;
case 2:
tmp=MEDCoupling::Traits<T>::ArrayType::New();
- tmp->useArray(&v1[0],false,MEDCoupling::CPP_DEALLOC,1,v1.size());
+ tmp->useArray(&v1[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,v1.size());
self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
return self;
case 3:
}
case 4:
{
- MEDCoupling::MCAuto< typename MEDCoupling::Traits<T>::ArrayType > aaa(MEDCoupling::Traits<T>::ArrayType::New()); aaa->useArray(&bb[0],false,MEDCoupling::CPP_DEALLOC,1,(int)bb.size());
+ MEDCoupling::MCAuto< typename MEDCoupling::Traits<T>::ArrayType > aaa(MEDCoupling::Traits<T>::ArrayType::New()); aaa->useArray(&bb[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,(int)bb.size());
self->multiplyEqual(aaa);
Py_XINCREF(trueSelf);
return trueSelf;
}
case 4:
{
- MEDCoupling::MCAuto< typename MEDCoupling::Traits<T>::ArrayType > aaa(MEDCoupling::Traits<T>::ArrayType::New()); aaa->useArray(&bb[0],false,MEDCoupling::CPP_DEALLOC,1,(int)bb.size());
+ MEDCoupling::MCAuto< typename MEDCoupling::Traits<T>::ArrayType > aaa(MEDCoupling::Traits<T>::ArrayType::New()); aaa->useArray(&bb[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,(int)bb.size());
self->divideEqual(aaa);
Py_XINCREF(trueSelf);
return trueSelf;
}
case 4:
{
- MEDCoupling::MCAuto< typename MEDCoupling::Traits<T>::ArrayType > aaa(MEDCoupling::Traits<T>::ArrayType::New()); aaa->useArray(&bb[0],false,MEDCoupling::CPP_DEALLOC,1,(int)bb.size());
+ MEDCoupling::MCAuto< typename MEDCoupling::Traits<T>::ArrayType > aaa(MEDCoupling::Traits<T>::ArrayType::New()); aaa->useArray(&bb[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,(int)bb.size());
self->addEqual(aaa);
Py_XINCREF(trueSelf);
return trueSelf;
}
case 4:
{
- MEDCoupling::MCAuto< typename MEDCoupling::Traits<T>::ArrayType > aaa(MEDCoupling::Traits<T>::ArrayType::New()); aaa->useArray(&bb[0],false,MEDCoupling::CPP_DEALLOC,1,(int)bb.size());
+ MEDCoupling::MCAuto< typename MEDCoupling::Traits<T>::ArrayType > aaa(MEDCoupling::Traits<T>::ArrayType::New()); aaa->useArray(&bb[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,(int)bb.size());
self->substractEqual(aaa);
Py_XINCREF(trueSelf);
return trueSelf;
}
case 4:
{
- typename MEDCoupling::MCAuto<typename MEDCoupling::Traits<T>::ArrayType> aaa(MEDCoupling::Traits<T>::ArrayType::New()); aaa->useArray(&bb[0],false,MEDCoupling::CPP_DEALLOC,1,(int)bb.size());
+ typename MEDCoupling::MCAuto<typename MEDCoupling::Traits<T>::ArrayType> aaa(MEDCoupling::Traits<T>::ArrayType::New()); aaa->useArray(&bb[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,(int)bb.size());
return MEDCoupling::Traits<T>::ArrayType::Multiply(self,aaa);
}
default:
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
if sys.platform == "win32":
from MEDCouplingCompat import *
else:
- from MEDCoupling import *
+ from medcoupling import *
class MEDCouplingDataForTest:
def build2DTargetMesh_1(cls):
myCoords.setValues(targetCoords,9,2);
targetMesh.setCoords(myCoords);
return targetMesh;
-
+
def build2DSourceMesh_1(cls):
sourceCoords=[-0.3,-0.3, 0.7,-0.3, -0.3,0.7, 0.7,0.7]
sourceConn=[0,3,1,0,2,3]
myCoords.setValues(sourceCoords,4,2);
sourceMesh.setCoords(myCoords);
return sourceMesh;
-
+
def build3DTargetMesh_1(cls):
targetCoords=[ 0., 0., 0., 50., 0., 0. , 200., 0., 0. , 0., 50., 0., 50., 50., 0. , 200., 50., 0., 0., 200., 0., 50., 200., 0. , 200., 200., 0. ,
0., 0., 50., 50., 0., 50. , 200., 0., 50. , 0., 50., 50., 50., 50., 50. , 200., 50., 50., 0., 200., 50., 50., 200., 50. , 200., 200., 50. ,
myCoords.setValues(sourceCoords,9,3);
sourceMesh.setCoords(myCoords);
return sourceMesh;
-
+
def build3DSurfTargetMesh_1(self):
targetCoords=[-0.3,-0.3,0.5, 0.2,-0.3,1., 0.7,-0.3,1.5, -0.3,0.2,0.5, 0.2,0.2,1., 0.7,0.2,1.5, -0.3,0.7,0.5, 0.2,0.7,1., 0.7,0.7,1.5]
30,41,31,33,45,56,46,48, 31,32,34,37,43,36,-1,31,46,51,36,-1,36,51,58,43,-1,43,37,52,58,-1,37,34,49,52,-1,34,32,47,49,-1,32,31,46,47,-1,46,51,58,52,49,47,
31,36,35,33,46,51,50,48, 43,40,39,36,58,55,54,51,
41,38,37,34,32,31,-1,41,56,46,31,-1,31,46,47,32,-1,32,47,49,34,-1,34,49,52,37,-1,37,38,53,52,-1,38,41,56,53,-1,56,46,47,49,52,53,
- 37,42,44,43,52,57,59,58]
+ 37,42,44,43,52,57,59,58]
conn2=[7,12,14,13, 11,8,7,4,2,1, 13,10,9,6, 1,6,5,3, 1,2,4,7,13,6, 0,11,1,3]
#
ret=MEDCouplingUMesh.New();
mesh2D.finishInsertingCells();
mesh2D.setCoords(myCoords);
return ret,mesh2D
-
+
def buildCU1DMesh_U(self):
coords=[ 0.0, 0.3, 0.75, 1.0 ]
conn=[ 0,1, 1,2, 2,3 ]
myCoords.setValues(targetCoords,9,2);
targetMesh.setCoords(myCoords);
return targetMesh;
-
+
def build1DSourceMesh_2(cls):
ret=MEDCouplingUMesh.New("1DSourceMesh",1);
ret.allocateCells(4);
mesh2.insertNextCell(NORM_QUAD4,4,conn2[16:20])
mesh2.finishInsertingCells();
return [mesh,mesh2]
-
+
# 2D usecase1 for interpolation Gauss Pt-> Gauss Pt. Coming from ASTER : Please, do not touch
def buildFieldOnGauss_1(self):
coo=DataArrayDouble([1.0,0.0,1.33333333333333,0.0,1.66666666666667,0.0,0.923879532511287,0.38268343236509006,1.23183937668172,0.510244576486786,1.53979922085214,0.6378057206084831,2.0,0.0,1.8477590650225701,0.7653668647301801,0.9428090415820631,0.9428090415820631,1.1785113019775801,1.1785113019775801,1.4142135623731,1.41421356237309,0.707106781186548,0.707106781186547,0.38268343236509006,0.923879532511287,0.510244576486786,1.23183937668172,0.6378057206084831,1.53979922085214,0.7653668647301801,1.8477590650225701,3.1550283219328204e-17,1.33333333333333,1.16009632455949e-17,1.66666666666667,-2.7620050344068196e-16,2.0,-1.3810025172034098e-16,1.0,-2.0,0.0,-1.53979922085214,0.6378057206084831,-1.66666666666667,0.0,-1.33333333333333,0.0,-0.923879532511287,0.38268343236509006,-1.8477590650225701,0.7653668647301801,-0.9428090415820631,0.9428090415820631,-1.23183937668172,0.510244576486786,-1.83333333333333,0.0,-1.6937791429373599,0.701586292669331,-1.5,0.0,-1.30771370720431,0.26012042935483803,-1.16666666666667,0.0,-1.0778594545965,0.44646400442593803,-1.38578268717091,0.9259503883660041,-1.38581929876693,0.574025148547635,-1.06066017177982,1.06066017177982,-0.8314696123025451,0.5555702330196021,-1.0,0.0,-1.1785113019775801,1.1785113019775801,-0.707106781186548,0.707106781186547,-1.63464213400538,0.325150536693547,-1.9615705608064598,0.390180644032256,-1.47117792060485,0.292635483024192,-0.9807852804032301,0.19509032201612803,-1.524360955888,1.0185454272026,-1.2963624321753402,1.2963624321753402,-1.10862614973673,0.740760310692803,-0.970047881019636,0.6481652718562021,-0.824957911384305,0.824957911384305,-1.4142135623731,1.41421356237309,-1.7981063474059198,0.357665590362902,-1.1442494938037702,0.227605375685483,-1.66293922460509,1.1111404660392,-1.24720441845382,0.833355349529403,-0.7653668647301801,1.8477590650225701,-0.6378057206084831,1.53979922085214,-0.510244576486786,1.23183937668172,-0.701586292669331,1.6937791429373599,-0.574025148547635,1.38581929876693,-0.44646400442593803,1.0778594545965,-0.38268343236509006,0.923879532511287,-0.9259503883660041,1.38578268717091,-0.740760310692803,1.10862614973673,-0.5555702330196021,0.8314696123025451,-0.325150536693547,1.63464213400538,-0.26012042935483803,1.30771370720431,-0.19509032201612803,0.9807852804032301,1.6805133673525298e-18,1.83333333333333,-2.4643915380595496e-16,1.5,-1.4799359654427099e-16,1.16666666666667,-1.1111404660392,1.66293922460509,-0.39018064403225705,1.9615705608064598],73,2)
def buildCircle(self, center_X, center_Y, radius):
from cmath import rect
- from math import pi
-
+ from math import pi
+
c = [rect(radius, i * pi / 4.0) for i in range(8)]
coords = [c[-1].real,c[-1].imag, c[3].real,c[3].imag,
c[5].real,c[5].imag, c[1].real,c[1].imag]
connec = list(range(4))
- baseMesh = MEDCouplingUMesh.New("circle", 2)
+ baseMesh = MEDCouplingUMesh.New("circle", 2)
baseMesh.allocateCells(1)
meshCoords = DataArrayDouble.New(coords, len(coords) // 2, 2)
meshCoords += (center_X, center_Y)
baseMesh.setCoords(meshCoords)
-
- baseMesh.insertNextCell(NORM_QPOLYG, connec)
- baseMesh.finishInsertingCells()
+
+ baseMesh.insertNextCell(NORM_QPOLYG, connec)
+ baseMesh.finishInsertingCells()
return baseMesh
- def buildCircle2(self, center_X, center_Y, radius):
+ def buildCircle2(self, center_X, center_Y, radius):
from cmath import rect
- from math import pi
-
+ from math import pi
+
c = [rect(radius, i * pi / 4.0) for i in range(8)]
coords = []
for i in range(8):
coords.extend([c[i].real,c[i].imag])
connec = [7,5,3,1, 6,4,2,0]
- baseMesh = MEDCouplingUMesh.New("circle", 2)
+ baseMesh = MEDCouplingUMesh.New("circle", 2)
baseMesh.allocateCells(1)
meshCoords = DataArrayDouble.New(coords, len(coords) // 2, 2)
meshCoords += (center_X, center_Y)
baseMesh.setCoords(meshCoords)
-
- baseMesh.insertNextCell(NORM_QPOLYG, connec)
- baseMesh.finishInsertingCells()
- return baseMesh
+
+ baseMesh.insertNextCell(NORM_QPOLYG, connec)
+ baseMesh.finishInsertingCells()
+ return baseMesh
build2DTargetMesh_1=classmethod(build2DTargetMesh_1)
build2DSourceMesh_1=classmethod(build2DSourceMesh_1)
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
if sys.platform == "win32":
from MEDCouplingCompat import *
else:
- from MEDCoupling import *
+ from medcoupling import *
import unittest
from math import pi, sqrt
field2 = MEDCouplingFieldDouble( ON_NODES )
field2.setArray( valsArr2 )
- # max field
+ # max field
fieldMax = MEDCouplingFieldDouble.MaxFields( field1, field2 )
self.assertTrue( fieldMax.getArray().getValues() == valsMax )
- # min field
+ # min field
fieldMin = MEDCouplingFieldDouble.MinFields( field1, field2 )
self.assertTrue( fieldMin.getArray().getValues() == valsMin )
#! [PySnippet_MEDCouplingFieldDouble_MaxFields_1]
# transform the field to a 3D vector field
func = "IVec * b + JVec * a + KVec * sqrt( a*a + b*b ) + 10"
varNames=["a","b"] # names used to refer to X and Y components
- field.applyFuncNamedCompo( 3, varNames, func ) # require 3 components
+ field.applyFuncNamedCompo( 3, varNames, func ) # require 3 components
self.assertTrue( field.getNumberOfComponents() == 3 ) # 3 components as required
#! [PySnippet_MEDCouplingFieldDouble_applyFunc3_1]
#! [PySnippet_MEDCouplingFieldDouble_applyFunc3_2]
field.setArray( array )
# transform the field to a 3D vector field
func = "IVec * b + JVec * a + KVec * sqrt( a*a + b*b ) + 10"
- field.applyFuncCompo( 3, func ) # require 3 components
+ field.applyFuncCompo( 3, func ) # require 3 components
self.assertTrue( field.getNumberOfComponents() == 3 ) # 3 components as required
#! [PySnippet_MEDCouplingFieldDouble_applyFunc2_1]
#! [PySnippet_MEDCouplingFieldDouble_applyFunc2_2]
field.setArray( array )
# transform the field to a 3D vector field
func = "IVec * b + JVec * a + KVec * sqrt( a*a + b*b ) + 10"
- field.applyFunc( 3, func ) # require 3 components
+ field.applyFunc( 3, func ) # require 3 components
self.assertTrue( field.getNumberOfComponents() == 3 ) # 3 components as required
#! [PySnippet_MEDCouplingFieldDouble_applyFunc_1]
#! [PySnippet_MEDCouplingFieldDouble_applyFunc_2]
mesh.setMeshDimension(2)
mesh.allocateCells(5)
conn=[0,3,4,1, 1,2,4, 4,5,2, 6,7,4,3, 7,8,5,4]
- mesh.insertNextCell(NORM_QUAD4,4,conn[0:4])
- mesh.insertNextCell(NORM_TRI3,3, conn[4:7])
- mesh.insertNextCell(NORM_TRI3,3, conn[7:10])
+ mesh.insertNextCell(NORM_QUAD4,4,conn[0:4])
+ mesh.insertNextCell(NORM_TRI3,3, conn[4:7])
+ mesh.insertNextCell(NORM_TRI3,3, conn[7:10])
mesh.insertNextCell(NORM_QUAD4,4,conn[10:14])
mesh.insertNextCell(NORM_QUAD4,4,conn[14:18])
mesh.finishInsertingCells()
mesh.setMeshDimension(2)
mesh.allocateCells(5)
conn=[0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4]
- mesh.insertNextCell(NORM_QUAD4,4,conn[0:4])
- mesh.insertNextCell(NORM_TRI3,3, conn[4:7])
- mesh.insertNextCell(NORM_TRI3,3, conn[7:10])
+ mesh.insertNextCell(NORM_QUAD4,4,conn[0:4])
+ mesh.insertNextCell(NORM_TRI3,3, conn[4:7])
+ mesh.insertNextCell(NORM_TRI3,3, conn[7:10])
mesh.insertNextCell(NORM_QUAD4,4,conn[10:14])
mesh.insertNextCell(NORM_QUAD4,4,conn[14:18])
mesh.finishInsertingCells()
#! [PySnippet_MEDCouplingUMesh_findBoundaryNodes_1]
#! [PySnippet_MEDCouplingUMesh_findBoundaryNodes_2]
nodeIdsArr=mesh.findBoundaryNodes()
- assert nodeIdsArr.getNumberOfTuples() == mesh.getNumberOfNodes() - 1
+ assert nodeIdsArr.getNumberOfTuples() == mesh.getNumberOfNodes() - 1
#! [PySnippet_MEDCouplingUMesh_findBoundaryNodes_2]
return
mesh.setMeshDimension(2)
mesh.allocateCells(5)
conn=[0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4]
- mesh.insertNextCell(NORM_QUAD4,4,conn[0:4])
- mesh.insertNextCell(NORM_TRI3,3, conn[4:7])
- mesh.insertNextCell(NORM_TRI3,3, conn[7:10])
+ mesh.insertNextCell(NORM_QUAD4,4,conn[0:4])
+ mesh.insertNextCell(NORM_TRI3,3, conn[4:7])
+ mesh.insertNextCell(NORM_TRI3,3, conn[7:10])
mesh.insertNextCell(NORM_QUAD4,4,conn[10:14])
mesh.insertNextCell(NORM_QUAD4,4,conn[14:18])
mesh.finishInsertingCells()
mesh.setMeshDimension(2)
mesh.allocateCells(5)
conn=[0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4]
- mesh.insertNextCell(NORM_QUAD4,4,conn[0:4])
- mesh.insertNextCell(NORM_TRI3,3, conn[4:7])
- mesh.insertNextCell(NORM_TRI3,3, conn[7:10])
+ mesh.insertNextCell(NORM_QUAD4,4,conn[0:4])
+ mesh.insertNextCell(NORM_TRI3,3, conn[4:7])
+ mesh.insertNextCell(NORM_TRI3,3, conn[7:10])
mesh.insertNextCell(NORM_QUAD4,4,conn[10:14])
mesh.insertNextCell(NORM_QUAD4,4,conn[14:18])
mesh.finishInsertingCells()
mesh.setMeshDimension(2)
mesh.allocateCells(5)
conn=[0,3,4,1, 1,4,2, 4,5,2]
- mesh.insertNextCell(NORM_QUAD4,4,conn[0:4])
- mesh.insertNextCell(NORM_TRI3,3, conn[4:7])
+ mesh.insertNextCell(NORM_QUAD4,4,conn[0:4])
+ mesh.insertNextCell(NORM_TRI3,3, conn[4:7])
mesh.insertNextCell(NORM_TRI3,3, conn[7:10])
mesh.finishInsertingCells()
coords=[0.3,-0.301, # 0
mesh.setMeshDimension(2)
mesh.allocateCells(5)
conn=[0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4]
- mesh.insertNextCell(NORM_QUAD4,4,conn[0:4])
- mesh.insertNextCell(NORM_TRI3,3, conn[4:7])
- mesh.insertNextCell(NORM_TRI3,3, conn[7:10])
+ mesh.insertNextCell(NORM_QUAD4,4,conn[0:4])
+ mesh.insertNextCell(NORM_TRI3,3, conn[4:7])
+ mesh.insertNextCell(NORM_TRI3,3, conn[7:10])
mesh.insertNextCell(NORM_QUAD4,4,conn[10:14])
mesh.insertNextCell(NORM_QUAD4,4,conn[14:18])
mesh.finishInsertingCells()
mesh.setMeshDimension(2)
mesh.allocateCells(5)
conn=[0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4]
- mesh.insertNextCell(NORM_QUAD4,4,conn[0:4])
- mesh.insertNextCell(NORM_TRI3,3, conn[4:7])
- mesh.insertNextCell(NORM_TRI3,3, conn[7:10])
+ mesh.insertNextCell(NORM_QUAD4,4,conn[0:4])
+ mesh.insertNextCell(NORM_TRI3,3, conn[4:7])
+ mesh.insertNextCell(NORM_TRI3,3, conn[7:10])
mesh.insertNextCell(NORM_QUAD4,4,conn[10:14])
mesh.insertNextCell(NORM_QUAD4,4,conn[14:18])
mesh.finishInsertingCells()
def testExample_DataArrayDouble_findCommonTuples1(self):
#! [PySnippet_DataArrayDouble_findCommonTuples1]
array2=[2.3,2.3, 1.2,1.2, 1.3,1.3, 2.3,2.3, 2.301,2.301, 0.8,0.8]
- da=DataArrayDouble(array2,6,2)
+ da=DataArrayDouble(array2,6,2)
#! [PySnippet_DataArrayDouble_findCommonTuples1]
#! [PySnippet_DataArrayDouble_findCommonTuples2]
c,cI=da.findCommonTuples(1.01e-1)
#! [SnippeDataArrayIntKeepSelectedComponents1_1]
arr1=[1,2,3,4, # tuple 0
11,12,13,14, # tuple 1
- 21,22,23,24, #
+ 21,22,23,24, #
31,32,33,34,
41,42,43,44]
a1=DataArrayInt()
def testExampleUMeshStdBuild1(self):
# ! [PySnippetUMeshStdBuild1_1]
- coords=[-0.3,-0.3,0., 0.2,-0.3,0., 0.7,-0.3,0., -0.3,0.2,0., 0.2,0.2,0.,
+ coords=[-0.3,-0.3,0., 0.2,-0.3,0., 0.7,-0.3,0., -0.3,0.2,0., 0.2,0.2,0.,
0.7,0.2,0., -0.3,0.7,0., 0.2,0.7,0., 0.7,0.7,0. ]
nodalConnPerCell=[0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4]
# ! [PySnippetUMeshStdBuild1_1]
mesh.finishInsertingCells()
# ! [PySnippetUMeshStdBuild1_3]
# ! [PySnippetUMeshStdBuild1_4]
- coordsArr=DataArrayDouble(coords,9,3)#here coordsArr are declared to have 3 components, mesh will deduce that its spaceDim==3.
+ coordsArr=DataArrayDouble(coords,9,3)#here coordsArr are declared to have 3 components, mesh will deduce that its spaceDim==3.
mesh.setCoords(coordsArr)#coordsArr contains 9 tuples, that is to say mesh contains 9 nodes.
# ! [PySnippetUMeshStdBuild1_4]
# ! [PySnippetUMeshStdBuild1_5]
def testExampleUMeshAdvBuild1(self):
# ! [PySnippetUMeshAdvBuild1_1]
- coords=[-0.3,-0.3,0., 0.2,-0.3,0., 0.7,-0.3,0., -0.3,0.2,0., 0.2,0.2,0.,
+ coords=[-0.3,-0.3,0., 0.2,-0.3,0., 0.7,-0.3,0., -0.3,0.2,0., 0.2,0.2,0.,
0.7,0.2,0., -0.3,0.7,0., 0.2,0.7,0., 0.7,0.7,0. ]
nodalConnPerCell=[4,0,3,4,1, 3,1,4,2, 3,4,5,2, 4,6,7,4,3, 4,7,8,5,4]
nodalConnPerCellIndex=[0,5,9,13,18,23]
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
class MEDCouplingFieldDiscretization : public RefCountObject, public TimeLabel
{
public:
- static MEDCouplingFieldDiscretization *New(TypeOfField type) throw(INTERP_KERNEL::Exception);
- double getPrecision() const throw(INTERP_KERNEL::Exception);
- void setPrecision(double val) throw(INTERP_KERNEL::Exception);
- static TypeOfField GetTypeOfFieldFromStringRepr(const std::string& repr) throw(INTERP_KERNEL::Exception);
- virtual TypeOfField getEnum() const throw(INTERP_KERNEL::Exception);
- virtual bool isEqual(const MEDCouplingFieldDiscretization *other, double eps) const throw(INTERP_KERNEL::Exception);
- virtual bool isEqualIfNotWhy(const MEDCouplingFieldDiscretization *other, double eps, std::string& reason) const throw(INTERP_KERNEL::Exception);
- virtual bool isEqualWithoutConsideringStr(const MEDCouplingFieldDiscretization *other, double eps) const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingFieldDiscretization *deepCopy() const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingFieldDiscretization *clone() const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingFieldDiscretization *clonePartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
- virtual std::string getStringRepr() const throw(INTERP_KERNEL::Exception);
- virtual const char *getRepr() const throw(INTERP_KERNEL::Exception);
- virtual int getNumberOfTuples(const MEDCouplingMesh *mesh) const throw(INTERP_KERNEL::Exception);
- virtual int getNumberOfMeshPlaces(const MEDCouplingMesh *mesh) const throw(INTERP_KERNEL::Exception);
- virtual DataArrayInt *getOffsetArr(const MEDCouplingMesh *mesh) const throw(INTERP_KERNEL::Exception);
- virtual DataArrayDouble *getLocalizationOfDiscValues(const MEDCouplingMesh *mesh) const throw(INTERP_KERNEL::Exception);
- virtual void checkCompatibilityWithNature(NatureOfField nat) const throw(INTERP_KERNEL::Exception);
- virtual double getIJK(const MEDCouplingMesh *mesh, const DataArrayDouble *da, int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
- virtual void checkCoherencyBetween(const MEDCouplingMesh *mesh, const DataArray *da) const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingFieldDouble *getMeasureField(const MEDCouplingMesh *mesh, bool isAbs) const throw(INTERP_KERNEL::Exception);
+ static MEDCouplingFieldDiscretization *New(TypeOfField type);
+ double getPrecision() const;
+ void setPrecision(double val);
+ static TypeOfField GetTypeOfFieldFromStringRepr(const std::string& repr);
+ virtual TypeOfField getEnum() const;
+ virtual bool isEqual(const MEDCouplingFieldDiscretization *other, double eps) const;
+ virtual bool isEqualIfNotWhy(const MEDCouplingFieldDiscretization *other, double eps, std::string& reason) const;
+ virtual bool isEqualWithoutConsideringStr(const MEDCouplingFieldDiscretization *other, double eps) const;
+ virtual MEDCouplingFieldDiscretization *deepCopy() const;
+ virtual MEDCouplingFieldDiscretization *clone() const;
+ virtual MEDCouplingFieldDiscretization *clonePartRange(int beginCellIds, int endCellIds, int stepCellIds) const;
+ virtual std::string getStringRepr() const;
+ virtual const char *getRepr() const;
+ virtual int getNumberOfTuples(const MEDCouplingMesh *mesh) const;
+ virtual int getNumberOfMeshPlaces(const MEDCouplingMesh *mesh) const;
+ virtual DataArrayInt *getOffsetArr(const MEDCouplingMesh *mesh) const;
+ virtual DataArrayDouble *getLocalizationOfDiscValues(const MEDCouplingMesh *mesh) const;
+ virtual void checkCompatibilityWithNature(NatureOfField nat) const;
+ virtual double getIJK(const MEDCouplingMesh *mesh, const DataArrayDouble *da, int cellId, int nodeIdInCell, int compoId) const;
+ virtual void checkCoherencyBetween(const MEDCouplingMesh *mesh, const DataArray *da) const;
+ virtual MEDCouplingFieldDouble *getMeasureField(const MEDCouplingMesh *mesh, bool isAbs) const;
virtual void setGaussLocalizationOnType(const MEDCouplingMesh *m, INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
- const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
- virtual void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
- virtual int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
- virtual int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
- virtual int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
+ const std::vector<double>& gsCoo, const std::vector<double>& wg);
+ virtual void clearGaussLocalizations();
+ virtual MEDCouplingGaussLocalization& getGaussLocalization(int locId);
+ virtual int getNbOfGaussLocalization() const;
+ virtual int getGaussLocalizationIdOfOneCell(int cellId) const;
+ virtual int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const;
%extend
{
virtual MEDCouplingFieldDiscretization *clonePart(PyObject *li)
return self->clonePart(inp,inp+sz);
}
- virtual PyObject *buildSubMeshDataRange(const MEDCouplingMesh *mesh, int beginCellIds, int endCellIds, int stepCellIds, int& beginOut, int& endOut, int& stepOut, DataArrayInt *&di) const throw(INTERP_KERNEL::Exception)
+ virtual PyObject *buildSubMeshDataRange(const MEDCouplingMesh *mesh, int beginCellIds, int endCellIds, int stepCellIds, int& beginOut, int& endOut, int& stepOut, DataArrayInt *&di) const
{
DataArrayInt *ret1=0;
int bb,ee,ss;
return res;
}
- virtual int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
+ virtual int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const
{
std::vector<int> inp0;
convertPyToNewIntArr4(code,1,3,inp0);
return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
}
- virtual PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
+ virtual PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const
{
std::vector<int> vVal; int iVal=-1;
int sz=-1,sw=0;
return pyRet;
}
- virtual PyObject *normL1(const MEDCouplingMesh *mesh, const DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception)
+ virtual PyObject *normL1(const MEDCouplingMesh *mesh, const DataArrayDouble *arr) const
{
if(!arr)
throw INTERP_KERNEL::Exception("wrap of MEDCouplingFieldDiscretization::normL1 : input array is null !");
return convertDblArrToPyList<double>(tmp,sz);
}
- virtual PyObject *normL2(const MEDCouplingMesh *mesh, const DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception)
+ virtual PyObject *normL2(const MEDCouplingMesh *mesh, const DataArrayDouble *arr) const
{
if(!arr)
throw INTERP_KERNEL::Exception("wrap of MEDCouplingFieldDiscretization::normL2 : input array is null !");
return convertDblArrToPyList<double>(tmp,sz);
}
- virtual PyObject *integral(const MEDCouplingMesh *mesh, const DataArrayDouble *arr, bool isWAbs) const throw(INTERP_KERNEL::Exception)
+ virtual PyObject *integral(const MEDCouplingMesh *mesh, const DataArrayDouble *arr, bool isWAbs) const
{
if(!arr)
throw INTERP_KERNEL::Exception("wrap of MEDCouplingFieldDiscretization::integral : input array is null !");
return convertDblArrToPyList<double>(tmp,sz);
}
- virtual PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
+ virtual PyObject *getCellIdsHavingGaussLocalization(int locId) const
{
std::vector<int> tmp;
self->getCellIdsHavingGaussLocalization(locId,tmp);
}
virtual void setGaussLocalizationOnCells(const MEDCouplingMesh *m, PyObject *li, const std::vector<double>& refCoo,
- const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
+ const std::vector<double>& gsCoo, const std::vector<double>& wg)
{
void *da=0;
int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
}
}
- virtual PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
+ virtual PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const
{
std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
return convertIntArrToPyList3(ret);
}
- virtual PyObject *getValueOn(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, PyObject *sl) const throw(INTERP_KERNEL::Exception)
+ virtual PyObject *getValueOn(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, PyObject *sl) const
{
double val;
DataArrayDouble *a;
return convertDblArrToPyList<double>(res,spaceDim);
}
- virtual PyObject *getValueOnPos(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, int i, int j, int k) const throw(INTERP_KERNEL::Exception)
+ virtual PyObject *getValueOnPos(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, int i, int j, int k) const
{
if(!arr)
throw INTERP_KERNEL::Exception("wrap of MEDCouplingFieldDiscretization::getValueOnPos : input array is null !");
return convertDblArrToPyList<double>(res,sz);
}
- virtual DataArrayDouble *getValueOnMulti(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, PyObject *loc) const throw(INTERP_KERNEL::Exception)
+ virtual DataArrayDouble *getValueOnMulti(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, PyObject *loc) const
{
if(!mesh)
throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDiscretization::getValueOnMulti : null input mesh !");
return self->getValueOnMulti(arr,mesh,inp,nbPts);
}
- virtual void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
+ virtual void renumberCells(PyObject *li, bool check=true)
{
int sw,sz(-1);
int v0; std::vector<int> v1;
}
virtual void renumberArraysForCell(const MEDCouplingMesh *mesh, PyObject *arrays,
- PyObject *old2New, bool check) throw(INTERP_KERNEL::Exception)
+ PyObject *old2New, bool check)
{
std::vector<DataArray *> input1;
convertFromPyObjVectorOfObj<MEDCoupling::DataArray *>(arrays,SWIGTYPE_p_MEDCoupling__DataArray,"DataArray",input1);
self->renumberArraysForCell(mesh,input1,old2NewBg,check);
}
- virtual DataArrayInt *computeTupleIdsToSelectFromCellIds(const MEDCouplingMesh *mesh, PyObject *cellIds) const throw(INTERP_KERNEL::Exception)
+ virtual DataArrayInt *computeTupleIdsToSelectFromCellIds(const MEDCouplingMesh *mesh, PyObject *cellIds) const
{
int sw,sz(-1);
int v0; std::vector<int> v1;
return self->computeTupleIdsToSelectFromCellIds(mesh,cellIdsBg,cellIdsBg+sz);
}
- virtual PyObject *buildSubMeshData(const MEDCouplingMesh *mesh, PyObject *ids) const throw(INTERP_KERNEL::Exception)
+ virtual PyObject *buildSubMeshData(const MEDCouplingMesh *mesh, PyObject *ids)
{
int sw,sz(-1);
int v0; std::vector<int> v1;
return ret;
}
- virtual void renumberValuesOnNodes(double epsOnVals, PyObject *old2New, int newNbOfNodes, DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception)
+ virtual void renumberValuesOnNodes(double epsOnVals, PyObject *old2New, int newNbOfNodes, DataArrayDouble *arr) const
{
int sw,sz(-1);
int v0; std::vector<int> v1;
self->renumberValuesOnNodes(epsOnVals,old2NewBg,newNbOfNodes,arr);
}
- virtual void renumberValuesOnCells(double epsOnVals, const MEDCouplingMesh *mesh, PyObject *old2New, int newSz, DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception)
+ virtual void renumberValuesOnCells(double epsOnVals, const MEDCouplingMesh *mesh, PyObject *old2New, int newSz, DataArrayDouble *arr) const
{
int sw,sz(-1);
int v0; std::vector<int> v1;
self->renumberValuesOnCells(epsOnVals,mesh,old2NewBg,newSz,arr);
}
- virtual void renumberValuesOnCellsR(const MEDCouplingMesh *mesh, PyObject *new2old, int newSz, DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception)
+ virtual void renumberValuesOnCellsR(const MEDCouplingMesh *mesh, PyObject *new2old, int newSz, DataArrayDouble *arr) const
{
int sw,sz(-1);
int v0; std::vector<int> v1;
class MEDCouplingFieldDiscretizationPerCell : public MEDCouplingFieldDiscretization
{
public:
- void setArrayOfDiscIds(const DataArrayInt *adids) throw(INTERP_KERNEL::Exception);
- void checkNoOrphanCells() const throw(INTERP_KERNEL::Exception);
+ void setArrayOfDiscIds(const DataArrayInt *adids);
+ void checkNoOrphanCells() const;
%extend
{
PyObject *getArrayOfDiscIds() const
return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
- PyObject *splitIntoSingleGaussDicrPerCellType() const throw(INTERP_KERNEL::Exception)
+ PyObject *splitIntoSingleGaussDicrPerCellType() const
{
std::vector<int> ret1;
std::vector<DataArrayInt *> ret0=self->splitIntoSingleGaussDicrPerCellType(ret1);
public:
%extend
{
- static PyObject *GetWeightArrayFromGeometricType(INTERP_KERNEL::NormalizedCellType geoType) throw(INTERP_KERNEL::Exception)
+ static PyObject *GetWeightArrayFromGeometricType(INTERP_KERNEL::NormalizedCellType geoType)
{
std::size_t sz(0);
const double *ret(MEDCouplingFieldDiscretizationGaussNE::GetWeightArrayFromGeometricType(geoType,sz));
return convertDblArrToPyList<double>(ret,sz);
}
- static PyObject *GetRefCoordsFromGeometricType(INTERP_KERNEL::NormalizedCellType geoType) throw(INTERP_KERNEL::Exception)
+ static PyObject *GetRefCoordsFromGeometricType(INTERP_KERNEL::NormalizedCellType geoType)
{
std::size_t sz(0);
const double *ret(MEDCouplingFieldDiscretizationGaussNE::GetRefCoordsFromGeometricType(geoType,sz));
return convertDblArrToPyList<double>(ret,sz);
}
- static PyObject *GetLocsFromGeometricType(INTERP_KERNEL::NormalizedCellType geoType) throw(INTERP_KERNEL::Exception)
+ static PyObject *GetLocsFromGeometricType(INTERP_KERNEL::NormalizedCellType geoType)
{
std::size_t sz(0);
const double *ret(MEDCouplingFieldDiscretizationGaussNE::GetLocsFromGeometricType(geoType,sz));
class MEDCouplingFieldDiscretizationKriging : public MEDCouplingFieldDiscretizationOnNodes
{
public:
- static DataArrayDouble *PerformDriftOfVec(const DataArrayDouble *arr, int isDrift) throw(INTERP_KERNEL::Exception);
+ static DataArrayDouble *PerformDriftOfVec(const DataArrayDouble *arr, int isDrift);
%extend
{
- PyObject *computeVectorOfCoefficients(const MEDCouplingMesh *mesh, const DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception)
+ PyObject *computeVectorOfCoefficients(const MEDCouplingMesh *mesh, const DataArrayDouble *arr) const
{
int ret1;
DataArrayDouble *ret0=self->computeVectorOfCoefficients(mesh,arr,ret1);
return ret;
}
- PyObject *computeInverseMatrix(const MEDCouplingMesh *mesh) const throw(INTERP_KERNEL::Exception)
+ PyObject *computeInverseMatrix(const MEDCouplingMesh *mesh) const
{
int ret1(-1),ret2(-1);
DataArrayDouble *ret0=self->computeInverseMatrix(mesh,ret1,ret2);
return ret;
}
- PyObject *computeMatrix(const MEDCouplingMesh *mesh) const throw(INTERP_KERNEL::Exception)
+ PyObject *computeMatrix(const MEDCouplingMesh *mesh) const
{
int ret1(-1),ret2(-1);
DataArrayDouble *ret0=self->computeMatrix(mesh,ret1,ret2);
return ret;
}
- PyObject *computeEvaluationMatrixOnGivenPts(const MEDCouplingMesh *mesh, PyObject *locs) const throw(INTERP_KERNEL::Exception)
+ PyObject *computeEvaluationMatrixOnGivenPts(const MEDCouplingMesh *mesh, PyObject *locs) const
{
if(!mesh)
throw INTERP_KERNEL::Exception("wrap of MEDCouplingFieldDiscretizationKriging::computeEvaluationMatrixOnGivenPts : input mesh is empty !");
return ret;
}
- void operateOnDenseMatrix(int spaceDimension, DataArrayDouble *myMatrix) const throw(INTERP_KERNEL::Exception)
+ void operateOnDenseMatrix(int spaceDimension, DataArrayDouble *myMatrix) const
{
if(!myMatrix || !myMatrix->isAllocated() || myMatrix->getNumberOfComponents()!=1)
throw INTERP_KERNEL::Exception("Wrap of MEDCouplingFieldDiscretizationKriging::operateOnDenseMatrix : invalid input matrix as DataArrayDouble ! Must be allocated with one component !");
self->operateOnDenseMatrix(spaceDimension,myMatrix->getNumberOfTuples(),myMatrix->getPointer());
}
- PyObject *performDrift(const DataArrayDouble *matr, const DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception)
+ PyObject *performDrift(const DataArrayDouble *matr, const DataArrayDouble *arr) const
{
int ret1(-1);
DataArrayDouble *ret0(self->performDrift(matr,arr,ret1));
return res;
}
- static PyObject *PerformDriftRect(const DataArrayDouble *matr, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception)
+ static PyObject *PerformDriftRect(const DataArrayDouble *matr, const DataArrayDouble *arr)
{
int ret1(-1);
DataArrayDouble *ret0(MEDCouplingFieldDiscretizationKriging::PerformDriftRect(matr,arr,ret1));
return res;
}
- static void OperateOnDenseMatrixH3(DataArrayDouble *myMatrix) throw(INTERP_KERNEL::Exception)
+ static void OperateOnDenseMatrixH3(DataArrayDouble *myMatrix)
{
if(!myMatrix || !myMatrix->isAllocated() || myMatrix->getNumberOfComponents()!=1)
throw INTERP_KERNEL::Exception("Wrap of MEDCouplingFieldDiscretizationKriging::OperateOnDenseMatrixH3 : invalid input matrix as DataArrayDouble ! Must be allocated with one component !");
MEDCouplingFieldDiscretizationKriging::OperateOnDenseMatrixH3(myMatrix->getNumberOfTuples(),myMatrix->getPointer());
}
- static void OperateOnDenseMatrixH2Ln(DataArrayDouble *myMatrix) throw(INTERP_KERNEL::Exception)
+ static void OperateOnDenseMatrixH2Ln(DataArrayDouble *myMatrix) //throw(INTERP_KERNEL::Exception)
{
if(!myMatrix || !myMatrix->isAllocated() || myMatrix->getNumberOfComponents()!=1)
throw INTERP_KERNEL::Exception("Wrap of MEDCouplingFieldDiscretizationKriging::OperateOnDenseMatrixH2Ln : invalid input matrix as DataArrayDouble ! Must be allocated with one component !");
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
# -*- coding: utf-8 -*-
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
if sys.platform == "win32":
from MEDCouplingCompat import *
else:
- from MEDCoupling import *
+ from medcoupling import *
import unittest
from math import pi,e,sqrt,cos,sin
from datetime import datetime
self.assertEqual(map2.getValues(), [0])
pass
+ def testIntersect2DMeshesTmp9(self):
+ """ Tricky case: two triangular shapes intersecting, but not perfectly, at their tips. Several issues fixed:
+ - Bug fix: seg seg intersector epsilon is to be taken absolutely for colinearity test (even for very small vectors
+ we don't want to have false positive on colinearity. So go back to a comparison with an angle.)
+ - when intersecting nodes are merged, they were not properly added on pol2.
+ - bug fix in compute residual: the stop condition is really on pol1Zip only.
+ - correcting polygons with flat corners, they were crashing residual computation
+ """
+ eps = 1.0e-6 # This is the key parameter. DO NOT CHANGE IT.
+ back = MEDCouplingUMesh('crh8_rse3', 2)
+ coo = DataArrayDouble([(-31.313754538446631,-32.512813836330515),(-31.531462871779969,-32.135731941766032),(-31.422608705113298,-32.324272889048274),(-31.690836433011114,-32.295105502997181),(-31.621640616088342,-32.204927758688783),(-31.502295485728872,-32.403959669663848)])
+ back.setCoords(coo)
+ c = DataArrayInt([32, 0, 3, 1, 5, 4, 2])
+ cI = DataArrayInt([0, 7])
+ back.setConnectivity(c, cI)
+
+ tool = MEDCouplingUMesh('TA-536193G_expl_20181022_merged', 2)
+ coo = DataArrayDouble([(-29.918137808525149,-26.883223901634544),(-32.919909136264039,-26.939612990540404),(-27.866900000000001,-28.016680435212603),(-31.313800000000001,-32.512799999999999),(-27.866900000000001,-28.933918793630923)])
+ tool.setCoords(coo)
+ c = DataArrayInt([5, 1, 0, 3, 5, 0, 2, 3, 5, 4, 3, 2])
+ cI = DataArrayInt([0, 4, 8, 12])
+ tool.setConnectivity(c, cI)
+
+ inter, res2Back, res2Tool = MEDCouplingUMesh.Intersect2DMeshes(back, tool, eps)
+
+ self.assertEqual(inter.getNodalConnectivity().getValues(), [5, 14, 13, 11, 12, 5, 13, 15, 11, 32, 12, 3, 1, 14, 16, 17, 18, 19, 5, 15, 0, 11])
+ self.assertEqual(inter.getNodalConnectivityIndex().getValues(), [0, 5, 9, 18, 22])
+ self.assertEqual(res2Back.getValues(), [0, 0, 0, 0])
+ self.assertEqual(res2Tool.getValues(), [0, 1, -1, -1])
+ pass
+
+ def testIntersect2DMeshesTmp10(self):
+ """ Fixing issues when one of the quadratic point of the tool mesh also serves as a regular point somewhere else.
+ WARNING : the tool mesh is not conform, but this was NOT the initial cause of the problem """
+ eps = 1.0e-6
+ back = MEDCouplingUMesh('layer_1', 2)
+ coo = DataArrayDouble([(0.000000000000000,0.000000000000000),(0.000000000000007,113.449999999999960),(113.449999999999960,0.000000000000000),(80.221264325613788,80.221264325613788),(0.000000000000003,56.724999999999980),(56.724999999999980,0.000000000000000)])
+ back.setCoords(coo)
+ c = DataArrayInt([32, 0, 1, 2, 4, 3, 5])
+ cI = DataArrayInt([0, 7])
+ back.setConnectivity(c, cI)
+
+ tool = MEDCouplingUMesh('layer_2', 2)
+ coo = DataArrayDouble([(35.499999704817512,0.000000000000011),(35.413523784223756,2.476354817916448),(35.478374361065050,1.238932132335084),(35.563158391762734,2.486818288978067),(35.649999999999999,0.000000000000000),(35.628282983230761,1.244167057444159),(35.488341087993248,2.481586553447257),(35.575000000000003,0.000000000000000),(35.154516440325750,4.940645084082323),(35.305526997492230,3.710760415787641),(35.154516440325743,-4.940645084082338),(34.960674956295250,-6.164510258681856),(35.413523784223763,-2.476354817916429),(35.305526997492230,-3.710760415787643),(35.563158391762734,-2.486818288978048),(35.488341087993248,-2.481586553447238),(35.478374361018354,-1.238932133672371),(35.628282983230761,-1.244167057444150)])
+ tool.setCoords(coo)
+ c = DataArrayInt([32, 0, 1, 3, 4, 2, 6, 5, 7, # 32, 6, 7, 9, 10, 8, 12, 11, 13
+ 32, 12, 0, 4, 14, 16, 7, 17, 15, # 32, 18, 6, 10, 20, 22, 13, 23, 21
+ 32, 8, 1, 12, 10, 9, 0, 13, 11]) # 32, 14, 7, 18, 16, 15, 6, 19, 17
+ cI = DataArrayInt([0, 9, 18, 27])
+ tool.setConnectivity(c, cI)
+ result, res2Back, res2Tool = MEDCouplingUMesh.Intersect2DMeshes(back, tool, eps)
+
+ self.assertEqual(result.getNodalConnectivity().getValues(), [32, 10, 6, 7, 9, 25, 26, 27, 28 ,
+ 32, 6, 0, 24, 14, 7, 29, 30, 31, 32, 33,
+ 32, 24, 1, 2, 10, 9, 7, 14, 34, 35, 36, 37, 38, 39, 40])
+ self.assertEqual(result.getNodalConnectivityIndex().getValues(), [0, 9, 20, 35])
+ self.assertEqual(res2Back.getValues(), [0, 0, 0])
+ self.assertEqual(res2Tool.getValues(), [0, 2, -1])
+ pass
+
+ def testIntersect2DMeshesTmp11(self):
+ """ BuildIntersectMeshes() was merging points too aggressively (again). """
+ eps = 1.0e-6
+ back = MEDCouplingUMesh('TA-536193G_expl_20180605_merged', 2)
+ coo = DataArrayDouble([(10.19999332472057,-27.86690000000001),(12.56691001291914,-29.23343998708087),(13.93345000000000,-24.13344332472058)])
+ back.setCoords(coo)
+ c = DataArrayInt([5, 2, 1, 0])
+ cI = DataArrayInt([0, 4])
+ back.setConnectivity(c, cI)
+
+ tool = MEDCouplingUMesh('layer_1', 2)
+ cooT = DataArrayDouble([(10.44742256875032,-27.61949543124968),(18.71050449103792,-25.35195658988450),(19.05428526420611,-25.33852836835490),(18.88239487762202,-25.34524247911970),(12.62880992941098,-19.37921975458838),(18.06779356578989,-20.52447528153846),(19.22203188321684,-22.45963506363725),(19.48103923179737,-24.51987105082425),(10.50946417376372,-28.13689270184920),(13.33582148027124,-18.82710073137066),(14.70572820761054,-18.80259652845168),(17.10708000587671,-19.67863183066471),(8.97033515262005,-22.58570640281439),(15.95921032839811,-19.09586394516776),(19.45191696393912,-23.47713337575327),(17.61005728815709,-20.07586106738862),(18.53287284946306,-21.55888206618472),(19.21102524614600,-24.89967567708313),(10.47844337125702,-27.87819406654944),(14.02163025718330,-18.86267048150560)])
+ tool.setCoords(cooT)
+ c = DataArrayInt([32, 2, 1, 0, 8, 9, 3, 4, 18, 12, 11])
+ cI = DataArrayInt([0, 11])
+ tool.setConnectivity(c, cI)
+
+ result, res2Back, res2Tool = MEDCouplingUMesh.Intersect2DMeshes(back, tool, eps)
+ self.assertEqual(result.getNodalConnectivity().getValues(), [32, 26, 25, 3, 23, 24, 27, 28, 29, 30, 31, 32, 24, 0, 26, 32, 33, 34, 32, 25, 2, 1, 23, 3, 35, 36, 37, 38, 39])
+ self.assertEqual(result.getNodalConnectivityIndex().getValues(), [0, 11, 18, 29])
+ self.assertEqual(res2Back.getValues(), [0, 0, 0])
+ self.assertEqual(res2Tool.getValues(), [0, -1, -1])
+
+ # Now the same with point #0 shifted so to almost match intersection point: the intersector should then merge
+ # with point from mesh 1:
+ cooT[0,:] = [10.44741058, -27.61948395]
+ result, res2Back, res2Tool = MEDCouplingUMesh.Intersect2DMeshes(back, tool, eps)
+ self.assertEqual(result.getNodalConnectivity().getValues(), [32, 25, 3, 23, 24, 26, 27, 28, 29, 32, 24, 0, 25, 30, 31, 32, 32, 3, 2, 1, 23, 33, 34, 35, 36])
+ self.assertEqual(result.getNodalConnectivityIndex().getValues(), [0, 9, 16, 25])
+ self.assertEqual(res2Back.getValues(), [0, 0, 0])
+ self.assertEqual(res2Tool.getValues(), [0, -1, -1])
+ pass
+
+ def testIntersect2DMeshesTmp12(self):
+ """ Optimisation of SegSeg and ArcCSeg intersector which also allows to handle some degenerated cases.
+ See method identifyEarlyIntersection() in C++ """
+ eps = 1e-6
+ back = MEDCouplingUMesh('merge', 2)
+ coo = DataArrayDouble([(-22.20967875173176154,32.26829201778234335),(-16.84032124826824273,35.36829201778233767),(-19.52500000000000213,33.81829201778234051),(-22.09987113059642283,32.67809963891765790),(-17.25012886940356438,35.47809963891765506),(-19.67499999999999361,34.07809963891765648),(-16.98614843981577138,35.62087212266773406),(-22.46315640161999028,32.70732818597191027)])
+ back.setCoords(coo)
+ c = DataArrayInt([32, 1, 0, 3, 4, 2, 7, 5, 6])
+ cI = DataArrayInt([0, 9])
+ back.setConnectivity(c, cI)
+ back.checkConsistency()
+
+ tool = MEDCouplingUMesh('layer_2', 2)
+ coo = DataArrayDouble([(-16.84032124826824273,35.36829201778233767),(-19.52500000000000924,33.81829201778234051),(-19.46500000000013841,33.71436896932812743),(-22.58118035378681299,31.71175166763502418),(-16.17259236578203740,35.41175166763498083),(-21.04692233083152786,32.75014443326846703),(-17.83899589140436603,34.60224162661226899),(-19.49500000000007560,33.76633049355523042),(-22.64145235112855659,31.81614582930458823),(-16.23286436312378100,35.51614582930454134),(-21.10697925592403834,32.85419191960125573),(-17.89907519522208545,34.70627619258202401),(-22.61131635245768479,31.76394874846980798),(-16.20272836445290920,35.46394874846976109),(-19.07887754666707991,34.07586093630563795),(-19.52453703982536481,33.81855930796379539),(-19.93627714687611530,33.92725120783563142),(-19.50943608541021135,34.17368800957415687),(-17.95959939746765599,34.72207647704399136),(-16.53659280569601009,35.44221892354343595),(-19.30170729324622414,33.94721012213472022),(-19.72285661614316155,34.05046960870489414),(-19.29415681603864741,34.12477447293989741),(-19.73040709335074183,33.87290525789970985),(-19.52476851991268703,33.81842566287306795)])
+ tool.setCoords(coo)
+ c = DataArrayInt([8, 14, 15, 16, 17, 20, 23, 21, 22,
+ 32, 2, 3, 8, 1, 5, 12, 10, 7,
+ 32, 4, 2, 1, 9, 6, 7, 11, 13,
+ 32, 9, 1, 15, 14, 0, 11, 24, 20, 18, 19])
+ cI = DataArrayInt([0, 9, 18, 27, 38])
+ tool.setConnectivity(c, cI)
+
+ result, res2Back, res2Tool = MEDCouplingUMesh.Intersect2DMeshes(back, tool, eps)
+
+ self.assertEqual(result.getNodalConnectivity().getValues(), [5, 24, 25, 22, 23, 32, 23, 9, 0, 3, 24, 33, 34, 35, 36, 37, 32, 25, 4, 8, 22, 38, 39, 40, 41])
+ self.assertEqual(result.getNodalConnectivityIndex().getValues(), [0, 5, 16, 25])
+ self.assertEqual(res2Back.getValues(), [0, 0, 0])
+ self.assertEqual(res2Tool.getValues(), [0, -1, -1])
+ pass
+
def testSwig2Intersect2DMeshWith1DLine1(self):
"""A basic test with no colinearity between m1 and m2."""
i=MEDCouplingIMesh("mesh",2,[5,5],[0.,0.],[1.,1.])
self.assertEqual(m1.getValues(), [0, 0, 0])
self.assertEqual(m2.getValues(), [-1, -1, 0, 2, -1, -1, 0, 1, -1, -1])
+ def testSwig2Intersect2DMeshWith1DLine20(self):
+ """ A line intersecting a cell more than 3 times was triggering an internal error. """
+ mesh = MEDCouplingUMesh('merge', 2)
+ coo = DataArrayDouble([(0,0),(0,9),(3,9),(3,0),(0,1),(2,1),(0,2),(2,2),(3,3),(1,3),(3,4),(1,4),(0,5),(2,5),(0,6),(2,6),(3,7),(1,7),(3,8),(1,8)])
+ mesh.setCoords(coo)
+ c = DataArrayInt([5, 3, 0, 4, 5, 7, 6, 12, 13, 15, 14, 1, 2, 18, 19, 17, 16, 10, 11, 9, 8]) # offset 20
+ cI = DataArrayInt([0, 21])
+ mesh.setConnectivity(c, cI)
+
+ tool = MEDCouplingUMesh('tool', 1)
+ coo = DataArrayDouble([(1.5, 9.5), (1.5, 1.5)]) # line crossing 4 times
+ tool.setCoords(coo)
+ c = DataArrayInt([NORM_SEG2,0,1])
+ cI = DataArrayInt([0, 3])
+ tool.setConnectivity(c, cI)
+
+ eps=1.0e-4 # not the pb here
+ res2D, res1D, resToSelf, mapLeftRight = MEDCouplingUMesh.Intersect2DMeshWith1DLine(mesh, tool, eps)
+ self.assertEqual(res1D.getNodalConnectivity().getValues(),[1, 20, 25, 1, 25, 26, 1, 26, 27, 1, 27, 24, 1, 24, 23, 1, 23, 28, 1, 28, 29, 1, 29, 22, 1, 22, 21])
+ self.assertEqual(res1D.getNodalConnectivityIndex().getValues(),[0, 3, 6, 9, 12, 15, 18, 21, 24, 27])
+ self.assertEqual(res2D.getNodalConnectivity().getValues(),[5, 2, 18, 26, 25, 5, 13, 15, 24, 27, 16, 10, 28, 23, 5, 8, 3, 0, 4, 5, 7, 22, 29, 5, 6, 12, 23, 28, 11, 9, 29, 22, 5, 14, 1, 25, 26, 19, 17, 27, 24])
+ self.assertEqual(res2D.getNodalConnectivityIndex().getValues(),[0, 5, 14, 23, 32, 41])
+
+ self.assertEqual(resToSelf.getValues(), [0, 0, 0, 0, 0])
+ self.assertEqual(mapLeftRight.getValues(), [-1, -1, 0, 4, -1, -1, 1, 4, -1, -1, 1, 3, -1, -1, 2, 3, -1, -1])
+ pass
+
def testSwig2Conformize2D1(self):
eps = 1.0e-8
coo = [0.,-0.5,0.,0.,0.5,0.,0.5,-0.5,0.25,
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
class PartDefinition : public RefCountObject, public TimeLabel
{
public:
- static PartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception);
- static PartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception);
- virtual DataArrayInt *toDAI() const throw(INTERP_KERNEL::Exception);
- virtual int getNumberOfElems() const throw(INTERP_KERNEL::Exception);
- virtual std::string getRepr() const throw(INTERP_KERNEL::Exception);
- virtual PartDefinition *composeWith(const PartDefinition *other) const throw(INTERP_KERNEL::Exception);
- virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
- virtual PartDefinition *tryToSimplify() const throw(INTERP_KERNEL::Exception);
+ static PartDefinition *New(int start, int stop, int step);
+ static PartDefinition *New(DataArrayInt *listOfIds);
+ virtual DataArrayInt *toDAI() const;
+ virtual int getNumberOfElems() const;
+ virtual std::string getRepr() const;
+ virtual PartDefinition *composeWith(const PartDefinition *other) const;
+ virtual void checkConsistencyLight() const;
+ virtual PartDefinition *tryToSimplify() const;
%extend
{
- virtual PartDefinition *__add__(const PartDefinition& other) const throw(INTERP_KERNEL::Exception)
+ virtual PartDefinition *__add__(const PartDefinition& other) const
{
return (*self)+other;
}
- virtual PyObject *isEqual(const PartDefinition *other) const throw(INTERP_KERNEL::Exception)
+ virtual PyObject *isEqual(const PartDefinition *other) const
{
std::string ret1;
bool ret0(self->isEqual(other,ret1));
return ret;
}
- virtual PyObject *deepCopy() const throw(INTERP_KERNEL::Exception)
+ virtual PyObject *deepCopy() const
{
return convertPartDefinition(self->deepCopy(),SWIG_POINTER_OWN | 0);
}
class DataArrayPartDefinition : public PartDefinition
{
public:
- static DataArrayPartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception);
+ static DataArrayPartDefinition *New(DataArrayInt *listOfIds);
%extend
{
- DataArrayPartDefinition(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception)
+ DataArrayPartDefinition(DataArrayInt *listOfIds)
{
return DataArrayPartDefinition::New(listOfIds);
}
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->getRepr();
}
- std::string __repr__() const throw(INTERP_KERNEL::Exception)
+ std::string __repr__() const
{
std::ostringstream oss; oss << "DataArrayPartDefinition C++ instance at " << self << "." << std::endl;
oss << self->getRepr();
class SlicePartDefinition : public PartDefinition
{
public:
- static SlicePartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception);
- int getEffectiveStop() const throw(INTERP_KERNEL::Exception);
+ static SlicePartDefinition *New(int start, int stop, int step);
+ int getEffectiveStop() const;
%extend
{
- SlicePartDefinition(int start, int stop, int step) throw(INTERP_KERNEL::Exception)
+ SlicePartDefinition(int start, int stop, int step)
{
return SlicePartDefinition::New(start,stop,step);
}
- PyObject *getSlice() const throw(INTERP_KERNEL::Exception)
+ PyObject *getSlice() const
{
int a,b,c;
self->getSlice(a,b,c);
return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(c));
}
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->getRepr();
}
- std::string __repr__() const throw(INTERP_KERNEL::Exception)
+ std::string __repr__() const
{
std::ostringstream oss; oss << "SlicePartDefinition C++ instance at " << self << "." << std::endl;
oss << self->getRepr();
{
public:
void setName(const std::string& name);
- void copyStringInfoFrom(const DataArray& other) throw(INTERP_KERNEL::Exception);
- void copyPartOfStringInfoFrom(const DataArray& other, const std::vector<int>& compoIds) throw(INTERP_KERNEL::Exception);
- void copyPartOfStringInfoFrom2(const std::vector<int>& compoIds, const DataArray& other) throw(INTERP_KERNEL::Exception);
- bool areInfoEqualsIfNotWhy(const DataArray& other, std::string& reason) const throw(INTERP_KERNEL::Exception);
- bool areInfoEquals(const DataArray& other) const throw(INTERP_KERNEL::Exception);
- std::string cppRepr(const std::string& varName) const throw(INTERP_KERNEL::Exception);
+ void copyStringInfoFrom(const DataArray& other);
+ void copyPartOfStringInfoFrom(const DataArray& other, const std::vector<int>& compoIds);
+ void copyPartOfStringInfoFrom2(const std::vector<int>& compoIds, const DataArray& other);
+ bool areInfoEqualsIfNotWhy(const DataArray& other, std::string& reason) const;
+ bool areInfoEquals(const DataArray& other) const;
+ std::string cppRepr(const std::string& varName) const;
std::string getName() const;
- void setInfoOnComponents(const std::vector<std::string>& info) throw(INTERP_KERNEL::Exception);
- void setInfoAndChangeNbOfCompo(const std::vector<std::string>& info) throw(INTERP_KERNEL::Exception);
- std::vector<std::string> getVarsOnComponent() const throw(INTERP_KERNEL::Exception);
- std::vector<std::string> getUnitsOnComponent() const throw(INTERP_KERNEL::Exception);
- std::string getInfoOnComponent(int i) const throw(INTERP_KERNEL::Exception);
- std::string getVarOnComponent(int i) const throw(INTERP_KERNEL::Exception);
- std::string getUnitOnComponent(int i) const throw(INTERP_KERNEL::Exception);
- void setInfoOnComponent(int i, const std::string& info) throw(INTERP_KERNEL::Exception);
+ void setInfoOnComponents(const std::vector<std::string>& info);
+ void setInfoAndChangeNbOfCompo(const std::vector<std::string>& info);
+ std::vector<std::string> getVarsOnComponent() const;
+ std::vector<std::string> getUnitsOnComponent() const;
+ std::string getInfoOnComponent(int i) const;
+ std::string getVarOnComponent(int i) const;
+ std::string getUnitOnComponent(int i) const;
+ void setInfoOnComponent(int i, const std::string& info);
int getNumberOfComponents() const;
- virtual void alloc(int nbOfTuple, int nbOfCompo=1) throw(INTERP_KERNEL::Exception);
- virtual void reAlloc(int nbOfTuples) throw(INTERP_KERNEL::Exception);
- virtual bool isAllocated() const throw(INTERP_KERNEL::Exception);
- virtual void checkAllocated() const throw(INTERP_KERNEL::Exception);
- virtual void desallocate() throw(INTERP_KERNEL::Exception);
- virtual int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
- virtual std::size_t getNbOfElems() const throw(INTERP_KERNEL::Exception);
- virtual std::size_t getNbOfElemAllocated() const throw(INTERP_KERNEL::Exception);
- virtual DataArray *deepCopy() const throw(INTERP_KERNEL::Exception);
- virtual DataArray *buildNewEmptyInstance() const throw(INTERP_KERNEL::Exception);
- virtual DataArray *selectByTupleIdSafeSlice(int bg, int end2, int step) const throw(INTERP_KERNEL::Exception);
- virtual void rearrange(int newNbOfCompo) throw(INTERP_KERNEL::Exception);
- virtual void circularPermutation(int nbOfShift=1) throw(INTERP_KERNEL::Exception);
- virtual void circularPermutationPerTuple(int nbOfShift=1) throw(INTERP_KERNEL::Exception);
- virtual void reversePerTuple() throw(INTERP_KERNEL::Exception);
- void checkNbOfTuples(int nbOfTuples, const std::string& msg) const throw(INTERP_KERNEL::Exception);
- void checkNbOfComps(int nbOfCompo, const std::string& msg) const throw(INTERP_KERNEL::Exception);
- void checkNbOfTuplesAndComp(const DataArray& other, const std::string& msg) const throw(INTERP_KERNEL::Exception);
- void checkNbOfTuplesAndComp(int nbOfTuples, int nbOfCompo, const std::string& msg) const throw(INTERP_KERNEL::Exception);
- void checkNbOfElems(std::size_t nbOfElems, const std::string& msg) const throw(INTERP_KERNEL::Exception);
- static int GetNumberOfItemGivenBES(int begin, int end, int step, const std::string& msg) throw(INTERP_KERNEL::Exception);
- static int GetNumberOfItemGivenBESRelative(int begin, int end, int step, const std::string& msg) throw(INTERP_KERNEL::Exception);
- static int GetPosOfItemGivenBESRelativeNoThrow(int value, int begin, int end, int step) throw(INTERP_KERNEL::Exception);
- static std::string GetVarNameFromInfo(const std::string& info) throw(INTERP_KERNEL::Exception);
- static std::string GetUnitFromInfo(const std::string& info) throw(INTERP_KERNEL::Exception);
- static std::string BuildInfoFromVarAndUnit(const std::string& var, const std::string& unit) throw(INTERP_KERNEL::Exception);
- static std::string GetAxisTypeRepr(MEDCouplingAxisType at) throw(INTERP_KERNEL::Exception);
+ virtual void alloc(int nbOfTuple, int nbOfCompo=1);
+ virtual void reAlloc(int nbOfTuples);
+ virtual bool isAllocated() const;
+ virtual void checkAllocated() const;
+ virtual void desallocate();
+ virtual int getNumberOfTuples() const;
+ virtual std::size_t getNbOfElems() const;
+ virtual std::size_t getNbOfElemAllocated() const;
+ virtual DataArray *deepCopy() const;
+ virtual DataArray *buildNewEmptyInstance() const;
+ virtual DataArray *selectByTupleIdSafeSlice(int bg, int end2, int step) const;
+ virtual void rearrange(int newNbOfCompo);
+ virtual void circularPermutation(int nbOfShift=1);
+ virtual void circularPermutationPerTuple(int nbOfShift=1);
+ virtual void reversePerTuple();
+ void checkNbOfTuples(int nbOfTuples, const std::string& msg) const;
+ void checkNbOfComps(int nbOfCompo, const std::string& msg) const;
+ void checkNbOfTuplesAndComp(const DataArray& other, const std::string& msg) const;
+ void checkNbOfTuplesAndComp(int nbOfTuples, int nbOfCompo, const std::string& msg) const;
+ void checkNbOfElems(std::size_t nbOfElems, const std::string& msg) const;
+ static int GetNumberOfItemGivenBES(int begin, int end, int step, const std::string& msg);
+ static int GetNumberOfItemGivenBESRelative(int begin, int end, int step, const std::string& msg);
+ static int GetPosOfItemGivenBESRelativeNoThrow(int value, int begin, int end, int step);
+ static std::string GetVarNameFromInfo(const std::string& info);
+ static std::string GetUnitFromInfo(const std::string& info);
+ static std::string BuildInfoFromVarAndUnit(const std::string& var, const std::string& unit);
+ static std::string GetAxisTypeRepr(MEDCouplingAxisType at);
void updateTime() const;
%extend
{
- PyObject *getInfoOnComponents() const throw(INTERP_KERNEL::Exception)
+ PyObject *getInfoOnComponents() const
{
const std::vector<std::string>& comps=self->getInfoOnComponents();
PyObject *ret=PyList_New((int)comps.size());
return ret;
}
- void copyPartOfStringInfoFrom(const DataArray& other, PyObject *li) throw(INTERP_KERNEL::Exception)
+ void copyPartOfStringInfoFrom(const DataArray& other, PyObject *li)
{
std::vector<int> tmp;
convertPyToNewIntArr3(li,tmp);
self->copyPartOfStringInfoFrom(other,tmp);
}
- void copyPartOfStringInfoFrom2(PyObject *li, const DataArray& other) throw(INTERP_KERNEL::Exception)
+ void copyPartOfStringInfoFrom2(PyObject *li, const DataArray& other)
{
std::vector<int> tmp;
convertPyToNewIntArr3(li,tmp);
self->copyPartOfStringInfoFrom2(tmp,other);
}
- virtual void renumberInPlace(PyObject *li) throw(INTERP_KERNEL::Exception)
+ virtual void renumberInPlace(PyObject *li)
{
void *da=0;
int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
}
}
- virtual void renumberInPlaceR(PyObject *li) throw(INTERP_KERNEL::Exception)
+ virtual void renumberInPlaceR(PyObject *li)
{
void *da=0;
int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
}
//tuplesSelec in PyObject * because DataArrayInt is not already existing !
- virtual void setContigPartOfSelectedValues(int tupleIdStart, PyObject *aBase, PyObject *tuplesSelec) throw(INTERP_KERNEL::Exception)
+ virtual void setContigPartOfSelectedValues(int tupleIdStart, PyObject *aBase, PyObject *tuplesSelec)
{
static const char msg[]="DataArray::setContigPartOfSelectedValuesSlice : 4th parameter \"tuplesSelec\" should be of type DataArrayInt";
DataArray *a=CheckAndRetrieveDataArrayInstance(aBase,"DataArray::setContigPartOfSelectedValuesSlice : 3rd parameter \"aBase\" should be of type DataArray");
self->setContigPartOfSelectedValues(tupleIdStart,a,tuplesSelecPtr2);
}
- virtual void setContigPartOfSelectedValuesSlice(int tupleIdStart, PyObject *aBase, int bg, int end2, int step) throw(INTERP_KERNEL::Exception)
+ virtual void setContigPartOfSelectedValuesSlice(int tupleIdStart, PyObject *aBase, int bg, int end2, int step)
{
DataArray *a=CheckAndRetrieveDataArrayInstance(aBase,"DataArray::setContigPartOfSelectedValuesSlice : 2nd parameter \"aBase\" should be of type DataArray");
self->setContigPartOfSelectedValuesSlice(tupleIdStart,a,bg,end2,step);
}
- virtual DataArray *selectByTupleRanges(PyObject *li) const throw(INTERP_KERNEL::Exception)
+ virtual DataArray *selectByTupleRanges(PyObject *li) const
{
std::vector<std::pair<int,int> > ranges;
convertPyToVectorPairInt(li,ranges);
return self->selectByTupleRanges(ranges);
}
- virtual DataArray *selectByTupleId(PyObject *li) const throw(INTERP_KERNEL::Exception)
+ virtual DataArray *selectByTupleId(PyObject *li) const
{
void *da=0;
int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
}
}
- virtual DataArray *selectByTupleIdSafe(PyObject *li) const throw(INTERP_KERNEL::Exception)
+ virtual DataArray *selectByTupleIdSafe(PyObject *li) const
{
void *da=0;
int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
}
}
- virtual PyObject *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
+ virtual PyObject *keepSelectedComponents(PyObject *li) const
{
std::vector<int> tmp;
convertPyToNewIntArr3(li,tmp);
return convertDataArray(ret,SWIG_POINTER_OWN | 0 );
}
- static PyObject *GetSlice(PyObject *slic, int sliceId, int nbOfSlices) throw(INTERP_KERNEL::Exception)
+ static PyObject *GetSlice(PyObject *slic, int sliceId, int nbOfSlices)
{
if(!PySlice_Check(slic))
throw INTERP_KERNEL::Exception("DataArray::GetSlice (wrap) : expecting a pyslice as second (first) parameter !");
return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(step));
}
- PyObject *getSlice(PyObject *slic, int sliceId, int nbOfSlices) const throw(INTERP_KERNEL::Exception)
+ PyObject *getSlice(PyObject *slic, int sliceId, int nbOfSlices) const
{
if(!PySlice_Check(slic))
throw INTERP_KERNEL::Exception("DataArray::getSlice (wrap) : expecting a pyslice as second (first) parameter !");
return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(step));
}
- static int GetNumberOfItemGivenBES(PyObject *slic) throw(INTERP_KERNEL::Exception)
+ static int GetNumberOfItemGivenBES(PyObject *slic)
{
if(!PySlice_Check(slic))
throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBES (wrap) : expecting a pyslice as second (first) parameter !");
return DataArray::GetNumberOfItemGivenBES(strt,stp,step,"");
}
- static int GetNumberOfItemGivenBESRelative(PyObject *slic) throw(INTERP_KERNEL::Exception)
+ static int GetNumberOfItemGivenBESRelative(PyObject *slic)
{
if(!PySlice_Check(slic))
throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBESRelative (wrap) : expecting a pyslice as second (first) parameter !");
return DataArray::GetNumberOfItemGivenBESRelative(strt,stp,step,"");
}
- static DataArray *Aggregate(PyObject *arrs) throw(INTERP_KERNEL::Exception)
+ static DataArray *Aggregate(PyObject *arrs)
{
std::vector<const DataArray *> tmp;
convertFromPyObjVectorOfObj<const MEDCoupling::DataArray *>(arrs,SWIGTYPE_p_MEDCoupling__DataArray,"DataArray",tmp);
return DataArray::Aggregate(tmp);
}
- int getNumberOfItemGivenBES(PyObject *slic) const throw(INTERP_KERNEL::Exception)
+ int getNumberOfItemGivenBES(PyObject *slic) const
{
if(!PySlice_Check(slic))
throw INTERP_KERNEL::Exception("DataArray::getNumberOfItemGivenBES (wrap) : expecting a pyslice as second (first) parameter !");
return DataArray::GetNumberOfItemGivenBES(strt,stp,step,"");
}
- int getNumberOfItemGivenBESRelative(PyObject *slic) throw(INTERP_KERNEL::Exception)
+ int getNumberOfItemGivenBESRelative(PyObject *slic)
{
if(!PySlice_Check(slic))
throw INTERP_KERNEL::Exception("DataArray::getNumberOfItemGivenBESRelative (wrap) : expecting a pyslice as second (first) parameter !");
return DataArray::GetNumberOfItemGivenBESRelative(strt,stp,step,"");
}
- PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
+ PyObject *__getstate__() const
{
PyObject *ret(PyTuple_New(2));
std::string a0(self->getName());
return ret;
}
- void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
+ void __setstate__(PyObject *inp)
{
static const char MSG[]="DataArrayDouble.__setstate__ : expected input is a tuple of size 2 with string as 1st arg and list of string as 2nd arg !";
if(!PyTuple_Check(inp))
{
public:
static DataArrayFloat *New();
- void fillWithValue(float val) throw(INTERP_KERNEL::Exception);
- bool isEqual(const DataArrayFloat& other, float prec) const throw(INTERP_KERNEL::Exception);
- bool isEqualWithoutConsideringStr(const DataArrayFloat& other, float prec) const throw(INTERP_KERNEL::Exception);
- bool isUniform(float val, float eps) const throw(INTERP_KERNEL::Exception);
- void pushBackSilent(float val) throw(INTERP_KERNEL::Exception);
- void iota(float init=0.) throw(INTERP_KERNEL::Exception);
- DataArrayFloatIterator *iterator() throw(INTERP_KERNEL::Exception);
- MCAuto<DataArrayDouble> convertToDblArr() const throw(INTERP_KERNEL::Exception);
- static DataArrayFloat *Meld(const DataArrayFloat *a1, const DataArrayFloat *a2) throw(INTERP_KERNEL::Exception);
+ void fillWithValue(float val);
+ bool isEqual(const DataArrayFloat& other, float prec) const;
+ bool isEqualWithoutConsideringStr(const DataArrayFloat& other, float prec) const;
+ bool isUniform(float val, float eps) const;
+ void pushBackSilent(float val);
+ void iota(float init=0.);
+ DataArrayFloatIterator *iterator();
+ MCAuto<DataArrayDouble> convertToDblArr() const;
+ static DataArrayFloat *Meld(const DataArrayFloat *a1, const DataArrayFloat *a2);
%extend
{
- DataArrayFloat() throw(INTERP_KERNEL::Exception)
+ DataArrayFloat()
{
return DataArrayFloat::New();
}
- static DataArrayFloat *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
+ static DataArrayFloat *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0)
{
return DataArrayT_New<float>(elt0,nbOfTuples,elt2);
}
- DataArrayFloat(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
+ DataArrayFloat(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0)
{
return MEDCoupling_DataArrayFloat_New__SWIG_1(elt0,nbOfTuples,elt2);
}
- DataArrayFloatIterator *__iter__() throw(INTERP_KERNEL::Exception)
+ DataArrayFloatIterator *__iter__()
{
return self->iterator();
}
- std::string __repr__() const throw(INTERP_KERNEL::Exception)
+ std::string __repr__() const
{
std::ostringstream oss;
self->reprQuickOverview(oss);
return oss.str();
}
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->reprNotTooLong();
}
- int __len__() const throw(INTERP_KERNEL::Exception)
+ int __len__() const
{
if(self->isAllocated())
{
}
}
- PyObject *getValues() const throw(INTERP_KERNEL::Exception)
+ PyObject *getValues() const
{
const float *vals(self->begin());
return convertDblArrToPyList<float>(vals,self->getNbOfElems());
}
- PyObject *getValuesAsTuple() const throw(INTERP_KERNEL::Exception)
+ PyObject *getValuesAsTuple() const
{
const float *vals(self->begin());
int nbOfComp(self->getNumberOfComponents()),nbOfTuples(self->getNumberOfTuples());
return convertDblArrToPyListOfTuple<float>(vals,nbOfComp,nbOfTuples);
}
- PyObject *isEqualIfNotWhy(const DataArrayFloat& other, float prec) const throw(INTERP_KERNEL::Exception)
+ PyObject *isEqualIfNotWhy(const DataArrayFloat& other, float prec) const
{
std::string ret1;
bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
return ret;
}
- PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *__getitem__(PyObject *obj)
{
return DataArrayT__getitem<float>(self,obj);
}
- DataArrayFloat *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
+ DataArrayFloat *__setitem__(PyObject *obj, PyObject *value)
{
return DataArrayT__setitem__<float>(self,obj,value);
}
- PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *___iadd___(PyObject *trueSelf, PyObject *obj)
{
return DataArrayT_iadd<float>(trueSelf,obj,self);
}
- PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *___isub___(PyObject *trueSelf, PyObject *obj)
{
return DataArrayT_isub<float>(trueSelf,obj,self);
}
- PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *___imul___(PyObject *trueSelf, PyObject *obj)
{
return DataArrayT_imul<float>(trueSelf,obj,self);
}
- DataArrayFloat *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ DataArrayFloat *__rmul__(PyObject *obj)
{
return DataArrayFPT_rmul<float>(self,obj);
}
- PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *___idiv___(PyObject *trueSelf, PyObject *obj)
{
return DataArrayT_idiv<float>(trueSelf,obj,self);
}
#ifdef WITH_NUMPY
- PyObject *toNumPyArray() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
+ PyObject *toNumPyArray() // not const. It is not a bug !
{
return ToNumPyArray<DataArrayFloat,float>(self,NPY_FLOAT,"DataArrayFloat");
}
class DataArrayFloatTuple
{
public:
- int getNumberOfCompo() const throw(INTERP_KERNEL::Exception);
- DataArrayFloat *buildDAFloat(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
+ int getNumberOfCompo() const;
+ DataArrayFloat *buildDAFloat(int nbOfTuples, int nbOfCompo) const;
%extend
{
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->repr();
}
- float __float__() const throw(INTERP_KERNEL::Exception)
+ float __float__() const
{
return self->floatValue();
}
- DataArrayFloat *buildDAFloat() throw(INTERP_KERNEL::Exception)
+ DataArrayFloat *buildDAFloat()
{
return self->buildDAFloat(1,self->getNumberOfCompo());
}
- /*PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
+ /*PyObject *___imul___(PyObject *trueSelf, PyObject *obj)
{
MCAuto<DataArrayFloat> ret=self->buildDAFloat(1,self->getNumberOfCompo());
MEDCoupling_DataArrayFloat____imul___(ret,0,obj);
return trueSelf;
}*/
- PyObject *__len__() throw(INTERP_KERNEL::Exception)
+ PyObject *__len__()
{
return PyInt_FromLong(self->getNumberOfCompo());
}
{
public:
static DataArrayDouble *New();
- double doubleValue() const throw(INTERP_KERNEL::Exception);
- bool empty() const throw(INTERP_KERNEL::Exception);
- void aggregate(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
- DataArrayDouble *performCopyOrIncrRef(bool deepCopy) const throw(INTERP_KERNEL::Exception);
- void deepCopyFrom(const DataArrayDouble& other) throw(INTERP_KERNEL::Exception);
- void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
- void pushBackSilent(double val) throw(INTERP_KERNEL::Exception);
- double popBackSilent() throw(INTERP_KERNEL::Exception);
- void pack() const throw(INTERP_KERNEL::Exception);
- void allocIfNecessary(int nbOfTuple, int nbOfCompo) throw(INTERP_KERNEL::Exception);
- void fillWithZero() throw(INTERP_KERNEL::Exception);
- void fillWithValue(double val) throw(INTERP_KERNEL::Exception);
- void iota(double init=0.) throw(INTERP_KERNEL::Exception);
- bool isUniform(double val, double eps) const throw(INTERP_KERNEL::Exception);
- void sort(bool asc=true) throw(INTERP_KERNEL::Exception);
- void reverse() throw(INTERP_KERNEL::Exception);
- void checkMonotonic(bool increasing, double eps) const throw(INTERP_KERNEL::Exception);
- bool isMonotonic(bool increasing, double eps) const throw(INTERP_KERNEL::Exception);
- std::string repr() const throw(INTERP_KERNEL::Exception);
- std::string reprZip() const throw(INTERP_KERNEL::Exception);
- std::string reprNotTooLong() const throw(INTERP_KERNEL::Exception);
- bool isEqual(const DataArrayDouble& other, double prec) const throw(INTERP_KERNEL::Exception);
- bool isEqualWithoutConsideringStr(const DataArrayDouble& other, double prec) const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *fromNoInterlace() const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *toNoInterlace() const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *subArray(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
- void transpose() throw(INTERP_KERNEL::Exception);
- DataArrayDouble *changeNbOfComponents(int newNbOfComp, double dftValue) const throw(INTERP_KERNEL::Exception);
- void meldWith(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
- DataArrayDouble *duplicateEachTupleNTimes(int nbTimes) const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *getDifferentValues(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception);
- DataArrayInt *findClosestTupleId(const DataArrayDouble *other) const throw(INTERP_KERNEL::Exception);
- DataArrayInt *computeNbOfInteractionsWith(const DataArrayDouble *otherBBoxFrmt, double eps) const throw(INTERP_KERNEL::Exception);
- void setPartOfValues1(const DataArrayDouble *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true) throw(INTERP_KERNEL::Exception);
- void setPartOfValuesSimple1(double a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp) throw(INTERP_KERNEL::Exception);
- void setPartOfValuesAdv(const DataArrayDouble *a, const DataArrayInt *tuplesSelec) throw(INTERP_KERNEL::Exception);
- double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
- double front() const throw(INTERP_KERNEL::Exception);
- double back() const throw(INTERP_KERNEL::Exception);
- double getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
- void setIJ(int tupleId, int compoId, double newVal) throw(INTERP_KERNEL::Exception);
- void setIJSilent(int tupleId, int compoId, double newVal) throw(INTERP_KERNEL::Exception);
- double *getPointer() throw(INTERP_KERNEL::Exception);
- void checkNoNullValues() const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *computeBBoxPerTuple(double epsilon=0.0) const throw(INTERP_KERNEL::Exception);
- void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
- double getMaxValueInArray() const throw(INTERP_KERNEL::Exception);
- double getMaxAbsValueInArray() const throw(INTERP_KERNEL::Exception);
- double getMinValueInArray() const throw(INTERP_KERNEL::Exception);
- int count(double value, double eps) const throw(INTERP_KERNEL::Exception);
- double getAverageValue() const throw(INTERP_KERNEL::Exception);
- double norm2() const throw(INTERP_KERNEL::Exception);
- double normMax() const throw(INTERP_KERNEL::Exception);
- double normMin() const throw(INTERP_KERNEL::Exception);
- double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *fromPolarToCart() const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *fromCylToCart() const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *fromSpherToCart() const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *fromCartToPolar() const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *fromCartToCyl() const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *fromCartToSpher() const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *cartesianize(MEDCouplingAxisType atOfThis) const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *determinant() const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *inverse() const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *trace() const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *deviator() const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *magnitude() const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *sumPerTuple() const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *buildEuclidianDistanceDenseMatrix() const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *buildEuclidianDistanceDenseMatrixWith(const DataArrayDouble *other) const throw(INTERP_KERNEL::Exception);
- void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
- void abs() throw(INTERP_KERNEL::Exception);
- DataArrayDouble *computeAbs() const throw(INTERP_KERNEL::Exception);
- void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
- void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
- void applyInv(double numerator) throw(INTERP_KERNEL::Exception);
- void applyPow(double val) throw(INTERP_KERNEL::Exception);
- void applyRPow(double val) throw(INTERP_KERNEL::Exception);
- DataArrayDouble *negate() const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *applyFunc(int nbOfComp, FunctionToEvaluate func) const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *applyFunc(int nbOfComp, const std::string& func, bool isSafe=true) const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *applyFunc(const std::string& func, bool isSafe=true) const throw(INTERP_KERNEL::Exception);
- void applyFuncOnThis(const std::string& func, bool isSafe=true) throw(INTERP_KERNEL::Exception);
- DataArrayDouble *applyFuncCompo(int nbOfComp, const std::string& func, bool isSafe=true) const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func, bool isSafe=true) const throw(INTERP_KERNEL::Exception);
- void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
- void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
- DataArrayInt *findIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
- DataArrayInt *findIdsNotInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
- DataArrayInt *findIdsStrictlyNegative() const throw(INTERP_KERNEL::Exception);
- static DataArrayDouble *Aggregate(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
- static DataArrayDouble *Meld(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
- static DataArrayDouble *Dot(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
- static DataArrayDouble *CrossProduct(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
- static DataArrayDouble *Max(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
- static DataArrayDouble *Min(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
- static DataArrayDouble *Add(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
- void addEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
- static DataArrayDouble *Substract(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
- void substractEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
- static DataArrayDouble *Multiply(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
- void multiplyEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
- static DataArrayDouble *Divide(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
- void divideEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
- static DataArrayDouble *Pow(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
- void powEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
- MCAuto<DataArrayInt> findIdsGreaterOrEqualTo(double val) const throw(INTERP_KERNEL::Exception);
- MCAuto<DataArrayInt> findIdsGreaterThan(double val) const throw(INTERP_KERNEL::Exception);
- MCAuto<DataArrayInt> findIdsLowerOrEqualTo(double val) const throw(INTERP_KERNEL::Exception);
- MCAuto<DataArrayInt> findIdsLowerThan(double val) const throw(INTERP_KERNEL::Exception);
- MCAuto<DataArrayInt> convertToIntArr() const throw(INTERP_KERNEL::Exception);
- MCAuto<DataArrayDouble> selectPartDef(const PartDefinition* pd) const throw(INTERP_KERNEL::Exception);
- MCAuto<DataArrayDouble> cumSum() const throw(INTERP_KERNEL::Exception);
- MCAuto<DataArrayFloat> convertToFloatArr() const throw(INTERP_KERNEL::Exception);
+ double doubleValue() const;
+ bool empty() const;
+ void aggregate(const DataArrayDouble *other);
+ DataArrayDouble *performCopyOrIncrRef(bool deepCopy) const;
+ void deepCopyFrom(const DataArrayDouble& other);
+ void reserve(std::size_t nbOfElems);
+ void pushBackSilent(double val);
+ double popBackSilent();
+ void pack() const;
+ void allocIfNecessary(int nbOfTuple, int nbOfCompo);
+ void fillWithZero();
+ void fillWithValue(double val);
+ void iota(double init=0.);
+ bool isUniform(double val, double eps) const;
+ void sort(bool asc=true);
+ void reverse();
+ void checkMonotonic(bool increasing, double eps) const;
+ bool isMonotonic(bool increasing, double eps) const;
+ std::string repr() const;
+ std::string reprZip() const;
+ std::string reprNotTooLong() const;
+ bool isEqual(const DataArrayDouble& other, double prec) const;
+ bool isEqualWithoutConsideringStr(const DataArrayDouble& other, double prec) const;
+ DataArrayDouble *fromNoInterlace() const;
+ DataArrayDouble *toNoInterlace() const;
+ DataArrayDouble *subArray(int tupleIdBg, int tupleIdEnd=-1) const;
+ void transpose();
+ DataArrayDouble *changeNbOfComponents(int newNbOfComp, double dftValue) const;
+ void meldWith(const DataArrayDouble *other);
+ DataArrayDouble *duplicateEachTupleNTimes(int nbTimes) const;
+ DataArrayDouble *getDifferentValues(double prec, int limitTupleId=-1) const;
+ DataArrayInt *findClosestTupleId(const DataArrayDouble *other) const;
+ DataArrayInt *computeNbOfInteractionsWith(const DataArrayDouble *otherBBoxFrmt, double eps) const;
+ void setPartOfValues1(const DataArrayDouble *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true);
+ void setPartOfValuesSimple1(double a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp);
+ void setPartOfValuesAdv(const DataArrayDouble *a, const DataArrayInt *tuplesSelec);
+ double getIJ(int tupleId, int compoId) const;
+ double front() const;
+ double back() const;
+ double getIJSafe(int tupleId, int compoId) const;
+ void setIJ(int tupleId, int compoId, double newVal);
+ void setIJSilent(int tupleId, int compoId, double newVal);
+ double *getPointer();
+ void checkNoNullValues() const;
+ DataArrayDouble *computeBBoxPerTuple(double epsilon=0.0) const;
+ void recenterForMaxPrecision(double eps);
+ double getMaxValueInArray() const;
+ double getMaxAbsValueInArray() const;
+ double getMinValueInArray() const;
+ int count(double value, double eps) const;
+ double getAverageValue() const;
+ double norm2() const;
+ double normMax() const;
+ double normMin() const;
+ double accumulate(int compId) const;
+ DataArrayDouble *fromPolarToCart() const;
+ DataArrayDouble *fromCylToCart() const;
+ DataArrayDouble *fromSpherToCart() const;
+ DataArrayDouble *fromCartToPolar() const;
+ DataArrayDouble *fromCartToCyl() const;
+ DataArrayDouble *fromCartToSpher() const;
+ DataArrayDouble *cartesianize(MEDCouplingAxisType atOfThis) const;
+ DataArrayDouble *doublyContractedProduct() const;
+ DataArrayDouble *determinant() const;
+ DataArrayDouble *eigenValues() const;
+ DataArrayDouble *eigenVectors() const;
+ DataArrayDouble *inverse() const;
+ DataArrayDouble *trace() const;
+ DataArrayDouble *deviator() const;
+ DataArrayDouble *magnitude() const;
+ DataArrayDouble *maxPerTuple() const;
+ DataArrayDouble *sumPerTuple() const;
+ DataArrayDouble *buildEuclidianDistanceDenseMatrix() const;
+ DataArrayDouble *buildEuclidianDistanceDenseMatrixWith(const DataArrayDouble *other) const;
+ void sortPerTuple(bool asc);
+ void abs();
+ DataArrayDouble *computeAbs() const;
+ void applyLin(double a, double b, int compoId);
+ void applyLin(double a, double b);
+ void applyInv(double numerator);
+ void applyPow(double val);
+ void applyRPow(double val);
+ DataArrayDouble *negate() const;
+ DataArrayDouble *applyFunc(int nbOfComp, FunctionToEvaluate func) const;
+ DataArrayDouble *applyFunc(int nbOfComp, const std::string& func, bool isSafe=true) const;
+ DataArrayDouble *applyFunc(const std::string& func, bool isSafe=true) const;
+ void applyFuncOnThis(const std::string& func, bool isSafe=true);
+ DataArrayDouble *applyFuncCompo(int nbOfComp, const std::string& func, bool isSafe=true) const;
+ DataArrayDouble *applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func, bool isSafe=true) const;
+ void applyFuncFast32(const std::string& func);
+ void applyFuncFast64(const std::string& func);
+ DataArrayInt *findIdsInRange(double vmin, double vmax) const;
+ DataArrayInt *findIdsNotInRange(double vmin, double vmax) const;
+ DataArrayInt *findIdsStrictlyNegative() const;
+ static DataArrayDouble *Aggregate(const DataArrayDouble *a1, const DataArrayDouble *a2);
+ static DataArrayDouble *Meld(const DataArrayDouble *a1, const DataArrayDouble *a2);
+ static DataArrayDouble *Dot(const DataArrayDouble *a1, const DataArrayDouble *a2);
+ static DataArrayDouble *CrossProduct(const DataArrayDouble *a1, const DataArrayDouble *a2);
+ static DataArrayDouble *Max(const DataArrayDouble *a1, const DataArrayDouble *a2);
+ static DataArrayDouble *Min(const DataArrayDouble *a1, const DataArrayDouble *a2);
+ static DataArrayDouble *Add(const DataArrayDouble *a1, const DataArrayDouble *a2);
+ void addEqual(const DataArrayDouble *other);
+ static DataArrayDouble *Substract(const DataArrayDouble *a1, const DataArrayDouble *a2);
+ void substractEqual(const DataArrayDouble *other);
+ static DataArrayDouble *Multiply(const DataArrayDouble *a1, const DataArrayDouble *a2);
+ void multiplyEqual(const DataArrayDouble *other);
+ static DataArrayDouble *Divide(const DataArrayDouble *a1, const DataArrayDouble *a2);
+ void divideEqual(const DataArrayDouble *other);
+ static DataArrayDouble *Pow(const DataArrayDouble *a1, const DataArrayDouble *a2);
+ void powEqual(const DataArrayDouble *other);
+ MCAuto<DataArrayInt> findIdsGreaterOrEqualTo(double val) const;
+ MCAuto<DataArrayInt> findIdsGreaterThan(double val) const;
+ MCAuto<DataArrayInt> findIdsLowerOrEqualTo(double val) const;
+ MCAuto<DataArrayInt> findIdsLowerThan(double val) const;
+ MCAuto<DataArrayInt> convertToIntArr() const;
+ MCAuto<DataArrayDouble> selectPartDef(const PartDefinition* pd) const;
+ MCAuto<DataArrayDouble> cumSum() const;
+ MCAuto<DataArrayFloat> convertToFloatArr() const;
%extend
{
- DataArrayDouble() throw(INTERP_KERNEL::Exception)
+ DataArrayDouble()
{
return DataArrayDouble::New();
}
- static DataArrayDouble *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
+ static DataArrayDouble *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0)
{
return DataArrayT_New<double>(elt0,nbOfTuples,elt2);
}
- DataArrayDouble(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
+ DataArrayDouble(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0)
{
return MEDCoupling_DataArrayDouble_New__SWIG_1(elt0,nbOfTuples,elt2);
}
- void pushBackValsSilent(PyObject *li) throw(INTERP_KERNEL::Exception)
+ void pushBackValsSilent(PyObject *li)
{
double val;
std::vector<double> bb;
self->pushBackValsSilent(tmp,tmp+nbTuples);
}
- std::string __repr__() const throw(INTERP_KERNEL::Exception)
+ std::string __repr__() const
{
std::ostringstream oss;
self->reprQuickOverview(oss);
return oss.str();
}
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->reprNotTooLong();
}
- double __float__() const throw(INTERP_KERNEL::Exception)
+ double __float__() const
{
return self->doubleValue();
}
- int __len__() const throw(INTERP_KERNEL::Exception)
+ int __len__() const
{
if(self->isAllocated())
{
}
}
- PyObject *asArcOfCircle() const throw(INTERP_KERNEL::Exception)
+ PyObject *asArcOfCircle() const
{
double center[2],radius,ang;
self->asArcOfCircle(center,radius,ang);
return ret;
}
- DataArrayDoubleIterator *__iter__() throw(INTERP_KERNEL::Exception)
+ DataArrayDoubleIterator *__iter__()
{
return self->iterator();
}
- void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
+ void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0)
{
const char *msg="MEDCoupling::DataArrayDouble::setValues : Available API are : \n-DataArrayDouble.setValues([1.,3.,4.])\n-DataArrayDouble.setValues([1.,3.,4.],3)\n-DataArrayDouble.setValues([1.,3.,4.,5.],2,2)\n-DataArrayDouble.setValues([(1.,1.7),(3.,3.7),(4.,4.7)])\n !";
if(PyList_Check(li) || PyTuple_Check(li))
{
- if(nbOfTuples)
+ if(nbOfTuples && nbOfTuples != Py_None)
{
if(PyInt_Check(nbOfTuples))
{
int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
if(nbOfTuples1<0)
throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive set of allocated memory !");
- if(nbOfComp)
+ if(nbOfComp && nbOfComp != Py_None)
{
if(PyInt_Check(nbOfComp))
{//DataArrayDouble.setValues([1.,3.,4.,5.],2,2)
throw INTERP_KERNEL::Exception(msg);
}
- PyObject *getValues() const throw(INTERP_KERNEL::Exception)
+ PyObject *getValues() const
{
const double *vals(self->begin());
return convertDblArrToPyList<double>(vals,self->getNbOfElems());
}
#ifdef WITH_NUMPY
- PyObject *toNumPyArray() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
+ PyObject *toNumPyArray() // not const. It is not a bug !
{
return ToNumPyArray<DataArrayDouble,double>(self,NPY_DOUBLE,"DataArrayDouble");
}
#endif
- PyObject *isEqualIfNotWhy(const DataArrayDouble& other, double prec) const throw(INTERP_KERNEL::Exception)
+ PyObject *isEqualIfNotWhy(const DataArrayDouble& other, double prec) const
{
std::string ret1;
bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
return ret;
}
- PyObject *getValuesAsTuple() const throw(INTERP_KERNEL::Exception)
+ PyObject *getValuesAsTuple() const
{
const double *vals(self->begin());
int nbOfComp(self->getNumberOfComponents()),nbOfTuples(self->getNumberOfTuples());
return convertDblArrToPyListOfTuple<double>(vals,nbOfComp,nbOfTuples);
}
- static PyObject *ComputeIntegralOfSeg2IntoTri3(PyObject *seg2, PyObject *tri3) throw(INTERP_KERNEL::Exception)
+ static PyObject *ComputeIntegralOfSeg2IntoTri3(PyObject *seg2, PyObject *tri3)
{
const char msg[]="Python wrap of DataArrayDouble::ComputeIntegralOfSeg2IntoTri3 : ";
double val,val2;
return ret;
}
- DataArrayDouble *symmetry3DPlane(PyObject *point, PyObject *normalVector) throw(INTERP_KERNEL::Exception)
+ DataArrayDouble *symmetry3DPlane(PyObject *point, PyObject *normalVector)
{
const char msg[]="Python wrap of DataArrayDouble::symmetry3DPlane : ";
double val,val2;
return ret.retn();
}
- static PyObject *GiveBaseForPlane(PyObject *normalVector) throw(INTERP_KERNEL::Exception)
+ static PyObject *GiveBaseForPlane(PyObject *normalVector)
{
const char msg[]="Python wrap of DataArrayDouble::GiveBaseForPlane : ";
double val,val2;
return self->fromCartToCylGiven(coords,centerPtr,vectorPtr);
}
- DataArrayDouble *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
+ DataArrayDouble *renumber(PyObject *li)
{
void *da=0;
int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
}
}
- DataArrayDouble *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
+ DataArrayDouble *renumberR(PyObject *li)
{
void *da=0;
int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
}
}
- DataArrayDouble *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
+ DataArrayDouble *renumberAndReduce(PyObject *li, int newNbOfTuple)
{
void *da=0;
int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
}
}
- PyObject *minimalDistanceTo(const DataArrayDouble *other) const throw(INTERP_KERNEL::Exception)
+ PyObject *minimalDistanceTo(const DataArrayDouble *other) const
{
int thisTupleId,otherTupleId;
double r0=self->minimalDistanceTo(other,thisTupleId,otherTupleId);
return ret;
}
- PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
+ PyObject *getMaxValue() const
{
int tmp;
double r1=self->getMaxValue(tmp);
return ret;
}
- PyObject *getMaxAbsValue() const throw(INTERP_KERNEL::Exception)
+ PyObject *getMaxAbsValue() const
{
std::size_t tmp;
double r1=self->getMaxAbsValue(tmp);
return ret;
}
- PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
+ PyObject *getMaxValue2() const
{
DataArrayInt *tmp;
double r1=self->getMaxValue2(tmp);
return ret;
}
- PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
+ PyObject *getMinValue() const
{
int tmp;
double r1=self->getMinValue(tmp);
return ret;
}
- PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
+ PyObject *getMinValue2() const
{
DataArrayInt *tmp;
double r1=self->getMinValue2(tmp);
return ret;
}
- PyObject *getMinMaxPerComponent() const throw(INTERP_KERNEL::Exception)
+ PyObject *getMinMaxPerComponent() const
{
int nbOfCompo(self->getNumberOfComponents());
INTERP_KERNEL::AutoPtr<double> tmp(new double[2*nbOfCompo]);
return ret;
}
- PyObject *normMaxPerComponent() const throw(INTERP_KERNEL::Exception)
+ PyObject *normMaxPerComponent() const
{
int nbOfCompo(self->getNumberOfComponents());
INTERP_KERNEL::AutoPtr<double> tmp(new double[nbOfCompo]);
return convertDblArrToPyList<double>(tmp,nbOfCompo);
}
- PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
+ PyObject *accumulate() const
{
int sz=self->getNumberOfComponents();
INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
return convertDblArrToPyList<double>(tmp,sz);
}
- DataArrayDouble *accumulatePerChunck(PyObject *indexArr) const throw(INTERP_KERNEL::Exception)
+ DataArrayDouble *accumulatePerChunck(PyObject *indexArr) const
{
int sw,sz,val;
std::vector<int> val2;
return self->accumulatePerChunck(bg,bg+sz);
}
- PyObject *findCommonTuples(double prec, int limitNodeId=-1) const throw(INTERP_KERNEL::Exception)
+ PyObject *findCommonTuples(double prec, int limitNodeId=-1) const
{
DataArrayInt *comm, *commIndex;
self->findCommonTuples(prec,limitNodeId,comm,commIndex);
return res;
}
- PyObject *distanceToTuple(PyObject *tuple) const throw(INTERP_KERNEL::Exception)
+ PyObject *distanceToTuple(PyObject *tuple) const
{
double val;
DataArrayDouble *a;
return ret;
}
- void setSelectedComponents(const DataArrayDouble *a, PyObject *li) throw(INTERP_KERNEL::Exception)
+ void setSelectedComponents(const DataArrayDouble *a, PyObject *li)
{
std::vector<int> tmp;
convertPyToNewIntArr3(li,tmp);
self->setSelectedComponents(a,tmp);
}
- PyObject *explodeComponents() const throw(INTERP_KERNEL::Exception)
+ PyObject *explodeComponents() const
{
std::vector< MCAuto<DataArrayDouble> > retCpp(self->explodeComponents());
std::size_t sz(retCpp.size());
return res;
}
- PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
+ PyObject *getTuple(int tupleId)
{
int sz=self->getNumberOfComponents();
INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
return convertDblArrToPyList<double>(tmp,sz);
}
- static DataArrayDouble *Aggregate(PyObject *li) throw(INTERP_KERNEL::Exception)
+ static DataArrayDouble *Aggregate(PyObject *li)
{
std::vector<const DataArrayDouble *> tmp;
convertFromPyObjVectorOfObj<const DataArrayDouble *>(li,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
return DataArrayDouble::Aggregate(tmp);
}
- static DataArrayDouble *Meld(PyObject *li) throw(INTERP_KERNEL::Exception)
+ static DataArrayDouble *Meld(PyObject *li)
{
std::vector<const DataArrayDouble *> tmp;
convertFromPyObjVectorOfObj<const DataArrayDouble *>(li,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
return DataArrayDouble::Meld(tmp);
}
- PyObject *computeTupleIdsNearTuples(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
+ PyObject *computeTupleIdsNearTuples(PyObject *pt, double eps) const
{
double val;
DataArrayDouble *a;
int nbComp=self->getNumberOfComponents(),nbTuples=-1;
const char msg[]="Python wrap of DataArrayDouble::computeTupleIdsNearTuples : ";
const double *pos=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,msg,nbComp,true,nbTuples);
- MCAuto<DataArrayDouble> inpu=DataArrayDouble::New(); inpu->useArray(pos,false,CPP_DEALLOC,nbTuples,nbComp);
+ MCAuto<DataArrayDouble> inpu=DataArrayDouble::New(); inpu->useArray(pos,false,DeallocType::CPP_DEALLOC,nbTuples,nbComp);
DataArrayInt *c=0,*cI=0;
self->computeTupleIdsNearTuples(inpu,eps,c,cI);
PyObject *ret=PyTuple_New(2);
return ret;
}
- PyObject *areIncludedInMe(const DataArrayDouble *other, double prec) const throw(INTERP_KERNEL::Exception)
+ PyObject *areIncludedInMe(const DataArrayDouble *other, double prec) const
{
DataArrayInt *ret1=0;
bool ret0=self->areIncludedInMe(other,prec,ret1);
return ret;
}
- PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *__getitem__(PyObject *obj)
{
return DataArrayT__getitem<double>(self,obj);
}
- DataArrayDouble *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
+ DataArrayDouble *__setitem__(PyObject *obj, PyObject *value)
{
return DataArrayT__setitem__<double>(self,obj,value);
}
- DataArrayDouble *__neg__() const throw(INTERP_KERNEL::Exception)
+ DataArrayDouble *__neg__() const
{
return self->negate();
}
- PyObject *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *__add__(PyObject *obj)
{
const char msg[]="Unexpected situation in DataArrayDouble.__add__ !";
double val;
}
case 4:
{
- MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Add(self,aaa)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
default:
}
}
- DataArrayDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ DataArrayDouble *__radd__(PyObject *obj)
{
const char msg[]="Unexpected situation in __radd__ !";
double val;
}
case 4:
{
- MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
return DataArrayDouble::Add(self,aaa);
}
default:
}
}
- PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *___iadd___(PyObject *trueSelf, PyObject *obj)
{
return DataArrayT_iadd<double>(trueSelf,obj,self);
}
- PyObject *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *__sub__(PyObject *obj)
{
const char msg[]="Unexpected situation in __sub__ !";
double val;
}
case 4:
{
- MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Substract(self,aaa)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
default:
}
}
- DataArrayDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ DataArrayDouble *__rsub__(PyObject *obj)
{
const char msg[]="Unexpected situation in __rsub__ !";
double val;
}
case 4:
{
- MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
return DataArrayDouble::Substract(aaa,self);
}
default:
}
}
- PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *___isub___(PyObject *trueSelf, PyObject *obj)
{
return DataArrayT_isub<double>(trueSelf,obj,self);
}
- PyObject *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *__mul__(PyObject *obj)
{
const char msg[]="Unexpected situation in __mul__ !";
double val;
}
case 4:
{
- MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Multiply(self,aaa)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
default:
}
}
- DataArrayDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ DataArrayDouble *__rmul__(PyObject *obj)
{
return DataArrayFPT_rmul<double>(self,obj);
}
- PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *___imul___(PyObject *trueSelf, PyObject *obj)
{
return DataArrayT_imul<double>(trueSelf,obj,self);
}
- PyObject *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *__div__(PyObject *obj)
{
const char msg[]="Unexpected situation in __div__ !";
double val;
}
case 4:
{
- MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Divide(self,aaa)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
default:
}
}
- DataArrayDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ DataArrayDouble *__rdiv__(PyObject *obj)
{
const char msg[]="Unexpected situation in __rdiv__ !";
double val;
}
case 4:
{
- MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
return DataArrayDouble::Divide(aaa,self);
}
default:
}
}
- PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *___idiv___(PyObject *trueSelf, PyObject *obj)
{
return DataArrayT_idiv<double>(trueSelf,obj,self);
}
- DataArrayDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ DataArrayDouble *__pow__(PyObject *obj)
{
const char msg[]="Unexpected situation in __pow__ !";
double val;
}
case 4:
{
- MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
return DataArrayDouble::Pow(self,aaa);
}
default:
}
}
- DataArrayDouble *__rpow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ DataArrayDouble *__rpow__(PyObject *obj)
{
const char msg[]="Unexpected situation in __rpow__ !";
double val;
}
case 4:
{
- MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
return DataArrayDouble::Pow(aaa,self);
}
default:
}
}
- PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *___ipow___(PyObject *trueSelf, PyObject *obj)
{
const char msg[]="Unexpected situation in __ipow__ !";
double val;
}
case 4:
{
- MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
self->powEqual(aaa);
Py_XINCREF(trueSelf);
return trueSelf;
return ret;
}
- PyObject *maxPerTupleWithCompoId() const throw(INTERP_KERNEL::Exception)
+ PyObject *maxPerTupleWithCompoId() const
{
DataArrayInt *ret1=0;
DataArrayDouble *ret0=self->maxPerTupleWithCompoId(ret1);
class DataArrayDoubleTuple
{
public:
- int getNumberOfCompo() const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *buildDADouble(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
+ int getNumberOfCompo() const;
+ DataArrayDouble *buildDADouble(int nbOfTuples, int nbOfCompo) const;
%extend
{
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->repr();
}
- double __float__() const throw(INTERP_KERNEL::Exception)
+ double __float__() const
{
return self->doubleValue();
}
- DataArrayDouble *buildDADouble() throw(INTERP_KERNEL::Exception)
+ DataArrayDouble *buildDADouble()
{
return self->buildDADouble(1,self->getNumberOfCompo());
}
- PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *___iadd___(PyObject *trueSelf, PyObject *obj)
{
MCAuto<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
MEDCoupling_DataArrayDouble____iadd___(ret,0,obj);
return trueSelf;
}
- PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *___isub___(PyObject *trueSelf, PyObject *obj)
{
MCAuto<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
MEDCoupling_DataArrayDouble____isub___(ret,0,obj);
return trueSelf;
}
- PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *___imul___(PyObject *trueSelf, PyObject *obj)
{
MCAuto<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
MEDCoupling_DataArrayDouble____imul___(ret,0,obj);
return trueSelf;
}
- PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *___idiv___(PyObject *trueSelf, PyObject *obj)
{
MCAuto<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
MEDCoupling_DataArrayDouble____idiv___(ret,0,obj);
return trueSelf;
}
- PyObject *__len__() throw(INTERP_KERNEL::Exception)
+ PyObject *__len__()
{
return PyInt_FromLong(self->getNumberOfCompo());
}
- PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *__getitem__(PyObject *obj)
{
const char msg2[]="DataArrayDoubleTuple::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
int sw;
}
}
- DataArrayDoubleTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
+ DataArrayDoubleTuple *__setitem__(PyObject *obj, PyObject *value)
{
const char msg[]="DataArrayDoubleTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
const char msg2[]="DataArrayDoubleTuple::__setitem__ : Mismatch of slice values in 2nd parameter (components) !";
{
public:
static DataArrayInt *New();
- int intValue() const throw(INTERP_KERNEL::Exception);
- int getHashCode() const throw(INTERP_KERNEL::Exception);
- bool empty() const throw(INTERP_KERNEL::Exception);
- void aggregate(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
- DataArrayInt *performCopyOrIncrRef(bool deepCopy) const throw(INTERP_KERNEL::Exception);
- void deepCopyFrom(const DataArrayInt& other) throw(INTERP_KERNEL::Exception);
- void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
- void pushBackSilent(int val) throw(INTERP_KERNEL::Exception);
- int popBackSilent() throw(INTERP_KERNEL::Exception);
- void pack() const throw(INTERP_KERNEL::Exception);
- void allocIfNecessary(int nbOfTuple, int nbOfCompo) throw(INTERP_KERNEL::Exception);
- bool isEqual(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
- bool isEqualWithoutConsideringStr(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
- bool isEqualWithoutConsideringStrAndOrder(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
- DataArrayInt *buildPermutationArr(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception);
- DataArrayInt *sumPerTuple() const throw(INTERP_KERNEL::Exception);
- void sort(bool asc=true) throw(INTERP_KERNEL::Exception);
- void reverse() throw(INTERP_KERNEL::Exception);
- void checkMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
- bool isMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
- void checkStrictlyMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
- bool isStrictlyMonotonic(bool increasing) const throw(INTERP_KERNEL::Exception);
- void fillWithZero() throw(INTERP_KERNEL::Exception);
- void fillWithValue(int val) throw(INTERP_KERNEL::Exception);
- void iota(int init=0) throw(INTERP_KERNEL::Exception);
- std::string repr() const throw(INTERP_KERNEL::Exception);
- std::string reprZip() const throw(INTERP_KERNEL::Exception);
- std::string reprNotTooLong() const throw(INTERP_KERNEL::Exception);
- DataArrayInt *invertArrayO2N2N2O(int newNbOfElem) const throw(INTERP_KERNEL::Exception);
- DataArrayInt *invertArrayN2O2O2N(int oldNbOfElem) const throw(INTERP_KERNEL::Exception);
- DataArrayInt *invertArrayO2N2N2OBis(int newNbOfElem) const throw(INTERP_KERNEL::Exception);
- MCAuto< MapII > invertArrayN2O2O2NOptimized() const throw(INTERP_KERNEL::Exception);
- MCAuto< MapII > giveN2OOptimized() const throw(INTERP_KERNEL::Exception);
- DataArrayInt *indicesOfSubPart(const DataArrayInt& partOfThis) const throw(INTERP_KERNEL::Exception);
- DataArrayInt *fromNoInterlace() const throw(INTERP_KERNEL::Exception);
- DataArrayInt *toNoInterlace() const throw(INTERP_KERNEL::Exception);
- DataArrayInt *selectByTupleIdSafeSlice(int bg, int end, int step) const throw(INTERP_KERNEL::Exception);
- DataArrayInt *checkAndPreparePermutation() const throw(INTERP_KERNEL::Exception);
- DataArrayInt *buildPermArrPerLevel() const throw(INTERP_KERNEL::Exception);
- bool isIota(int sizeExpected) const throw(INTERP_KERNEL::Exception);
- bool isUniform(int val) const throw(INTERP_KERNEL::Exception);
- int checkUniformAndGuess() const throw(INTERP_KERNEL::Exception);
- bool hasUniqueValues() const throw(INTERP_KERNEL::Exception);
- DataArrayInt *subArray(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
- void transpose() throw(INTERP_KERNEL::Exception);
- DataArrayInt *changeNbOfComponents(int newNbOfComp, int dftValue) const throw(INTERP_KERNEL::Exception);
- void meldWith(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
- void setPartOfValues1(const DataArrayInt *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true) throw(INTERP_KERNEL::Exception);
- void setPartOfValuesSimple1(int a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp) throw(INTERP_KERNEL::Exception);
- void setPartOfValuesAdv(const DataArrayInt *a, const DataArrayInt *tuplesSelec) throw(INTERP_KERNEL::Exception);
- void getTuple(int tupleId, int *res) const throw(INTERP_KERNEL::Exception);
- int getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
- int getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
- int front() const throw(INTERP_KERNEL::Exception);
- int back() const throw(INTERP_KERNEL::Exception);
- void setIJ(int tupleId, int compoId, int newVal) throw(INTERP_KERNEL::Exception);
- void setIJSilent(int tupleId, int compoId, int newVal) throw(INTERP_KERNEL::Exception);
- int *getPointer() throw(INTERP_KERNEL::Exception);
- const int *getConstPointer() const throw(INTERP_KERNEL::Exception);
- DataArrayIntIterator *iterator() throw(INTERP_KERNEL::Exception);
- const int *begin() const throw(INTERP_KERNEL::Exception);
- const int *end() const throw(INTERP_KERNEL::Exception);
- DataArrayInt *findIdsEqual(int val) const throw(INTERP_KERNEL::Exception);
- DataArrayInt *findIdsNotEqual(int val) const throw(INTERP_KERNEL::Exception);
- int changeValue(int oldValue, int newValue) throw(INTERP_KERNEL::Exception);
- int findIdFirstEqualTuple(const std::vector<int>& tupl) const throw(INTERP_KERNEL::Exception);
- int findIdFirstEqual(int value) const throw(INTERP_KERNEL::Exception);
- int findIdFirstEqual(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
- int findIdSequence(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
- bool presenceOfTuple(const std::vector<int>& tupl) const throw(INTERP_KERNEL::Exception);
- bool presenceOfValue(int value) const throw(INTERP_KERNEL::Exception);
- bool presenceOfValue(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
- int count(int value) const throw(INTERP_KERNEL::Exception);
- int accumulate(int compId) const throw(INTERP_KERNEL::Exception);
- int getMaxValueInArray() const throw(INTERP_KERNEL::Exception);
- int getMaxAbsValueInArray() const throw(INTERP_KERNEL::Exception);
- int getMinValueInArray() const throw(INTERP_KERNEL::Exception);
- void abs() throw(INTERP_KERNEL::Exception);
- DataArrayInt *computeAbs() const throw(INTERP_KERNEL::Exception);
- void applyLin(int a, int b, int compoId) throw(INTERP_KERNEL::Exception);
- void applyLin(int a, int b) throw(INTERP_KERNEL::Exception);
- void applyInv(int numerator) throw(INTERP_KERNEL::Exception);
- DataArrayInt *negate() const throw(INTERP_KERNEL::Exception);
- void applyDivideBy(int val) throw(INTERP_KERNEL::Exception);
- void applyModulus(int val) throw(INTERP_KERNEL::Exception);
- void applyRModulus(int val) throw(INTERP_KERNEL::Exception);
- void applyPow(int val) throw(INTERP_KERNEL::Exception);
- void applyRPow(int val) throw(INTERP_KERNEL::Exception);
- DataArrayInt *findIdsInRange(int vmin, int vmax) const throw(INTERP_KERNEL::Exception);
- DataArrayInt *findIdsNotInRange(int vmin, int vmax) const throw(INTERP_KERNEL::Exception);
- DataArrayInt *findIdsStrictlyNegative() const throw(INTERP_KERNEL::Exception);
- bool checkAllIdsInRange(int vmin, int vmax) const throw(INTERP_KERNEL::Exception);
- static DataArrayInt *Aggregate(const DataArrayInt *a1, const DataArrayInt *a2, int offsetA2) throw(INTERP_KERNEL::Exception);
- static DataArrayInt *Meld(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
- static DataArrayInt *MakePartition(const std::vector<const DataArrayInt *>& groups, int newNb, std::vector< std::vector<int> >& fidsOfGroups) throw(INTERP_KERNEL::Exception);
- static DataArrayInt *BuildUnion(const std::vector<const DataArrayInt *>& arr) throw(INTERP_KERNEL::Exception);
- static DataArrayInt *BuildIntersection(const std::vector<const DataArrayInt *>& arr) throw(INTERP_KERNEL::Exception);
- static DataArrayInt *FindPermutationFromFirstToSecond(const DataArrayInt *ids1, const DataArrayInt *ids2) throw(INTERP_KERNEL::Exception);
- DataArrayInt *buildComplement(int nbOfElement) const throw(INTERP_KERNEL::Exception);
- DataArrayInt *buildSubstraction(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
- DataArrayInt *buildSubstractionOptimized(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
- DataArrayInt *buildUnion(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
- DataArrayInt *buildIntersection(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception);
- DataArrayInt *buildUnique() const throw(INTERP_KERNEL::Exception);
- DataArrayInt *buildUniqueNotSorted() const throw(INTERP_KERNEL::Exception);
- DataArrayInt *deltaShiftIndex() const throw(INTERP_KERNEL::Exception);
- void computeOffsets() throw(INTERP_KERNEL::Exception);
- void computeOffsetsFull() throw(INTERP_KERNEL::Exception);
- DataArrayInt *buildExplicitArrByRanges(const DataArrayInt *offsets) const throw(INTERP_KERNEL::Exception);
- DataArrayInt *findRangeIdForEachTuple(const DataArrayInt *ranges) const throw(INTERP_KERNEL::Exception);
- DataArrayInt *findIdInRangeForEachTuple(const DataArrayInt *ranges) const throw(INTERP_KERNEL::Exception);
- void sortEachPairToMakeALinkedList() throw(INTERP_KERNEL::Exception);
- DataArrayInt *duplicateEachTupleNTimes(int nbTimes) const throw(INTERP_KERNEL::Exception);
- DataArrayInt *getDifferentValues() const throw(INTERP_KERNEL::Exception);
- static DataArrayInt *Add(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
- void addEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
- static DataArrayInt *Substract(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
- void substractEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
- static DataArrayInt *Multiply(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
- void multiplyEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
- static DataArrayInt *Divide(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
- void divideEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
- static DataArrayInt *Modulus(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
- void modulusEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
- static DataArrayInt *Pow(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
- void powEqual(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
- MCAuto<DataArrayInt> fromLinkedListOfPairToList() const throw(INTERP_KERNEL::Exception);
- MCAuto<DataArrayInt> findIdsGreaterOrEqualTo(int val) const throw(INTERP_KERNEL::Exception);
- MCAuto<DataArrayInt> findIdsGreaterThan(int val) const throw(INTERP_KERNEL::Exception);
- MCAuto<DataArrayInt> findIdsLowerOrEqualTo(int val) const throw(INTERP_KERNEL::Exception);
- MCAuto<DataArrayInt> findIdsLowerThan(int val) const throw(INTERP_KERNEL::Exception);
- MCAuto<DataArrayInt> selectPartDef(const PartDefinition* pd) const throw(INTERP_KERNEL::Exception);
- MCAuto<DataArrayDouble> convertToDblArr() const throw(INTERP_KERNEL::Exception);
- MCAuto<DataArrayFloat> convertToFloatArr() const throw(INTERP_KERNEL::Exception);
+ int intValue() const;
+ int getHashCode() const;
+ bool empty() const;
+ void aggregate(const DataArrayInt *other);
+ DataArrayInt *performCopyOrIncrRef(bool deepCopy) const;
+ void deepCopyFrom(const DataArrayInt& other);
+ void reserve(std::size_t nbOfElems);
+ void pushBackSilent(int val);
+ int popBackSilent();
+ void pack() const;
+ void allocIfNecessary(int nbOfTuple, int nbOfCompo);
+ bool isEqual(const DataArrayInt& other) const;
+ bool isEqualWithoutConsideringStr(const DataArrayInt& other) const;
+ bool isEqualWithoutConsideringStrAndOrder(const DataArrayInt& other) const;
+ DataArrayInt *buildPermutationArr(const DataArrayInt& other) const;
+ DataArrayInt *sumPerTuple() const;
+ void sort(bool asc=true);
+ void reverse();
+ void checkMonotonic(bool increasing) const;
+ bool isMonotonic(bool increasing) const;
+ void checkStrictlyMonotonic(bool increasing) const;
+ bool isStrictlyMonotonic(bool increasing) const;
+ void fillWithZero();
+ void fillWithValue(int val);
+ void iota(int init=0);
+ std::string repr() const;
+ std::string reprZip() const;
+ std::string reprNotTooLong() const;
+ DataArrayInt *invertArrayO2N2N2O(int newNbOfElem) const;
+ DataArrayInt *invertArrayN2O2O2N(int oldNbOfElem) const;
+ DataArrayInt *invertArrayO2N2N2OBis(int newNbOfElem) const;
+ MCAuto< MapII > invertArrayN2O2O2NOptimized() const;
+ MCAuto< MapII > giveN2OOptimized() const;
+ DataArrayInt *indicesOfSubPart(const DataArrayInt& partOfThis) const;
+ DataArrayInt *fromNoInterlace() const;
+ DataArrayInt *toNoInterlace() const;
+ DataArrayInt *selectByTupleIdSafeSlice(int bg, int end, int step) const;
+ DataArrayInt *checkAndPreparePermutation() const;
+ DataArrayInt *buildPermArrPerLevel() const;
+ bool isIota(int sizeExpected) const;
+ bool isUniform(int val) const;
+ int checkUniformAndGuess() const;
+ bool hasUniqueValues() const;
+ DataArrayInt *subArray(int tupleIdBg, int tupleIdEnd=-1) const;
+ void transpose();
+ DataArrayInt *changeNbOfComponents(int newNbOfComp, int dftValue) const;
+ void meldWith(const DataArrayInt *other);
+ void setPartOfValues1(const DataArrayInt *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true);
+ void setPartOfValuesSimple1(int a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp);
+ void setPartOfValuesAdv(const DataArrayInt *a, const DataArrayInt *tuplesSelec);
+ void getTuple(int tupleId, int *res) const;
+ int getIJ(int tupleId, int compoId) const;
+ int getIJSafe(int tupleId, int compoId) const;
+ int front() const;
+ int back() const;
+ void setIJ(int tupleId, int compoId, int newVal);
+ void setIJSilent(int tupleId, int compoId, int newVal);
+ int *getPointer();
+ const int *getConstPointer() const;
+ DataArrayIntIterator *iterator();
+ const int *begin() const;
+ const int *end() const;
+ DataArrayInt *findIdsEqual(int val) const;
+ DataArrayInt *findIdsNotEqual(int val) const;
+ int changeValue(int oldValue, int newValue);
+ int findIdFirstEqualTuple(const std::vector<int>& tupl) const;
+ int findIdFirstEqual(int value) const;
+ int findIdFirstEqual(const std::vector<int>& vals) const;
+ int findIdSequence(const std::vector<int>& vals) const;
+ bool presenceOfTuple(const std::vector<int>& tupl) const;
+ bool presenceOfValue(int value) const;
+ bool presenceOfValue(const std::vector<int>& vals) const;
+ int count(int value) const;
+ int accumulate(int compId) const;
+ int getMaxValueInArray() const;
+ int getMaxAbsValueInArray() const;
+ int getMinValueInArray() const;
+ void abs();
+ DataArrayInt *computeAbs() const;
+ void applyLin(int a, int b, int compoId);
+ void applyLin(int a, int b);
+ void applyInv(int numerator);
+ DataArrayInt *negate() const;
+ void applyDivideBy(int val);
+ void applyModulus(int val);
+ void applyRModulus(int val);
+ void applyPow(int val);
+ void applyRPow(int val);
+ DataArrayInt *findIdsInRange(int vmin, int vmax) const;
+ DataArrayInt *findIdsNotInRange(int vmin, int vmax) const;
+ DataArrayInt *findIdsStrictlyNegative() const;
+ bool checkAllIdsInRange(int vmin, int vmax) const;
+ static DataArrayInt *Aggregate(const DataArrayInt *a1, const DataArrayInt *a2, int offsetA2);
+ static DataArrayInt *Meld(const DataArrayInt *a1, const DataArrayInt *a2);
+ static DataArrayInt *MakePartition(const std::vector<const DataArrayInt *>& groups, int newNb, std::vector< std::vector<int> >& fidsOfGroups);
+ static DataArrayInt *BuildUnion(const std::vector<const DataArrayInt *>& arr);
+ static DataArrayInt *BuildIntersection(const std::vector<const DataArrayInt *>& arr);
+ static DataArrayInt *FindPermutationFromFirstToSecond(const DataArrayInt *ids1, const DataArrayInt *ids2);
+ DataArrayInt *buildComplement(int nbOfElement) const;
+ DataArrayInt *buildSubstraction(const DataArrayInt *other) const;
+ DataArrayInt *buildSubstractionOptimized(const DataArrayInt *other) const;
+ DataArrayInt *buildUnion(const DataArrayInt *other) const;
+ DataArrayInt *buildIntersection(const DataArrayInt *other) const;
+ DataArrayInt *buildUnique() const;
+ DataArrayInt *buildUniqueNotSorted() const;
+ DataArrayInt *deltaShiftIndex() const;
+ void computeOffsets();
+ void computeOffsetsFull();
+ DataArrayInt *buildExplicitArrByRanges(const DataArrayInt *offsets) const;
+ DataArrayInt *findRangeIdForEachTuple(const DataArrayInt *ranges) const;
+ DataArrayInt *findIdInRangeForEachTuple(const DataArrayInt *ranges) const;
+ void sortEachPairToMakeALinkedList();
+ DataArrayInt *duplicateEachTupleNTimes(int nbTimes) const;
+ DataArrayInt *getDifferentValues() const;
+ static DataArrayInt *Add(const DataArrayInt *a1, const DataArrayInt *a2);
+ void addEqual(const DataArrayInt *other);
+ static DataArrayInt *Substract(const DataArrayInt *a1, const DataArrayInt *a2);
+ void substractEqual(const DataArrayInt *other);
+ static DataArrayInt *Multiply(const DataArrayInt *a1, const DataArrayInt *a2);
+ void multiplyEqual(const DataArrayInt *other);
+ static DataArrayInt *Divide(const DataArrayInt *a1, const DataArrayInt *a2);
+ void divideEqual(const DataArrayInt *other);
+ static DataArrayInt *Modulus(const DataArrayInt *a1, const DataArrayInt *a2);
+ void modulusEqual(const DataArrayInt *other);
+ static DataArrayInt *Pow(const DataArrayInt *a1, const DataArrayInt *a2);
+ void powEqual(const DataArrayInt *other);
+ MCAuto<DataArrayInt> fromLinkedListOfPairToList() const;
+ MCAuto<DataArrayInt> findIdsGreaterOrEqualTo(int val) const;
+ MCAuto<DataArrayInt> findIdsGreaterThan(int val) const;
+ MCAuto<DataArrayInt> findIdsLowerOrEqualTo(int val) const;
+ MCAuto<DataArrayInt> findIdsLowerThan(int val) const;
+ MCAuto<DataArrayInt> selectPartDef(const PartDefinition* pd) const;
+ MCAuto<DataArrayDouble> convertToDblArr() const;
+ MCAuto<DataArrayFloat> convertToFloatArr() const;
public:
- static DataArrayInt *Range(int begin, int end, int step) throw(INTERP_KERNEL::Exception);
+ static DataArrayInt *Range(int begin, int end, int step);
%extend
{
- DataArrayInt() throw(INTERP_KERNEL::Exception)
+ DataArrayInt()
{
return DataArrayInt::New();
}
- static DataArrayInt *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
+ static DataArrayInt *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0)
{
const char *msgBase="MEDCoupling::DataArrayInt::New : Available API are : \n-DataArrayInt.New()\n-DataArrayInt.New([1,3,4])\n-DataArrayInt.New([1,3,4],3)\n-DataArrayInt.New([1,3,4,5],2,2)\n-DataArrayInt.New([1,3,4,5,7,8],3,2)\n-DataArrayInt.New([(1,3),(4,5),(7,8)])\n-DataArrayInt.New(5)\n-DataArrayInt.New(5,2)";
std::string msg(msgBase);
throw INTERP_KERNEL::Exception(msg.c_str());//to make g++ happy
}
- DataArrayInt(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
+ DataArrayInt(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0)
{
return MEDCoupling_DataArrayInt_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
}
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->reprNotTooLong();
}
- int __len__() const throw(INTERP_KERNEL::Exception)
+ int __len__() const
{
if(self->isAllocated())
{
}
}
- int __int__() const throw(INTERP_KERNEL::Exception)
+ int __int__() const
{
return self->intValue();
}
- DataArrayIntIterator *__iter__() throw(INTERP_KERNEL::Exception)
+ DataArrayIntIterator *__iter__()
{
return self->iterator();
}
- PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
+ PyObject *accumulate() const
{
int sz=self->getNumberOfComponents();
INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
return convertIntArrToPyList(tmp,sz);
}
- DataArrayInt *accumulatePerChunck(PyObject *indexArr) const throw(INTERP_KERNEL::Exception)
+ DataArrayInt *accumulatePerChunck(PyObject *indexArr) const
{
int sw,sz,val;
std::vector<int> val2;
return self->accumulatePerChunck(bg,bg+sz);
}
- DataArrayInt *findIdsEqualTuple(PyObject *inputTuple) const throw(INTERP_KERNEL::Exception)
+ DataArrayInt *findIdsEqualTuple(PyObject *inputTuple) const
{
int sw,sz,val;
std::vector<int> val2;
return self->findIdsEqualTuple(bg,bg+sz);
}
- DataArrayInt *findIdForEach(PyObject *vals) const throw(INTERP_KERNEL::Exception)
+ DataArrayInt *findIdForEach(PyObject *vals) const
{
int sw,sz,val;
std::vector<int> val2;
return ret.retn();
}
- PyObject *splitInBalancedSlices(int nbOfSlices) const throw(INTERP_KERNEL::Exception)
+ PyObject *splitInBalancedSlices(int nbOfSlices) const
{
std::vector< std::pair<int,int> > slcs(self->splitInBalancedSlices(nbOfSlices));
PyObject *ret=PyList_New(slcs.size());
return ret;
}
- DataArrayInt *buildExplicitArrOfSliceOnScaledArr(PyObject *slic) const throw(INTERP_KERNEL::Exception)
+ DataArrayInt *buildExplicitArrOfSliceOnScaledArr(PyObject *slic) const
{
if(!PySlice_Check(slic))
throw INTERP_KERNEL::Exception("DataArrayInt::buildExplicitArrOfSliceOnScaledArr (wrap) : expecting a pyslice as second (first) parameter !");
return self->buildExplicitArrOfSliceOnScaledArr(strt,stp,step);
}
- PyObject *getMinMaxValues() const throw(INTERP_KERNEL::Exception)
+ PyObject *getMinMaxValues() const
{
int a,b;
self->getMinMaxValues(a,b);
return ret;
}
- static PyObject *ConvertIndexArrayToO2N(int nbOfOldTuples, PyObject *arr, PyObject *arrI) throw(INTERP_KERNEL::Exception)
+ static PyObject *ConvertIndexArrayToO2N(int nbOfOldTuples, PyObject *arr, PyObject *arrI)
{
int newNbOfTuples=-1;
int szArr,szArrI,sw,iTypppArr,iTypppArrI;
return ret;
}
- static DataArrayInt *CheckAndPreparePermutation(PyObject *arr) throw(INTERP_KERNEL::Exception)
+ static DataArrayInt *CheckAndPreparePermutation(PyObject *arr)
{
MCAuto<DataArrayInt> ret(DataArrayInt::New());
int szArr,sw,iTypppArr;
std::vector<int> stdvecTyyppArr;
const int *arrPtr(convertIntStarLikePyObjToCppIntStar(arr,sw,szArr,iTypppArr,stdvecTyyppArr));
int *pt(MEDCoupling::DataArrayInt::CheckAndPreparePermutation(arrPtr,arrPtr+szArr));
- ret->useArray(pt,true,MEDCoupling::C_DEALLOC,szArr,1);
+ ret->useArray(pt,true,MEDCoupling::DeallocType::C_DEALLOC,szArr,1);
return ret.retn();
}
- void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
+ void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0)
{
const char *msg="MEDCoupling::DataArrayInt::setValues : Available API are : \n-DataArrayInt.setValues([1,3,4])\n-DataArrayInt.setValues([1,3,4],3)\n-DataArrayInt.setValues([1,3,4,5],2,2)\n-DataArrayInt.New(5)\n !";
if(PyList_Check(li) || PyTuple_Check(li))
throw INTERP_KERNEL::Exception(msg);
}
- PyObject *getValues() const throw(INTERP_KERNEL::Exception)
+ PyObject *getValues() const
{
const int *vals=self->getConstPointer();
return convertIntArrToPyList(vals,self->getNbOfElems());
}
#ifdef WITH_NUMPY
- PyObject *toNumPyArray() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
+ PyObject *toNumPyArray() // not const. It is not a bug !
{
return ToNumPyArray<DataArrayInt,int>(self,NPY_INT32,"DataArrayInt");
}
#endif
- PyObject *isEqualIfNotWhy(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception)
+ PyObject *isEqualIfNotWhy(const DataArrayInt& other) const
{
std::string ret1;
bool ret0=self->isEqualIfNotWhy(other,ret1);
return ret;
}
- PyObject *getValuesAsTuple() const throw(INTERP_KERNEL::Exception)
+ PyObject *getValuesAsTuple() const
{
const int *vals=self->getConstPointer();
int nbOfComp=self->getNumberOfComponents();
return convertIntArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
}
- static PyObject *MakePartition(PyObject *gps, int newNb) throw(INTERP_KERNEL::Exception)
+ static PyObject *MakePartition(PyObject *gps, int newNb)
{
std::vector<const DataArrayInt *> groups;
std::vector< std::vector<int> > fidsOfGroups;
return ret;
}
- void transformWithIndArr(PyObject *li) throw(INTERP_KERNEL::Exception)
+ void transformWithIndArr(PyObject *li)
{
void *da=0;
int res1(SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 ));
}
}
- DataArrayInt *findIdsEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ DataArrayInt *findIdsEqualList(PyObject *obj)
{
int sw;
int singleVal;
}
}
- DataArrayInt *findIdsNotEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ DataArrayInt *findIdsNotEqualList(PyObject *obj)
{
int sw;
int singleVal;
}
}
- PyObject *splitByValueRange(PyObject *li) const throw(INTERP_KERNEL::Exception)
+ PyObject *splitByValueRange(PyObject *li) const
{
DataArrayInt *ret0=0,*ret1=0,*ret2=0;
void *da=0;
return ret;
}
- DataArrayInt *transformWithIndArrR(PyObject *li) const throw(INTERP_KERNEL::Exception)
+ DataArrayInt *transformWithIndArrR(PyObject *li) const
{
void *da=0;
int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
}
}
- DataArrayInt *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
+ DataArrayInt *renumberAndReduce(PyObject *li, int newNbOfTuple)
{
void *da=0;
int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
}
}
- DataArrayInt *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
+ DataArrayInt *renumber(PyObject *li)
{
void *da=0;
int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
}
}
- DataArrayInt *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
+ DataArrayInt *renumberR(PyObject *li)
{
void *da=0;
int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
}
}
- void setSelectedComponents(const DataArrayInt *a, PyObject *li) throw(INTERP_KERNEL::Exception)
+ void setSelectedComponents(const DataArrayInt *a, PyObject *li)
{
std::vector<int> tmp;
convertPyToNewIntArr3(li,tmp);
self->setSelectedComponents(a,tmp);
}
- PyObject *explodeComponents() const throw(INTERP_KERNEL::Exception)
+ PyObject *explodeComponents() const
{
std::vector< MCAuto<DataArrayInt> > retCpp(self->explodeComponents());
std::size_t sz(retCpp.size());
return res;
}
- PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
+ PyObject *getTuple(int tupleId)
{
int sz=self->getNumberOfComponents();
INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
return convertIntArrToPyList(tmp,sz);
}
- PyObject *changeSurjectiveFormat(int targetNb) const throw(INTERP_KERNEL::Exception)
+ PyObject *changeSurjectiveFormat(int targetNb) const
{
DataArrayInt *arr=0;
DataArrayInt *arrI=0;
return res;
}
- static DataArrayInt *Meld(PyObject *li) throw(INTERP_KERNEL::Exception)
+ static DataArrayInt *Meld(PyObject *li)
{
std::vector<const DataArrayInt *> tmp;
convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
return DataArrayInt::Meld(tmp);
}
- static DataArrayInt *Aggregate(PyObject *li) throw(INTERP_KERNEL::Exception)
+ static DataArrayInt *Aggregate(PyObject *li)
{
std::vector<const DataArrayInt *> tmp;
convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
return DataArrayInt::Aggregate(tmp);
}
- static DataArrayInt *AggregateIndexes(PyObject *li) throw(INTERP_KERNEL::Exception)
+ static DataArrayInt *AggregateIndexes(PyObject *li)
{
std::vector<const DataArrayInt *> tmp;
convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
return DataArrayInt::AggregateIndexes(tmp);
}
- static DataArrayInt *BuildUnion(PyObject *li) throw(INTERP_KERNEL::Exception)
+ static DataArrayInt *BuildUnion(PyObject *li)
{
std::vector<const DataArrayInt *> tmp;
convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
return DataArrayInt::BuildUnion(tmp);
}
- static DataArrayInt *BuildIntersection(PyObject *li) throw(INTERP_KERNEL::Exception)
+ static DataArrayInt *BuildIntersection(PyObject *li)
{
std::vector<const DataArrayInt *> tmp;
convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
return DataArrayInt::BuildIntersection(tmp);
}
- PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
+ PyObject *getMaxValue() const
{
int tmp;
int r1=self->getMaxValue(tmp);
return ret;
}
- PyObject *getMaxAbsValue(std::size_t& tupleId) const throw(INTERP_KERNEL::Exception)
+ PyObject *getMaxAbsValue(std::size_t& tupleId) const
{
std::size_t tmp;
int r1=self->getMaxAbsValue(tmp);
return ret;
}
- PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
+ PyObject *getMinValue() const
{
int tmp;
int r1=self->getMinValue(tmp);
return ret;
}
- int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
+ int index(PyObject *obj) const
{
int nbOfCompo=self->getNumberOfComponents();
switch(nbOfCompo)
}
}
- bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
+ bool __contains__(PyObject *obj) const
{
int nbOfCompo=self->getNumberOfComponents();
switch(nbOfCompo)
}
}
- PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *__getitem__(PyObject *obj)
{
const char msg[]="Unexpected situation in DataArrayInt::__getitem__ !";
const char msg2[]="DataArrayInt::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
}
}
- DataArrayInt *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
+ DataArrayInt *__setitem__(PyObject *obj, PyObject *value)
{
self->checkAllocated();
const char msg[]="Unexpected situation in __setitem__ !";
return self;
case 2:
tmp=DataArrayInt::New();
- tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
+ tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
return self;
case 3:
return self;
case 2:
tmp=DataArrayInt::New();
- tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
+ tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
return self;
case 3:
return self;
case 2:
tmp=DataArrayInt::New();
- tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
+ tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
return self;
case 3:
return self;
case 2:
tmp=DataArrayInt::New();
- tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
+ tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
return self;
case 3:
return self;
case 2:
tmp=DataArrayInt::New();
- tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
+ tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
return self;
case 3:
return self;
case 2:
tmp=DataArrayInt::New();
- tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
+ tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
return self;
case 3:
return self;
case 2:
tmp=DataArrayInt::New();
- tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
+ tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
return self;
case 3:
return self;
case 2:
tmp=DataArrayInt::New();
- tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
+ tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
return self;
case 3:
return self;
case 2:
tmp=DataArrayInt::New();
- tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
+ tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
return self;
case 3:
return self;
case 2:
tmp=DataArrayInt::New();
- tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
+ tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
return self;
case 3:
return self;
case 2:
tmp=DataArrayInt::New();
- tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
+ tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size(),false);
return self;
case 3:
return self;
case 2:
tmp=DataArrayInt::New();
- tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
+ tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
return self;
case 3:
return self;
case 2:
tmp=DataArrayInt::New();
- tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
+ tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
return self;
case 3:
return self;
case 2:
tmp=DataArrayInt::New();
- tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
+ tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
return self;
case 3:
return self;
case 2:
tmp=DataArrayInt::New();
- tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
+ tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
return self;
case 3:
return self;
case 2:
tmp=DataArrayInt::New();
- tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
+ tmp->useArray(&v1[0],false,DeallocType::CPP_DEALLOC,1,v1.size());
self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
return self;
case 3:
return self;
}
- DataArrayInt *__neg__() const throw(INTERP_KERNEL::Exception)
+ DataArrayInt *__neg__() const
{
return self->negate();
}
- DataArrayInt *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ DataArrayInt *__add__(PyObject *obj)
{
const char msg[]="Unexpected situation in __add__ !";
int val;
}
case 2:
{
- MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
+ MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,(int)aa.size());
return DataArrayInt::Add(self,aaaa);
}
case 3:
}
}
- DataArrayInt *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ DataArrayInt *__radd__(PyObject *obj)
{
const char msg[]="Unexpected situation in __radd__ !";
int val;
}
case 2:
{
- MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
+ MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,(int)aa.size());
return DataArrayInt::Add(self,aaaa);
}
case 4:
}
}
- PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *___iadd___(PyObject *trueSelf, PyObject *obj)
{
const char msg[]="Unexpected situation in __iadd__ !";
int val;
}
case 2:
{
- MCAuto<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
+ MCAuto<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,(int)aa.size());
self->addEqual(bb);
Py_XINCREF(trueSelf);
return trueSelf;
}
}
- DataArrayInt *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ DataArrayInt *__sub__(PyObject *obj)
{
const char msg[]="Unexpected situation in __sub__ !";
int val;
}
case 2:
{
- MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
+ MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,(int)aa.size());
return DataArrayInt::Substract(self,aaaa);
}
case 3:
}
}
- DataArrayInt *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ DataArrayInt *__rsub__(PyObject *obj)
{
const char msg[]="Unexpected situation in __rsub__ !";
int val;
}
case 2:
{
- MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
+ MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,(int)aa.size());
return DataArrayInt::Substract(aaaa,self);
}
case 4:
}
}
- PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *___isub___(PyObject *trueSelf, PyObject *obj)
{
const char msg[]="Unexpected situation in __isub__ !";
int val;
}
case 2:
{
- MCAuto<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
+ MCAuto<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,(int)aa.size());
self->substractEqual(bb);
Py_XINCREF(trueSelf);
return trueSelf;
}
}
- DataArrayInt *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ DataArrayInt *__mul__(PyObject *obj)
{
const char msg[]="Unexpected situation in __mul__ !";
int val;
}
case 2:
{
- MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
+ MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,(int)aa.size());
return DataArrayInt::Multiply(self,aaaa);
}
case 3:
}
}
- DataArrayInt *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ DataArrayInt *__rmul__(PyObject *obj)
{
const char msg[]="Unexpected situation in __rmul__ !";
int val;
}
case 2:
{
- MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
+ MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,(int)aa.size());
return DataArrayInt::Multiply(self,aaaa);
}
case 4:
}
}
- PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *___imul___(PyObject *trueSelf, PyObject *obj)
{
const char msg[]="Unexpected situation in __imul__ !";
int val;
}
case 2:
{
- MCAuto<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
+ MCAuto<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,(int)aa.size());
self->multiplyEqual(bb);
Py_XINCREF(trueSelf);
return trueSelf;
}
}
- DataArrayInt *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ DataArrayInt *__div__(PyObject *obj)
{
const char msg[]="Unexpected situation in __div__ !";
int val;
}
case 2:
{
- MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
+ MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,(int)aa.size());
return DataArrayInt::Divide(self,aaaa);
}
case 3:
}
}
- DataArrayInt *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ DataArrayInt *__rdiv__(PyObject *obj)
{
const char msg[]="Unexpected situation in __rdiv__ !";
int val;
}
case 2:
{
- MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
+ MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,(int)aa.size());
return DataArrayInt::Divide(aaaa,self);
}
case 4:
}
}
- PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *___idiv___(PyObject *trueSelf, PyObject *obj)
{
const char msg[]="Unexpected situation in __idiv__ !";
int val;
}
case 2:
{
- MCAuto<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
+ MCAuto<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,(int)aa.size());
self->divideEqual(bb);
Py_XINCREF(trueSelf);
return trueSelf;
}
}
- DataArrayInt *__mod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ DataArrayInt *__mod__(PyObject *obj)
{
const char msg[]="Unexpected situation in __mod__ !";
int val;
}
case 2:
{
- MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
+ MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,(int)aa.size());
return DataArrayInt::Modulus(self,aaaa);
}
case 3:
}
}
- DataArrayInt *__rmod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ DataArrayInt *__rmod__(PyObject *obj)
{
const char msg[]="Unexpected situation in __rmod__ !";
int val;
}
case 2:
{
- MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
+ MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,(int)aa.size());
return DataArrayInt::Modulus(aaaa,self);
}
case 3:
}
}
- PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *___imod___(PyObject *trueSelf, PyObject *obj)
{
const char msg[]="Unexpected situation in __imod__ !";
int val;
}
}
- DataArrayInt *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ DataArrayInt *__pow__(PyObject *obj)
{
const char msg[]="Unexpected situation in __pow__ !";
int val;
}
case 2:
{
- MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
+ MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,(int)aa.size());
return DataArrayInt::Pow(self,aaaa);
}
case 3:
}
}
- DataArrayInt *__rpow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ DataArrayInt *__rpow__(PyObject *obj)
{
const char msg[]="Unexpected situation in __rpow__ !";
int val;
}
case 2:
{
- MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
+ MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,DeallocType::CPP_DEALLOC,1,(int)aa.size());
return DataArrayInt::Pow(aaaa,self);
}
case 3:
}
}
- PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *___ipow___(PyObject *trueSelf, PyObject *obj)
{
const char msg[]="Unexpected situation in __ipow__ !";
int val;
}
}
- std::string __repr__() const throw(INTERP_KERNEL::Exception)
+ std::string __repr__() const
{
std::ostringstream oss;
self->reprQuickOverview(oss);
return oss.str();
}
- void pushBackValsSilent(PyObject *li) throw(INTERP_KERNEL::Exception)
+ void pushBackValsSilent(PyObject *li)
{
int szArr,sw,iTypppArr;
std::vector<int> stdvecTyyppArr;
self->pushBackValsSilent(tmp,tmp+szArr);
}
- PyObject *partitionByDifferentValues() const throw(INTERP_KERNEL::Exception)
+ PyObject *partitionByDifferentValues() const
{
std::vector<int> ret1;
std::vector<DataArrayInt *> ret0=self->partitionByDifferentValues(ret1);
return pyRet;
}
- PyObject *findIdsRangesInListOfIds(const DataArrayInt *listOfIds) const throw(INTERP_KERNEL::Exception)
+ PyObject *findIdsRangesInListOfIds(const DataArrayInt *listOfIds) const
{
DataArrayInt *ret0=0,*ret1=0;
self->findIdsRangesInListOfIds(listOfIds,ret0,ret1);
return pyRet;
}
- PyObject *isRange() const throw(INTERP_KERNEL::Exception)
+ PyObject *isRange() const
{
int a(0),b(0),c(0);
bool ret(self->isRange(a,b,c));
PyTuple_SetItem(pyRet,1,ret1Py);
return pyRet;
}
- }
+
+ static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
+ {
+ int sw;
+ int singleVal;
+ std::vector<int> multiVal;
+ std::pair<int, std::pair<int,int> > slic;
+ MEDCoupling::DataArrayInt *daIntTyypp=0;
+ if(!arrIndx)
+ throw INTERP_KERNEL::Exception("DataArrayInt::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
+ convertIntStarOrSliceLikePyObjToCpp(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
+ switch(sw)
+ {
+ case 1:
+ return DataArrayInt::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
+ case 2:
+ return DataArrayInt::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
+ case 4:
+ return DataArrayInt::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
+ default:
+ throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
+ }
+ }
+
+ static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
+ {
+ DataArrayInt *arrOut=0,*arrIndexOut=0;
+ int sw;
+ int singleVal;
+ std::vector<int> multiVal;
+ std::pair<int, std::pair<int,int> > slic;
+ MEDCoupling::DataArrayInt *daIntTyypp=0;
+ if(!arrIndxIn)
+ throw INTERP_KERNEL::Exception("DataArrayInt::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
+ convertIntStarOrSliceLikePyObjToCpp(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
+ switch(sw)
+ {
+ case 1:
+ {
+ DataArrayInt::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
+ break;
+ }
+ case 2:
+ {
+ DataArrayInt::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
+ break;
+ }
+ case 4:
+ {
+ DataArrayInt::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
+ break;
+ }
+ default:
+ throw INTERP_KERNEL::Exception("DataArrayInt::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
+ }
+ PyObject *ret=PyTuple_New(2);
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ return ret;
+ }
+
+ static PyObject *ExtractFromIndexedArraysSlice(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
+ {
+ DataArrayInt *arrOut=0,*arrIndexOut=0;
+ DataArrayInt::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
+ PyObject *ret=PyTuple_New(2);
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ return ret;
+ }
+
+ static PyObject *ExtractFromIndexedArraysSlice(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
+ {
+ if(!PySlice_Check(slic))
+ throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : the first param is not a pyslice !");
+ Py_ssize_t strt=2,stp=2,step=2;
+ if(!arrIndxIn)
+ throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : last array is null !");
+ arrIndxIn->checkAllocated();
+ if(arrIndxIn->getNumberOfComponents()!=1)
+ throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : number of components of last argument must be equal to one !");
+ GetIndicesOfSlice(slic,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArraysSlice (wrap) : Invalid slice regarding nb of elements !");
+ DataArrayInt *arrOut=0,*arrIndexOut=0;
+ DataArrayInt::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
+ PyObject *ret=PyTuple_New(2);
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ return ret;
+ }
+
+ static PyObject *SetPartOfIndexedArrays(PyObject *li,
+ const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
+ const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
+ {
+ DataArrayInt *arrOut=0,*arrIndexOut=0;
+ int sw;
+ int singleVal;
+ std::vector<int> multiVal;
+ std::pair<int, std::pair<int,int> > slic;
+ MEDCoupling::DataArrayInt *daIntTyypp=0;
+ if(!arrIndxIn)
+ throw INTERP_KERNEL::Exception("DataArrayInt::SetPartOfIndexedArrays : null pointer as arrIndex !");
+ convertIntStarOrSliceLikePyObjToCpp(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
+ switch(sw)
+ {
+ case 1:
+ {
+ DataArrayInt::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
+ break;
+ }
+ case 2:
+ {
+ DataArrayInt::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
+ break;
+ }
+ case 4:
+ {
+ DataArrayInt::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
+ break;
+ }
+ default:
+ throw INTERP_KERNEL::Exception("DataArrayInt::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
+ }
+ PyObject *ret=PyTuple_New(2);
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ return ret;
+ }
+
+ static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
+ const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
+ {
+ int sw;
+ int singleVal;
+ std::vector<int> multiVal;
+ std::pair<int, std::pair<int,int> > slic;
+ MEDCoupling::DataArrayInt *daIntTyypp=0;
+ if(!arrIndxIn)
+ throw INTERP_KERNEL::Exception("DataArrayInt::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
+ convertIntStarOrSliceLikePyObjToCpp(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
+ switch(sw)
+ {
+ case 1:
+ {
+ DataArrayInt::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
+ break;
+ }
+ case 2:
+ {
+ DataArrayInt::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
+ break;
+ }
+ case 4:
+ {
+ DataArrayInt::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
+ break;
+ }
+ default:
+ throw INTERP_KERNEL::Exception("DataArrayInt::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
+ }
+ }
+
+ } // end extent
};
class DataArrayIntTuple;
class DataArrayIntTuple
{
public:
- int getNumberOfCompo() const throw(INTERP_KERNEL::Exception);
- DataArrayInt *buildDAInt(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
+ int getNumberOfCompo() const;
+ DataArrayInt *buildDAInt(int nbOfTuples, int nbOfCompo) const;
%extend
{
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->repr();
}
- int __int__() const throw(INTERP_KERNEL::Exception)
+ int __int__() const
{
return self->intValue();
}
- DataArrayInt *buildDAInt() throw(INTERP_KERNEL::Exception)
+ DataArrayInt *buildDAInt()
{
return self->buildDAInt(1,self->getNumberOfCompo());
}
- PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *___iadd___(PyObject *trueSelf, PyObject *obj)
{
MCAuto<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
MEDCoupling_DataArrayInt____iadd___(ret,0,obj);
return trueSelf;
}
- PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *___isub___(PyObject *trueSelf, PyObject *obj)
{
MCAuto<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
MEDCoupling_DataArrayInt____isub___(ret,0,obj);
return trueSelf;
}
- PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *___imul___(PyObject *trueSelf, PyObject *obj)
{
MCAuto<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
MEDCoupling_DataArrayInt____imul___(ret,0,obj);
Py_XINCREF(trueSelf);
return trueSelf;
}
- PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *___idiv___(PyObject *trueSelf, PyObject *obj)
{
MCAuto<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
MEDCoupling_DataArrayInt____idiv___(ret,0,obj);
return trueSelf;
}
- PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *___imod___(PyObject *trueSelf, PyObject *obj)
{
MCAuto<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
MEDCoupling_DataArrayInt____imod___(ret,0,obj);
return trueSelf;
}
- PyObject *__len__() throw(INTERP_KERNEL::Exception)
+ PyObject *__len__()
{
return PyInt_FromLong(self->getNumberOfCompo());
}
- PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *__getitem__(PyObject *obj)
{
const char msg2[]="DataArrayIntTuple::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
int sw;
}
}
- DataArrayIntTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
+ DataArrayIntTuple *__setitem__(PyObject *obj, PyObject *value)
{
const char msg[]="DataArrayIntTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
const char msg2[]="DataArrayIntTuple::__setitem__ : Mismatch of slice values in 2nd parameter (components) !";
class DataArrayChar : public DataArray
{
public:
- virtual DataArrayChar *buildEmptySpecializedDAChar() const throw(INTERP_KERNEL::Exception);
- int getHashCode() const throw(INTERP_KERNEL::Exception);
- bool empty() const throw(INTERP_KERNEL::Exception);
- void deepCopyFrom(const DataArrayChar& other) throw(INTERP_KERNEL::Exception);
- void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
- void pushBackSilent(char val) throw(INTERP_KERNEL::Exception);
- char popBackSilent() throw(INTERP_KERNEL::Exception);
- void pack() const throw(INTERP_KERNEL::Exception);
- void allocIfNecessary(int nbOfTuple, int nbOfCompo) throw(INTERP_KERNEL::Exception);
- bool isEqual(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception);
- bool isEqualWithoutConsideringStr(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception);
- void reverse() throw(INTERP_KERNEL::Exception);
- void fillWithZero() throw(INTERP_KERNEL::Exception);
- void fillWithValue(char val) throw(INTERP_KERNEL::Exception);
- std::string repr() const throw(INTERP_KERNEL::Exception);
- std::string reprZip() const throw(INTERP_KERNEL::Exception);
- DataArrayInt *convertToIntArr() const throw(INTERP_KERNEL::Exception);
- DataArrayChar *renumber(const int *old2New) const throw(INTERP_KERNEL::Exception);
- DataArrayChar *renumberR(const int *new2Old) const throw(INTERP_KERNEL::Exception);
- DataArrayChar *renumberAndReduce(const int *old2NewBg, int newNbOfTuple) const throw(INTERP_KERNEL::Exception);
- bool isUniform(char val) const throw(INTERP_KERNEL::Exception);
- void sort(bool asc=true) throw(INTERP_KERNEL::Exception);
- DataArrayChar *subArray(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
- DataArrayChar *changeNbOfComponents(int newNbOfComp, char dftValue) const throw(INTERP_KERNEL::Exception);
- void meldWith(const DataArrayChar *other) throw(INTERP_KERNEL::Exception);
- void setPartOfValuesAdv(const DataArrayChar *a, const DataArrayInt *tuplesSelec) throw(INTERP_KERNEL::Exception);
- char front() const throw(INTERP_KERNEL::Exception);
- char back() const throw(INTERP_KERNEL::Exception);
- void setIJ(int tupleId, int compoId, char newVal) throw(INTERP_KERNEL::Exception);
- void setIJSilent(int tupleId, int compoId, char newVal) throw(INTERP_KERNEL::Exception);
- char *getPointer() throw(INTERP_KERNEL::Exception);
- DataArrayInt *findIdsEqual(char val) const throw(INTERP_KERNEL::Exception);
- DataArrayInt *findIdsNotEqual(char val) const throw(INTERP_KERNEL::Exception);
- int findIdFirstEqualTuple(const std::vector<char>& tupl) const throw(INTERP_KERNEL::Exception);
- bool presenceOfTuple(const std::vector<char>& tupl) const throw(INTERP_KERNEL::Exception);
- char getMaxValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
- char getMaxValueInArray() const throw(INTERP_KERNEL::Exception);
- char getMinValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
- char getMinValueInArray() const throw(INTERP_KERNEL::Exception);
- DataArrayInt *findIdsInRange(char vmin, char vmax) const throw(INTERP_KERNEL::Exception);
- static DataArrayChar *Aggregate(const DataArrayChar *a1, const DataArrayChar *a2) throw(INTERP_KERNEL::Exception);
- static DataArrayChar *Meld(const DataArrayChar *a1, const DataArrayChar *a2) throw(INTERP_KERNEL::Exception);
+ virtual DataArrayChar *buildEmptySpecializedDAChar() const;
+ int getHashCode() const;
+ bool empty() const;
+ void deepCopyFrom(const DataArrayChar& other);
+ void reserve(std::size_t nbOfElems);
+ void pushBackSilent(char val);
+ char popBackSilent();
+ void pack() const;
+ void allocIfNecessary(int nbOfTuple, int nbOfCompo);
+ bool isEqual(const DataArrayChar& other) const;
+ bool isEqualWithoutConsideringStr(const DataArrayChar& other) const;
+ void reverse();
+ void fillWithZero();
+ void fillWithValue(char val);
+ std::string repr() const;
+ std::string reprZip() const;
+ DataArrayInt *convertToIntArr() const;
+ DataArrayChar *renumber(const int *old2New) const;
+ DataArrayChar *renumberR(const int *new2Old) const;
+ DataArrayChar *renumberAndReduce(const int *old2NewBg, int newNbOfTuple) const;
+ bool isUniform(char val) const;
+ void sort(bool asc=true);
+ DataArrayChar *subArray(int tupleIdBg, int tupleIdEnd=-1) const;
+ DataArrayChar *changeNbOfComponents(int newNbOfComp, char dftValue) const;
+ void meldWith(const DataArrayChar *other);
+ void setPartOfValuesAdv(const DataArrayChar *a, const DataArrayInt *tuplesSelec);
+ char front() const;
+ char back() const;
+ void setIJ(int tupleId, int compoId, char newVal);
+ void setIJSilent(int tupleId, int compoId, char newVal);
+ char *getPointer();
+ DataArrayInt *findIdsEqual(char val) const;
+ DataArrayInt *findIdsNotEqual(char val) const;
+ int findIdFirstEqualTuple(const std::vector<char>& tupl) const;
+ bool presenceOfTuple(const std::vector<char>& tupl) const;
+ char getMaxValue(int& tupleId) const;
+ char getMaxValueInArray() const;
+ char getMinValue(int& tupleId) const;
+ char getMinValueInArray() const;
+ DataArrayInt *findIdsInRange(char vmin, char vmax) const;
+ static DataArrayChar *Aggregate(const DataArrayChar *a1, const DataArrayChar *a2);
+ static DataArrayChar *Meld(const DataArrayChar *a1, const DataArrayChar *a2);
%extend
{
- int __len__() const throw(INTERP_KERNEL::Exception)
+ int __len__() const
{
if(self->isAllocated())
{
}
}
- PyObject *isEqualIfNotWhy(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception)
+ PyObject *isEqualIfNotWhy(const DataArrayChar& other) const
{
std::string ret1;
bool ret0=self->isEqualIfNotWhy(other,ret1);
return ret;
}
- DataArrayChar *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
+ DataArrayChar *renumber(PyObject *li)
{
void *da=0;
int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
}
}
- DataArrayChar *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
+ DataArrayChar *renumberR(PyObject *li)
{
void *da=0;
int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
}
}
- DataArrayChar *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
+ DataArrayChar *renumberAndReduce(PyObject *li, int newNbOfTuple)
{
void *da=0;
int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
}
}
- static DataArrayChar *Aggregate(PyObject *dachs) throw(INTERP_KERNEL::Exception)
+ static DataArrayChar *Aggregate(PyObject *dachs)
{
std::vector<const MEDCoupling::DataArrayChar *> tmp;
convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayChar *>(dachs,SWIGTYPE_p_MEDCoupling__DataArrayChar,"DataArrayChar",tmp);
return DataArrayChar::Aggregate(tmp);
}
- static DataArrayChar *Meld(PyObject *dachs) throw(INTERP_KERNEL::Exception)
+ static DataArrayChar *Meld(PyObject *dachs)
{
std::vector<const MEDCoupling::DataArrayChar *> tmp;
convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayChar *>(dachs,SWIGTYPE_p_MEDCoupling__DataArrayChar,"DataArrayChar",tmp);
{
public:
static DataArrayByte *New();
- DataArrayByteIterator *iterator() throw(INTERP_KERNEL::Exception);
- DataArrayByte *performCopyOrIncrRef(bool deepCopy) const throw(INTERP_KERNEL::Exception);
- char byteValue() const throw(INTERP_KERNEL::Exception);
+ DataArrayByteIterator *iterator();
+ DataArrayByte *performCopyOrIncrRef(bool deepCopy) const;
+ char byteValue() const;
%extend
{
- DataArrayByte() throw(INTERP_KERNEL::Exception)
+ DataArrayByte()
{
return DataArrayByte::New();
}
- static DataArrayByte *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
+ static DataArrayByte *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0)
{
const char *msg="MEDCoupling::DataArrayByte::New : Available API are : \n-DataArrayByte.New()\n--DataArrayByte.New([1,3,4])\n-DataArrayByte.New([1,3,4],3)\n-DataArrayByte.New([1,3,4,5],2,2)\n-DataArrayByte.New(5)\n-DataArrayByte.New(5,2) !";
if(PyList_Check(elt0) || PyTuple_Check(elt0))
throw INTERP_KERNEL::Exception(msg);
}
- DataArrayByte(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
+ DataArrayByte(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0)
{
return MEDCoupling_DataArrayByte_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
}
- std::string __repr__() const throw(INTERP_KERNEL::Exception)
+ std::string __repr__() const
{
std::ostringstream oss;
self->reprQuickOverview(oss);
return oss.str();
}
- int __int__() const throw(INTERP_KERNEL::Exception)
+ int __int__() const
{
return (int) self->byteValue();
}
- DataArrayByteIterator *__iter__() throw(INTERP_KERNEL::Exception)
+ DataArrayByteIterator *__iter__()
{
return self->iterator();
}
- int getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
+ int getIJ(int tupleId, int compoId) const
{
return (int)self->getIJ(tupleId,compoId);
}
- int getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
+ int getIJSafe(int tupleId, int compoId) const
{
return (int)self->getIJSafe(tupleId,compoId);
}
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->repr();
}
- PyObject *toStrList() const throw(INTERP_KERNEL::Exception)
+ PyObject *toStrList() const
{
const char *vals=self->getConstPointer();
int nbOfComp=self->getNumberOfComponents();
return convertCharArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
}
- bool presenceOfTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
+ bool presenceOfTuple(PyObject *tupl) const
{
int sz=-1,sw=-1;
int ival=-1; std::vector<int> ivval;
return self->presenceOfTuple(vals);
}
- bool presenceOfValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
+ bool presenceOfValue(PyObject *vals) const
{
int sz=-1,sw=-1;
int ival=-1; std::vector<int> ivval;
return self->presenceOfValue(vals2);
}
- int findIdFirstEqual(PyObject *vals) const throw(INTERP_KERNEL::Exception)
+ int findIdFirstEqual(PyObject *vals) const
{
int sz=-1,sw=-1;
int ival=-1; std::vector<int> ivval;
return self->findIdFirstEqual(vals2);
}
- int findIdFirstEqualTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
+ int findIdFirstEqualTuple(PyObject *tupl) const
{
int sz=-1,sw=-1;
int ival=-1; std::vector<int> ivval;
return self->findIdFirstEqualTuple(vals);
}
- int findIdSequence(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
+ int findIdSequence(PyObject *strOrListOfInt) const
{
int sz=-1,sw=-1;
int ival=-1; std::vector<int> ivval;
return self->findIdSequence(vals);
}
- PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
+ PyObject *getTuple(int tupleId)
{
int sz=self->getNumberOfComponents();
INTERP_KERNEL::AutoPtr<char> tmp=new char[sz];
return ret;
}
- PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
+ PyObject *getMaxValue() const
{
int tmp;
int r1=(int)self->getMaxValue(tmp);
return ret;
}
- PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
+ PyObject *getMinValue() const
{
int tmp;
int r1=(int)self->getMinValue(tmp);
return ret;
}
- int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
+ int index(PyObject *obj) const
{
int nbOfCompo=self->getNumberOfComponents();
switch(nbOfCompo)
}
}
- bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
+ bool __contains__(PyObject *obj) const
{
int nbOfCompo=self->getNumberOfComponents();
switch(nbOfCompo)
}
#ifdef WITH_NUMPY
- PyObject *toNumPyArray() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
+ PyObject *toNumPyArray() // not const. It is not a bug !
{
return ToNumPyArray<DataArrayByte,char>(self,NPY_INT8,"DataArrayByte");
}
#endif
- DataArrayByte *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
+ DataArrayByte *__setitem__(PyObject *obj, PyObject *value)
{
self->checkAllocated();
const char msg[]="Unexpected situation in __setitem__ !";
class DataArrayByteTuple
{
public:
- std::string repr() const throw(INTERP_KERNEL::Exception);
- DataArrayByte *buildDAByte(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
+ std::string repr() const;
+ DataArrayByte *buildDAByte(int nbOfTuples, int nbOfCompo) const;
%extend
{
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->repr();
}
- char __int__() const throw(INTERP_KERNEL::Exception)
+ char __int__() const
{
return self->byteValue();
}
- DataArrayByte *buildDAByte() throw(INTERP_KERNEL::Exception)
+ DataArrayByte *buildDAByte()
{
return self->buildDAByte(1,self->getNumberOfCompo());
}
{
public:
static DataArrayAsciiChar *New();
- DataArrayAsciiCharIterator *iterator() throw(INTERP_KERNEL::Exception);
- DataArrayAsciiChar *performCopyOrIncrRef(bool deepCopy) const throw(INTERP_KERNEL::Exception);
- char asciiCharValue() const throw(INTERP_KERNEL::Exception);
+ DataArrayAsciiCharIterator *iterator();
+ DataArrayAsciiChar *performCopyOrIncrRef(bool deepCopy) const;
+ char asciiCharValue() const;
%extend
{
- DataArrayAsciiChar() throw(INTERP_KERNEL::Exception)
+ DataArrayAsciiChar()
{
return DataArrayAsciiChar::New();
}
- static DataArrayAsciiChar *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
+ static DataArrayAsciiChar *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0)
{
const char *msg="MEDCoupling::DataArrayAsciiChar::New : Available API are : \n-DataArrayAsciiChar.New()\n-DataArrayAsciiChar.New([1,3,4])\n-DataArrayAsciiChar.New([\"abc\",\"de\",\"fghi\"])\n-DataArrayAsciiChar.New([\"abc\",\"de\",\"fghi\"],\"t\")\n-DataArrayAsciiChar.New([1,3,4],3)\n-DataArrayAsciiChar.New([1,3,4,5],2,2)\n-DataArrayAsciiChar.New(5)\n-DataArrayAsciiChar.New(5,2) !";
if(PyList_Check(elt0) || PyTuple_Check(elt0))
throw INTERP_KERNEL::Exception(msg);
}
- DataArrayAsciiChar(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
+ DataArrayAsciiChar(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0)
{
return MEDCoupling_DataArrayAsciiChar_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
}
- std::string __repr__() const throw(INTERP_KERNEL::Exception)
+ std::string __repr__() const
{
std::ostringstream oss;
self->reprQuickOverview(oss);
return oss.str();
}
- DataArrayAsciiCharIterator *__iter__() throw(INTERP_KERNEL::Exception)
+ DataArrayAsciiCharIterator *__iter__()
{
return self->iterator();
}
- std::string getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
+ std::string getIJ(int tupleId, int compoId) const
{
char tmp[2]; tmp[1]='\0';
tmp[0]=self->getIJ(tupleId,compoId);
return std::string(tmp);
}
- std::string getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
+ std::string getIJSafe(int tupleId, int compoId) const
{
char tmp[2]; tmp[1]='\0';
tmp[0]=self->getIJSafe(tupleId,compoId);
return std::string(tmp);
}
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->repr();
}
- PyObject *toStrList() const throw(INTERP_KERNEL::Exception)
+ PyObject *toStrList() const
{
const char *vals=self->getConstPointer();
int nbOfComp=self->getNumberOfComponents();
return convertCharArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
}
- bool presenceOfTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
+ bool presenceOfTuple(PyObject *tupl) const
{
if(PyString_Check(tupl))
{
throw INTERP_KERNEL::Exception("DataArrayAsciiChar::presenceOfTuple : only strings in input supported !");
}
- bool presenceOfValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
+ bool presenceOfValue(PyObject *vals) const
{
if(PyString_Check(vals))
{
throw INTERP_KERNEL::Exception("DataArrayAsciiChar::presenceOfValue : only strings in input supported !");
}
- int findIdFirstEqual(PyObject *vals) const throw(INTERP_KERNEL::Exception)
+ int findIdFirstEqual(PyObject *vals) const
{
if(PyString_Check(vals))
{
throw INTERP_KERNEL::Exception("DataArrayAsciiChar::findIdFirstEqual : only strings in input supported !");
}
- int findIdFirstEqualTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
+ int findIdFirstEqualTuple(PyObject *tupl) const
{
if(PyString_Check(tupl))
{
throw INTERP_KERNEL::Exception("DataArrayAsciiChar::findIdFirstEqualTuple : only strings in input supported !");
}
- int findIdSequence(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
+ int findIdSequence(PyObject *strOrListOfInt) const
{
if(PyString_Check(strOrListOfInt))
{
throw INTERP_KERNEL::Exception("DataArrayAsciiChar::search : only strings in input supported !");
}
- PyObject *getTuple(int tupleId) const throw(INTERP_KERNEL::Exception)
+ PyObject *getTuple(int tupleId) const
{
int sz=self->getNumberOfComponents();
INTERP_KERNEL::AutoPtr<char> tmp=new char[sz+1]; tmp[sz]='\0';
return PyString_FromString(tmp);
}
- PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
+ PyObject *getMaxValue() const
{
int tmp;
char tmp2[2]; tmp2[1]='\0';
return ret;
}
- PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
+ PyObject *getMinValue() const
{
int tmp;
char tmp2[2]; tmp2[1]='\0';
return ret;
}
- int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
+ int index(PyObject *obj) const
{
int nbOfCompo=self->getNumberOfComponents();
switch(nbOfCompo)
}
}
- bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
+ bool __contains__(PyObject *obj) const
{
int nbOfCompo=self->getNumberOfComponents();
switch(nbOfCompo)
}
}
- PyObject *__getitem__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
+ PyObject *__getitem__(PyObject *obj) const
{
int sw,iTypppArr;
std::vector<int> stdvecTyyppArr;
}
}
- DataArrayAsciiChar *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
+ DataArrayAsciiChar *__setitem__(PyObject *obj, PyObject *value)
{
static const char msg[]="DataArrayAsciiChar::__setitem__ : supporting int, list of int, tuple of int, DataArrayInt and slice in input, and 4 types accepted in value : string, list or tuple of strings having same size, not null DataArrayChar instance.";
int sw1,iTypppArr;
class DataArrayAsciiCharTuple
{
public:
- int getNumberOfCompo() const throw(INTERP_KERNEL::Exception);
- DataArrayAsciiChar *buildDAAsciiChar(int nbOfTuples, int nbOfCompo) const throw(INTERP_KERNEL::Exception);
+ int getNumberOfCompo() const;
+ DataArrayAsciiChar *buildDAAsciiChar(int nbOfTuples, int nbOfCompo) const;
%extend
{
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->repr();
}
- DataArrayAsciiChar *buildDAAsciiChar() throw(INTERP_KERNEL::Exception)
+ DataArrayAsciiChar *buildDAAsciiChar()
{
return self->buildDAAsciiChar(1,self->getNumberOfCompo());
}
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
if sys.platform == "win32":
from MEDCouplingCompat import *
else:
- from MEDCoupling import *
+ from medcoupling import *
if MEDCouplingHasNumPyBindings():
from numpy import *
self.assertTrue(not b.flags["OWNDATA"])
pass
+ @unittest.skipUnless(MEDCouplingHasNumPyBindings(),"requires numpy")
+ def test41(self):
+ """ This non regression test is focused on a numpy subarray of a bigger numpy array. Typically a 1D array coming from a 2D array. When medcoupling takes the ownership, medcoupling must store an offset to deallocate correctly the pointer. The pointer of medcoupling array is NOT the pointer to be transmited to free. The offset is typically the distance between the start of the main 2D array and the start of 1D array medcouplingized."""
+ import numpy as np
+ array = np.array([[1,2,3,10],[4,5,6,20],[7,8,9,30]],dtype=np.float64) # create a 2D array
+ b = array[2] # b data pointer starts at array+2*4*sizeof(float64) so offset is expected to be equal to -2*4*sizeof(float64)=-64
+ self.assertTrue(array.flags["OWNDATA"])
+ self.assertTrue(not b.flags["OWNDATA"])
+ d=DataArrayDouble(b)
+ self.assertTrue(not array.flags["OWNDATA"])
+ self.assertTrue(not b.flags["OWNDATA"])
+ del b ; gc.collect()
+ del array ; gc.collect()
+ del d ; gc.collect() # important : destroy d after b and array to be sure to let the ownership to d.
+ pass
+
def setUp(self):
pass
pass
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
if sys.platform == "win32":
from MEDCouplingCompat import *
else:
- from MEDCoupling import *
+ from medcoupling import *
from MEDCouplingDataForTest import MEDCouplingDataForTest
if MEDCouplingHasNumPyBindings():
xx=pickle.loads(pickled)
self.assertTrue(xx.isEqual(x))
pass
-
+
@unittest.skipUnless(MEDCouplingHasNumPyBindings(),"requires numpy")
def test3(self):
""" Test of a MEDCouplingUMesh pickeling."""
self.assertTrue(m2.isEqual(m,1e-16))
self.assertTrue(m2.getCoordsAt(0).isEqual(arrX,1e-16))
pass
-
+
@unittest.skipUnless(MEDCouplingHasNumPyBindings(),"requires numpy")
def test6(self):
""" Test of a MEDCoupling1SGTUMesh pickeling."""
m2=pickle.loads(st)
self.assertTrue(m2.isEqual(m,1e-16))
pass
-
+
@unittest.skipUnless(MEDCouplingHasNumPyBindings(),"requires numpy")
def test7(self):
""" Test of a MEDCoupling1DGTUMesh pickeling."""
self.assertTrue(f2.isEqual(f,1e-16,0))
self.assertTrue(f2.getMesh().isEqual(f.getMesh(),1e-16))
pass
-
+
@unittest.skipUnless(MEDCouplingHasNumPyBindings(),"requires numpy")
def test17(self):
""" Test of MEDCouplingFieldInt lying on MEDCouplingCMesh pickeling. """
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
};
}
+/*
+ * ABN: Install default exception handler: this catches all INTERP_KERNEL::Exception (even when no
+ * except declaration was added to the function declaration) and propagates it to the Python level.
+ */
+%exception {
+ try {
+ $action
+ }
+ catch (INTERP_KERNEL::Exception& _e) {
+ // Reraise with SWIG_Python_Raise
+ SWIG_Python_Raise(SWIG_NewPointerObj((new INTERP_KERNEL::Exception(static_cast< const INTERP_KERNEL::Exception& >(_e))),SWIGTYPE_p_INTERP_KERNEL__Exception,SWIG_POINTER_OWN), "INTERP_KERNEL::Exception", SWIGTYPE_p_INTERP_KERNEL__Exception);
+ SWIG_fail;
+ }
+}
+
namespace MEDCoupling
{
class TimeLabel
namespace MEDCoupling
{
- typedef enum
+ enum class DeallocType
{
C_DEALLOC = 2,
CPP_DEALLOC = 3
- } DeallocType;
+ };
const char *MEDCouplingVersionStr();
int MEDCouplingVersion();
int MEDCouplingSizeOfVoidStar();
+ int MEDCouplingSizeOfIDs();
bool MEDCouplingByteOrder();
const char *MEDCouplingByteOrderStr();
bool IsCXX11Compiled();
class BigMemoryObject
{
public:
- std::size_t getHeapMemorySize() const throw(INTERP_KERNEL::Exception);
- std::string getHeapMemorySizeStr() const throw(INTERP_KERNEL::Exception);
- bool isObjectInTheProgeny(const BigMemoryObject *obj) const throw(INTERP_KERNEL::Exception);
- virtual std::size_t getHeapMemorySizeWithoutChildren() const throw(INTERP_KERNEL::Exception);
+ std::size_t getHeapMemorySize() const;
+ std::string getHeapMemorySizeStr() const;
+ bool isObjectInTheProgeny(const BigMemoryObject *obj) const;
+ virtual std::size_t getHeapMemorySizeWithoutChildren() const;
virtual ~BigMemoryObject();
%extend
{
- virtual PyObject *getDirectChildren() const throw(INTERP_KERNEL::Exception)
+ virtual PyObject *getDirectChildren() const
{
std::vector<const BigMemoryObject *> c(self->getDirectChildren());
PyObject *ret(PyList_New(c.size()));
return ret;
}
- PyObject *getAllTheProgeny() const throw(INTERP_KERNEL::Exception)
+ PyObject *getAllTheProgeny() const
{
std::vector<const BigMemoryObject *> c(self->getAllTheProgeny());
PyObject *ret(PyList_New(c.size()));
return ret;
}
- static std::size_t GetHeapMemorySizeOfObjs(PyObject *objs) throw(INTERP_KERNEL::Exception)
+ static std::size_t GetHeapMemorySizeOfObjs(PyObject *objs)
{
std::vector<const BigMemoryObject *> cppObjs;
convertFromPyObjVectorOfObj<const MEDCoupling::BigMemoryObject *>(objs,SWIGTYPE_p_MEDCoupling__BigMemoryObject,"BigMemoryObject",cppObjs);
class GlobalDict
{
public:
- static GlobalDict *GetInstance() throw(INTERP_KERNEL::Exception);
- bool hasKey(const std::string& key) const throw(INTERP_KERNEL::Exception);
- std::string value(const std::string& key) const throw(INTERP_KERNEL::Exception);
- std::vector<std::string> keys() const throw(INTERP_KERNEL::Exception);
- void erase(const std::string& key) throw(INTERP_KERNEL::Exception);
- void clear() throw(INTERP_KERNEL::Exception);
- void setKeyValue(const std::string& key, const std::string& value) throw(INTERP_KERNEL::Exception);
- void setKeyValueForce(const std::string& key, const std::string& value) throw(INTERP_KERNEL::Exception);
+ static GlobalDict *GetInstance();
+ bool hasKey(const std::string& key) const;
+ std::string value(const std::string& key) const;
+ std::vector<std::string> keys() const;
+ void erase(const std::string& key);
+ void clear();
+ void setKeyValue(const std::string& key, const std::string& value);
+ void setKeyValueForce(const std::string& key, const std::string& value);
private:
GlobalDict();
public:
#endif
}
- std::string MEDCouplingCompletionScript() throw(INTERP_KERNEL::Exception)
+ std::string MEDCouplingCompletionScript()
{
static const char script[]="import rlcompleter,readline\nreadline.parse_and_bind('tab:complete')";
std::ostringstream oss; oss << "MEDCouplingCompletionScript : error when trying to activate completion ! readline not present ?\nScript is :\n" << script;
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2017 CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
public:
MEDCouplingRemapper();
~MEDCouplingRemapper();
- int prepare(const MEDCouplingMesh *srcMesh, const MEDCouplingMesh *targetMesh, const std::string& method) throw(INTERP_KERNEL::Exception);
- int prepareEx(const MEDCouplingFieldTemplate *src, const MEDCouplingFieldTemplate *target) throw(INTERP_KERNEL::Exception);
- void transfer(const MEDCouplingFieldDouble *srcField, MEDCouplingFieldDouble *targetField, double dftValue) throw(INTERP_KERNEL::Exception);
- void partialTransfer(const MEDCouplingFieldDouble *srcField, MEDCouplingFieldDouble *targetField) throw(INTERP_KERNEL::Exception);
- void reverseTransfer(MEDCouplingFieldDouble *srcField, const MEDCouplingFieldDouble *targetField, double dftValue) throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *transferField(const MEDCouplingFieldDouble *srcField, double dftValue) throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *reverseTransferField(const MEDCouplingFieldDouble *targetField, double dftValue) throw(INTERP_KERNEL::Exception);
- bool setOptionInt(const std::string& key, int value) throw(INTERP_KERNEL::Exception);
- bool setOptionDouble(const std::string& key, double value) throw(INTERP_KERNEL::Exception);
- bool setOptionString(const std::string& key, const std::string& value) throw(INTERP_KERNEL::Exception);
- int getInterpolationMatrixPolicy() const throw(INTERP_KERNEL::Exception);
- void setInterpolationMatrixPolicy(int newInterpMatPol) throw(INTERP_KERNEL::Exception);
+ int prepare(const MEDCouplingMesh *srcMesh, const MEDCouplingMesh *targetMesh, const std::string& method);
+ int prepareEx(const MEDCouplingFieldTemplate *src, const MEDCouplingFieldTemplate *target);
+ void transfer(const MEDCouplingFieldDouble *srcField, MEDCouplingFieldDouble *targetField, double dftValue);
+ void partialTransfer(const MEDCouplingFieldDouble *srcField, MEDCouplingFieldDouble *targetField);
+ void reverseTransfer(MEDCouplingFieldDouble *srcField, const MEDCouplingFieldDouble *targetField, double dftValue);
+ MEDCouplingFieldDouble *transferField(const MEDCouplingFieldDouble *srcField, double dftValue);
+ MEDCouplingFieldDouble *reverseTransferField(const MEDCouplingFieldDouble *targetField, double dftValue);
+ bool setOptionInt(const std::string& key, int value);
+ bool setOptionDouble(const std::string& key, double value);
+ bool setOptionString(const std::string& key, const std::string& value);
+ int getInterpolationMatrixPolicy() const;
+ void setInterpolationMatrixPolicy(int newInterpMatPol);
//
- int nullifiedTinyCoeffInCrudeMatrixAbs(double maxValAbs) throw(INTERP_KERNEL::Exception);
- int nullifiedTinyCoeffInCrudeMatrix(double scaleFactor) throw(INTERP_KERNEL::Exception);
- double getMaxValueInCrudeMatrix() const throw(INTERP_KERNEL::Exception);
- int getNumberOfColsOfMatrix() const throw(INTERP_KERNEL::Exception);
- static std::string BuildMethodFrom(const std::string& meth1, const std::string& meth2) throw(INTERP_KERNEL::Exception);
+ int nullifiedTinyCoeffInCrudeMatrixAbs(double maxValAbs);
+ int nullifiedTinyCoeffInCrudeMatrix(double scaleFactor);
+ double getMaxValueInCrudeMatrix() const;
+ int getNumberOfColsOfMatrix() const;
+ static std::string BuildMethodFrom(const std::string& meth1, const std::string& meth2);
%extend
{
- PyObject *getCrudeMatrix() const throw(INTERP_KERNEL::Exception)
+ PyObject *getCrudeMatrix() const
{
const std::vector<std::map<int,double> >& m=self->getCrudeMatrix();
std::size_t sz=m.size();
return ret;
}
#if defined(WITH_NUMPY) && defined(WITH_SCIPY)
- PyObject *getCrudeCSRMatrix() const throw(INTERP_KERNEL::Exception)
+ PyObject *getCrudeCSRMatrix() const
{
return ToCSRMatrix(self->getCrudeMatrix(),self->getNumberOfColsOfMatrix());
}
#endif
- void setCrudeMatrix(const MEDCouplingMesh *srcMesh, const MEDCouplingMesh *targetMesh, const std::string& method, PyObject *m) throw(INTERP_KERNEL::Exception)
+ void setCrudeMatrix(const MEDCouplingMesh *srcMesh, const MEDCouplingMesh *targetMesh, const std::string& method, PyObject *m)
{
std::vector<std::map<int,double> > mCpp;
if(isCSRMatrix(m))
self->setCrudeMatrix(srcMesh,targetMesh,method,mCpp);
}
- void setCrudeMatrixEx(const MEDCouplingFieldTemplate *src, const MEDCouplingFieldTemplate *target, PyObject *m) throw(INTERP_KERNEL::Exception)
+ void setCrudeMatrixEx(const MEDCouplingFieldTemplate *src, const MEDCouplingFieldTemplate *target, PyObject *m)
{
std::vector<std::map<int,double> > mCpp;
convertToVectMapIntDouble(m,mCpp);
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
self.assertEqual(rem.getCrudeMatrix(),[{0: 1.0}, {1: 1.0}])
rem2=MEDCouplingRemapper()
rem2.setIntersectionType(PointLocator)
- rem2.prepare(mt,ms,"P0P0") # reverse mt<->ms
- self.assertEqual(rem2.getCrudeMatrix(),[{0: 1.0}, {1: 1.0}])
+ ##
+ # 2D to 3D with point locator does not make sense:
+ ##
+ self.assertRaises(InterpKernelException, rem2.prepare,mt,ms,"P0P0")
pass
def test2D1Dand1D2DPointLocator1(self):
rem.setIntersectionType(PointLocator)
self.assertEqual(rem.prepare(src,trg,"P1P1"),1)
mat=rem.getCrudeCSRMatrix()
- row=array([2,2, 3,3, 0,0, 1,1]) # here ref to target point 3
+ row=array([2,2, 3,3, 0,0, 1,1]) # here ref to target point 3
col=array([1,2, 1,2, 1,2, 1,2])
data=array([0.1,0.9, 0.3,0.7, 0.5,0.5, 0.8,0.2])
mExp2=csr_matrix((data,(row,col)),shape=(4,3))
ref=float(m.getMeasureField(True).getArray())
self.assertTrue(abs(res-ref)/ref<1e-12)
pass
-
+
def checkMatrix(self,mat1,mat2,nbCols,eps):
self.assertEqual(len(mat1),len(mat2))
for i in range(len(mat1)):
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
class MEDCouplingTimeDiscretization : public TimeLabel, public BigMemoryObject
{
public:
- static MEDCouplingTimeDiscretization *New(TypeOfTimeDiscretization type) throw(INTERP_KERNEL::Exception);
+ static MEDCouplingTimeDiscretization *New(TypeOfTimeDiscretization type);
void setTimeUnit(const char *unit);
const char *getTimeUnit() const;
- virtual void copyTinyAttrFrom(const MEDCouplingTimeDiscretization& other) throw(INTERP_KERNEL::Exception);
- virtual void copyTinyStringsFrom(const MEDCouplingTimeDiscretization& other) throw(INTERP_KERNEL::Exception);
- virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
- virtual bool areCompatible(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception);
- virtual bool areStrictlyCompatible(const MEDCouplingTimeDiscretization *other, std::string& reason) const throw(INTERP_KERNEL::Exception);
- virtual bool areStrictlyCompatibleForMul(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception);
- virtual bool areStrictlyCompatibleForDiv(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception);
- virtual bool areCompatibleForMeld(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception);
- virtual bool isEqualIfNotWhy(const MEDCouplingTimeDiscretization *other, double prec, std::string& reason) const throw(INTERP_KERNEL::Exception);
- virtual bool isEqual(const MEDCouplingTimeDiscretization *other, double prec) const throw(INTERP_KERNEL::Exception);
- virtual bool isEqualWithoutConsideringStr(const MEDCouplingTimeDiscretization *other, double prec) const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingTimeDiscretization *buildNewTimeReprFromThis(TypeOfTimeDiscretization type, bool deepCopy) const throw(INTERP_KERNEL::Exception);
- virtual std::string getStringRepr() const throw(INTERP_KERNEL::Exception);
- virtual TypeOfTimeDiscretization getEnum() const throw(INTERP_KERNEL::Exception);
- virtual void synchronizeTimeWith(const MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingTimeDiscretization *aggregate(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingTimeDiscretization *aggregate(const std::vector<const MEDCouplingTimeDiscretization *>& other) const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingTimeDiscretization *meld(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingTimeDiscretization *dot(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingTimeDiscretization *crossProduct(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingTimeDiscretization *max(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingTimeDiscretization *min(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingTimeDiscretization *add(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception);
- virtual void addEqual(const MEDCouplingTimeDiscretization *other) throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingTimeDiscretization *substract(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception);
- virtual void substractEqual(const MEDCouplingTimeDiscretization *other) throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingTimeDiscretization *multiply(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception);
- virtual void multiplyEqual(const MEDCouplingTimeDiscretization *other) throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingTimeDiscretization *divide(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception);
- virtual void divideEqual(const MEDCouplingTimeDiscretization *other) throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingTimeDiscretization *pow(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception);
- virtual void powEqual(const MEDCouplingTimeDiscretization *other) throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingTimeDiscretization *performCopyOrIncrRef(bool deepCopy) const throw(INTERP_KERNEL::Exception);
+ virtual void copyTinyAttrFrom(const MEDCouplingTimeDiscretization& other);
+ virtual void copyTinyStringsFrom(const MEDCouplingTimeDiscretization& other);
+ virtual void checkConsistencyLight() const;
+ virtual bool areCompatible(const MEDCouplingTimeDiscretization *other) const;
+ virtual bool areStrictlyCompatible(const MEDCouplingTimeDiscretization *other, std::string& reason) const;
+ virtual bool areStrictlyCompatibleForMul(const MEDCouplingTimeDiscretization *other) const;
+ virtual bool areStrictlyCompatibleForDiv(const MEDCouplingTimeDiscretization *other) const;
+ virtual bool areCompatibleForMeld(const MEDCouplingTimeDiscretization *other) const;
+ virtual bool isEqualIfNotWhy(const MEDCouplingTimeDiscretization *other, double prec, std::string& reason) const;
+ virtual bool isEqual(const MEDCouplingTimeDiscretization *other, double prec) const;
+ virtual bool isEqualWithoutConsideringStr(const MEDCouplingTimeDiscretization *other, double prec) const;
+ virtual MEDCouplingTimeDiscretization *buildNewTimeReprFromThis(TypeOfTimeDiscretization type, bool deepCopy) const;
+ virtual std::string getStringRepr() const;
+ virtual TypeOfTimeDiscretization getEnum() const;
+ virtual void synchronizeTimeWith(const MEDCouplingMesh *mesh);
+ virtual MEDCouplingTimeDiscretization *aggregate(const MEDCouplingTimeDiscretization *other) const;
+ virtual MEDCouplingTimeDiscretization *aggregate(const std::vector<const MEDCouplingTimeDiscretization *>& other) const;
+ virtual MEDCouplingTimeDiscretization *meld(const MEDCouplingTimeDiscretization *other) const;
+ virtual MEDCouplingTimeDiscretization *dot(const MEDCouplingTimeDiscretization *other) const;
+ virtual MEDCouplingTimeDiscretization *crossProduct(const MEDCouplingTimeDiscretization *other) const;
+ virtual MEDCouplingTimeDiscretization *max(const MEDCouplingTimeDiscretization *other) const;
+ virtual MEDCouplingTimeDiscretization *min(const MEDCouplingTimeDiscretization *other) const;
+ virtual MEDCouplingTimeDiscretization *add(const MEDCouplingTimeDiscretization *other) const;
+ virtual void addEqual(const MEDCouplingTimeDiscretization *other);
+ virtual MEDCouplingTimeDiscretization *substract(const MEDCouplingTimeDiscretization *other) const;
+ virtual void substractEqual(const MEDCouplingTimeDiscretization *other);
+ virtual MEDCouplingTimeDiscretization *multiply(const MEDCouplingTimeDiscretization *other) const;
+ virtual void multiplyEqual(const MEDCouplingTimeDiscretization *other);
+ virtual MEDCouplingTimeDiscretization *divide(const MEDCouplingTimeDiscretization *other) const;
+ virtual void divideEqual(const MEDCouplingTimeDiscretization *other);
+ virtual MEDCouplingTimeDiscretization *pow(const MEDCouplingTimeDiscretization *other) const;
+ virtual void powEqual(const MEDCouplingTimeDiscretization *other);
+ virtual MEDCouplingTimeDiscretization *performCopyOrIncrRef(bool deepCopy) const;
void setTimeTolerance(double val);
double getTimeTolerance() const;
- virtual void checkNoTimePresence() const throw(INTERP_KERNEL::Exception);
- virtual void checkTimePresence(double time) const throw(INTERP_KERNEL::Exception);
- virtual void setArray(DataArrayDouble *array, TimeLabel *owner) throw(INTERP_KERNEL::Exception);
- virtual void setEndArray(DataArrayDouble *array, TimeLabel *owner) throw(INTERP_KERNEL::Exception);
- virtual void setArrays(const std::vector<DataArrayDouble *>& arrays, TimeLabel *owner) throw(INTERP_KERNEL::Exception);
- DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception);
- const DataArrayDouble *getArray() const throw(INTERP_KERNEL::Exception);
- virtual const DataArrayDouble *getEndArray() const throw(INTERP_KERNEL::Exception);
- virtual DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception);
- virtual std::vector< const DataArrayDouble *> getArraysForTime(double time) const throw(INTERP_KERNEL::Exception);
- virtual void getValueForTime(double time, const std::vector<double>& vals, double *res) const throw(INTERP_KERNEL::Exception);
- virtual void getArrays(std::vector<DataArrayDouble *>& arrays) const throw(INTERP_KERNEL::Exception);
- virtual bool isBefore(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception);
- virtual bool isStrictlyBefore(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception);
- double getTime(int& iteration, int& order) const throw(INTERP_KERNEL::Exception);
- virtual double getStartTime(int& iteration, int& order) const throw(INTERP_KERNEL::Exception);
- virtual double getEndTime(int& iteration, int& order) const throw(INTERP_KERNEL::Exception);
- void setTime(double time, int iteration, int order) throw(INTERP_KERNEL::Exception);
- void setIteration(int it) throw(INTERP_KERNEL::Exception);
- void setOrder(int order) throw(INTERP_KERNEL::Exception);
- void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
- virtual void setStartIteration(int it) throw(INTERP_KERNEL::Exception);
- virtual void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
- virtual void setStartOrder(int order) throw(INTERP_KERNEL::Exception);
- virtual void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
- virtual void setStartTimeValue(double time) throw(INTERP_KERNEL::Exception);
- virtual void setEndTimeValue(double time) throw(INTERP_KERNEL::Exception);
- virtual void setStartTime(double time, int iteration, int order) throw(INTERP_KERNEL::Exception);
- virtual void setEndTime(double time, int iteration, int order) throw(INTERP_KERNEL::Exception);
- virtual void getValueOnTime(int eltId, double time, double *value) const throw(INTERP_KERNEL::Exception);
- virtual void getValueOnDiscTime(int eltId, int iteration, int order, double *value) const throw(INTERP_KERNEL::Exception);
+ virtual void checkNoTimePresence() const;
+ virtual void checkTimePresence(double time) const;
+ virtual void setArray(DataArrayDouble *array, TimeLabel *owner);
+ virtual void setEndArray(DataArrayDouble *array, TimeLabel *owner);
+ virtual void setArrays(const std::vector<DataArrayDouble *>& arrays, TimeLabel *owner);
+ DataArrayDouble *getArray();
+ const DataArrayDouble *getArray() const;
+ virtual const DataArrayDouble *getEndArray() const;
+ virtual DataArrayDouble *getEndArray();
+ virtual std::vector< const DataArrayDouble *> getArraysForTime(double time) const;
+ virtual void getValueForTime(double time, const std::vector<double>& vals, double *res) const;
+ virtual void getArrays(std::vector<DataArrayDouble *>& arrays) const;
+ virtual bool isBefore(const MEDCouplingTimeDiscretization *other) const;
+ virtual bool isStrictlyBefore(const MEDCouplingTimeDiscretization *other) const;
+ double getTime(int& iteration, int& order) const;
+ virtual double getStartTime(int& iteration, int& order) const;
+ virtual double getEndTime(int& iteration, int& order) const;
+ void setTime(double time, int iteration, int order);
+ void setIteration(int it);
+ void setOrder(int order);
+ void setTimeValue(double val);
+ virtual void setStartIteration(int it);
+ virtual void setEndIteration(int it);
+ virtual void setStartOrder(int order);
+ virtual void setEndOrder(int order);
+ virtual void setStartTimeValue(double time);
+ virtual void setEndTimeValue(double time);
+ virtual void setStartTime(double time, int iteration, int order);
+ virtual void setEndTime(double time, int iteration, int order);
+ virtual void getValueOnTime(int eltId, double time, double *value) const;
+ virtual void getValueOnDiscTime(int eltId, int iteration, int order, double *value) const;
//
- virtual MEDCouplingTimeDiscretization *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingTimeDiscretization *determinant() const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingTimeDiscretization *eigenValues() const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingTimeDiscretization *eigenVectors() const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingTimeDiscretization *inverse() const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingTimeDiscretization *trace() const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingTimeDiscretization *deviator() const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingTimeDiscretization *magnitude() const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingTimeDiscretization *negate() const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingTimeDiscretization *maxPerTuple() const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingTimeDiscretization *keepSelectedComponents(const std::vector<int>& compoIds) const throw(INTERP_KERNEL::Exception);
- virtual void setSelectedComponents(const MEDCouplingTimeDiscretization *other, const std::vector<int>& compoIds) throw(INTERP_KERNEL::Exception);
- virtual void changeNbOfComponents(int newNbOfComp, double dftValue) throw(INTERP_KERNEL::Exception);
- virtual void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
- virtual void setUniformValue(int nbOfTuple, int nbOfCompo, double value) throw(INTERP_KERNEL::Exception);
- virtual void setOrCreateUniformValueOnAllComponents(int nbOfTuple, double value) throw(INTERP_KERNEL::Exception);
- virtual void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
- virtual void applyFunc(int nbOfComp, FunctionToEvaluate func) throw(INTERP_KERNEL::Exception);
- virtual void applyFunc(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
- virtual void applyFuncCompo(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
- virtual void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
- virtual void applyFunc(const char *func) throw(INTERP_KERNEL::Exception);
- virtual void applyFuncFast32(const char *func) throw(INTERP_KERNEL::Exception);
- virtual void applyFuncFast64(const char *func) throw(INTERP_KERNEL::Exception);
- virtual void fillFromAnalytic(const DataArrayDouble *loc, int nbOfComp, FunctionToEvaluate func) throw(INTERP_KERNEL::Exception);
- virtual void fillFromAnalytic(const DataArrayDouble *loc, int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
- virtual void fillFromAnalyticCompo(const DataArrayDouble *loc, int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
- virtual void fillFromAnalyticNamedCompo(const DataArrayDouble *loc, int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
+ virtual MEDCouplingTimeDiscretization *doublyContractedProduct() const;
+ virtual MEDCouplingTimeDiscretization *determinant() const;
+ virtual MEDCouplingTimeDiscretization *eigenValues() const;
+ virtual MEDCouplingTimeDiscretization *eigenVectors() const;
+ virtual MEDCouplingTimeDiscretization *inverse() const;
+ virtual MEDCouplingTimeDiscretization *trace() const;
+ virtual MEDCouplingTimeDiscretization *deviator() const;
+ virtual MEDCouplingTimeDiscretization *magnitude() const;
+ virtual MEDCouplingTimeDiscretization *negate() const;
+ virtual MEDCouplingTimeDiscretization *maxPerTuple() const;
+ virtual MEDCouplingTimeDiscretization *keepSelectedComponents(const std::vector<int>& compoIds) const;
+ virtual void setSelectedComponents(const MEDCouplingTimeDiscretization *other, const std::vector<int>& compoIds);
+ virtual void changeNbOfComponents(int newNbOfComp, double dftValue);
+ virtual void sortPerTuple(bool asc);
+ virtual void setUniformValue(int nbOfTuple, int nbOfCompo, double value);
+ virtual void setOrCreateUniformValueOnAllComponents(int nbOfTuple, double value);
+ virtual void applyLin(double a, double b, int compoId);
+ virtual void applyFunc(int nbOfComp, FunctionToEvaluate func);
+ virtual void applyFunc(int nbOfComp, const char *func);
+ virtual void applyFuncCompo(int nbOfComp, const char *func);
+ virtual void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func);
+ virtual void applyFunc(const char *func);
+ virtual void applyFuncFast32(const char *func);
+ virtual void applyFuncFast64(const char *func);
+ virtual void fillFromAnalytic(const DataArrayDouble *loc, int nbOfComp, FunctionToEvaluate func);
+ virtual void fillFromAnalytic(const DataArrayDouble *loc, int nbOfComp, const char *func);
+ virtual void fillFromAnalyticCompo(const DataArrayDouble *loc, int nbOfComp, const char *func);
+ virtual void fillFromAnalyticNamedCompo(const DataArrayDouble *loc, int nbOfComp, const std::vector<std::string>& varsOrder, const char *func);
//
virtual ~MEDCouplingTimeDiscretization();
};
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
throw INTERP_KERNEL::Exception("convertDataForGodFather wrap : unrecognized data type for AMR !");
}
-static PyObject *convertCartesianAMRPatch(MEDCoupling::MEDCouplingCartesianAMRPatchGen *patch, int owner) throw(INTERP_KERNEL::Exception)
+static PyObject *convertCartesianAMRPatch(MEDCoupling::MEDCouplingCartesianAMRPatchGen *patch, int owner)
{
if(!patch)
{
throw INTERP_KERNEL::Exception("convertCartesianAMRPatch wrap : unrecognized type of cartesian AMR patch !");
}
-static MEDCoupling::MEDCouplingFieldDouble *MEDCoupling_MEDCouplingFieldDouble___add__Impl(MEDCoupling::MEDCouplingFieldDouble *self, PyObject *obj) throw(INTERP_KERNEL::Exception)
+static MEDCoupling::MEDCouplingFieldDouble *MEDCoupling_MEDCouplingFieldDouble___add__Impl(MEDCoupling::MEDCouplingFieldDouble *self, PyObject *obj)
{
const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__add__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
const char msg2[]="in MEDCouplingFieldDouble.__add__ : self field has no Array of values set !";
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> aaa=MEDCoupling::DataArrayDouble::New(); aaa->useArray(&bb[0],false,MEDCoupling::CPP_DEALLOC,1,(int)bb.size());
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> aaa=MEDCoupling::DataArrayDouble::New(); aaa->useArray(&bb[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,(int)bb.size());
MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> ret=MEDCoupling::DataArrayDouble::Add(self->getArray(),aaa);
MEDCoupling::MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(ret);
}
}
-static MEDCoupling::MEDCouplingFieldDouble *MEDCoupling_MEDCouplingFieldDouble___radd__Impl(MEDCoupling::MEDCouplingFieldDouble *self, PyObject *obj) throw(INTERP_KERNEL::Exception)
+static MEDCoupling::MEDCouplingFieldDouble *MEDCoupling_MEDCouplingFieldDouble___radd__Impl(MEDCoupling::MEDCouplingFieldDouble *self, PyObject *obj)
{
return MEDCoupling_MEDCouplingFieldDouble___add__Impl(self,obj);
}
-static MEDCoupling::MEDCouplingFieldDouble *MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(MEDCoupling::MEDCouplingFieldDouble *self, PyObject *obj) throw(INTERP_KERNEL::Exception)
+static MEDCoupling::MEDCouplingFieldDouble *MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(MEDCoupling::MEDCouplingFieldDouble *self, PyObject *obj)
{
const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__rsub__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
const char msg2[]="in MEDCouplingFieldDouble.__rsub__ : self field has no Array of values set !";
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> aaa=MEDCoupling::DataArrayDouble::New(); aaa->useArray(&bb[0],false,MEDCoupling::CPP_DEALLOC,1,(int)bb.size());
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> aaa=MEDCoupling::DataArrayDouble::New(); aaa->useArray(&bb[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,(int)bb.size());
MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> ret=MEDCoupling::DataArrayDouble::Substract(aaa,self->getArray());
MEDCoupling::MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(ret);
}
}
-static MEDCoupling::MEDCouplingFieldDouble *MEDCoupling_MEDCouplingFieldDouble___mul__Impl(MEDCoupling::MEDCouplingFieldDouble *self, PyObject *obj) throw(INTERP_KERNEL::Exception)
+static MEDCoupling::MEDCouplingFieldDouble *MEDCoupling_MEDCouplingFieldDouble___mul__Impl(MEDCoupling::MEDCouplingFieldDouble *self, PyObject *obj)
{
const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__mul__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
const char msg2[]="in MEDCouplingFieldDouble.__mul__ : self field has no Array of values set !";
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> aaa=MEDCoupling::DataArrayDouble::New(); aaa->useArray(&bb[0],false,MEDCoupling::CPP_DEALLOC,1,(int)bb.size());
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> aaa=MEDCoupling::DataArrayDouble::New(); aaa->useArray(&bb[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,(int)bb.size());
MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> ret=MEDCoupling::DataArrayDouble::Multiply(self->getArray(),aaa);
MEDCoupling::MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(ret);
}
}
-MEDCoupling::MEDCouplingFieldDouble *MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(MEDCoupling::MEDCouplingFieldDouble *self, PyObject *obj) throw(INTERP_KERNEL::Exception)
+MEDCoupling::MEDCouplingFieldDouble *MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(MEDCoupling::MEDCouplingFieldDouble *self, PyObject *obj)
{
return MEDCoupling_MEDCouplingFieldDouble___mul__Impl(self,obj);
}
-MEDCoupling::MEDCouplingFieldDouble *MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(MEDCoupling::MEDCouplingFieldDouble *self, PyObject *obj) throw(INTERP_KERNEL::Exception)
+MEDCoupling::MEDCouplingFieldDouble *MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(MEDCoupling::MEDCouplingFieldDouble *self, PyObject *obj)
{
const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__rdiv__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> aaa=MEDCoupling::DataArrayDouble::New(); aaa->useArray(&bb[0],false,MEDCoupling::CPP_DEALLOC,1,(int)bb.size());
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> aaa=MEDCoupling::DataArrayDouble::New(); aaa->useArray(&bb[0],false,MEDCoupling::DeallocType::CPP_DEALLOC,1,(int)bb.size());
MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> ret=MEDCoupling::DataArrayDouble::Divide(aaa,self->getArray());
MEDCoupling::MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(ret);
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
if sys.platform == "win32":
from MEDCouplingCompat import *
else:
- from MEDCoupling import *
+ from medcoupling import *
from math import pi, sqrt
# ! [PySnippetUMeshStdBuild1_1]
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
if sys.platform == "win32":
from MEDCouplingCompat import *
else:
- from MEDCoupling import *
+ from medcoupling import *
from math import pi, sqrt
-# Copyright (C) 2017 CEA/DEN, EDF R&D
+# Copyright (C) 2017-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-# Copyright (C) 2012-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2017 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2017 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2017 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2017 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2017 CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2017 CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2017 CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2017 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2017 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2017 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2017 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2017 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
}
//
MEDCoupling::MCAuto<MEDCoupling::DataArrayByte> ret(MEDCoupling::DataArrayByte::New());
- ret->useArray(reinterpret_cast<char *>(memfile.app_image_ptr),true,C_DEALLOC,memfile.app_image_size,1);
+ ret->useArray(reinterpret_cast<char *>(memfile.app_image_ptr),true,DeallocType::C_DEALLOC,memfile.app_image_size,1);
return ret;
}
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2016 CEA/DEN, EDF R&D
+// Copyright (C) 2016-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
MCAuto<MEDCouplingUMesh> mread(mmuPtr->getMeshAtLevel(m->getMeshDimension()-mm->getMeshDimension()));
if(f2->getTypeOfField()!=ON_NODES)
{
- m->tryToShareSameCoordsPermute(*mread,_EPS_FOR_NODE_COMP);
+ if(!m->getCoords()->isEqualWithoutConsideringStr(*mread->getCoords(),_EPS_FOR_NODE_COMP))
+ m->tryToShareSameCoordsPermute(*mread,_EPS_FOR_NODE_COMP);
+ else
+ mread->setCoords(m->getCoords());
DataArrayInt *part(NULL);
bool b(mread->areCellsIncludedIn(m,_COMP_FOR_CELL,part));
MCAuto<DataArrayInt> partSafe(part);
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2016 CEA/DEN, EDF R&D
+// Copyright (C) 2016-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2016 CEA/DEN, EDF R&D
+// Copyright (C) 2016-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2016 CEA/DEN, EDF R&D
+// Copyright (C) 2016-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
readRecord4();
else if (recordNumber == 7 )
readRecord7();
+ else if (recordNumber == 8 )
+ readRecord8();
else if (recordNumber == 5 )
break; // stop reading
else
}
}
+//================================================================================
+/*!
+ * \brief Reads "ENREGISTREMENT DE TYPE 8"
+ */
+//================================================================================
+
+void SauvReader::readRecord8()
+{
+ // This record is useless (a constant table)
+ // => we skip it
+ int info;
+ int nbIntToSkip;
+ if ( !isASCII() )
+ {
+ getInt();
+ info = getInt();
+ int i = 0;
+ if (info == 3) {
+ // castem >= 18
+ // 1 more line
+ nbIntToSkip = 145;
+ }
+ else
+ nbIntToSkip = 141;
+
+ while (i <= nbIntToSkip) {
+ getInt();
+ i ++;
+ }
+ }
+}
+
//================================================================================
/*!
* \brief Reads the pile number, nb of objects and nb named of objects
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
void readRecord2();
void readRecord4();
void readRecord7();
+ void readRecord8();
int readPileNumber(int& nbNamedObjects, int& nbObjects);
void read_PILE_SOUS_MAILLAGE(const int nbObjects, std::vector<std::string>& objectNames, std::vector<int>& nameIndices);
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-# Copyright (C) 2012-2017 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-# Copyright (C) 2015-2017 CEA/DEN, EDF R&D
+# Copyright (C) 2015-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2017 CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
namespace MEDCoupling
{
bool HasXDR();
- std::string MEDFileVersionStr() throw(INTERP_KERNEL::Exception);
- std::string MEDFileVersionOfFileStr(const std::string& fileName) throw(INTERP_KERNEL::Exception);
- void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
- void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
- void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
- void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
- std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
- std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
- std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
- std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
- std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
- std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
- std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
- std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
- std::vector<std::string> GetFieldNamesOnMesh(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
- std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
- std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
- double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
- void AssignStaticWritePropertiesTo(MEDCoupling::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
- MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
- MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
- MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
- MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
- int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
- MEDCoupling::MEDCouplingField *ReadFieldCell(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
- MEDCoupling::MEDCouplingField *ReadFieldNode(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
- MEDCoupling::MEDCouplingField *ReadFieldGauss(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
- MEDCoupling::MEDCouplingField *ReadFieldGaussNE(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
- void WriteMesh(const std::string& fileName, const MEDCoupling::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
- void WriteUMesh(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
- void WriteUMeshDep(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
- void WriteField(const std::string& fileName, const MEDCoupling::MEDCouplingField *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
- void WriteFieldDep(const std::string& fileName, const MEDCoupling::MEDCouplingField *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
- void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const MEDCoupling::MEDCouplingField *f) throw(INTERP_KERNEL::Exception);
+ std::string MEDFileVersionStr();
+ std::string MEDFileVersionOfFileStr(const std::string& fileName);
+ void SetEpsilonForNodeComp(double val);
+ void SetCompPolicyForCell(int val);
+ void SetTooLongStrPolicy(int val);
+ void CheckFileForRead(const std::string& fileName);
+ std::vector<std::string> GetMeshNames(const std::string& fileName);
+ std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName);
+ std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName);
+ std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName);
+ std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName);
+ std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName);
+ std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName);
+ std::vector<std::string> GetAllFieldNames(const std::string& fileName);
+ std::vector<std::string> GetFieldNamesOnMesh(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName);
+ std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName);
+ std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName);
+ double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order);
+ void AssignStaticWritePropertiesTo(MEDCoupling::MEDFileWritable& obj);
+ MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0);
+ MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0);
+ MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0);
+ MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0);
+ int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName);
+ MEDCoupling::MEDCouplingField *ReadFieldCell(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
+ MEDCoupling::MEDCouplingField *ReadFieldNode(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
+ MEDCoupling::MEDCouplingField *ReadFieldGauss(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
+ MEDCoupling::MEDCouplingField *ReadFieldGaussNE(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
+ void WriteMesh(const std::string& fileName, const MEDCoupling::MEDCouplingMesh *mesh, bool writeFromScratch);
+ void WriteUMesh(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch);
+ void WriteUMeshDep(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch);
+ void WriteField(const std::string& fileName, const MEDCoupling::MEDCouplingField *f, bool writeFromScratch);
+ void WriteFieldDep(const std::string& fileName, const MEDCoupling::MEDCouplingField *f, bool writeFromScratch);
+ void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const MEDCoupling::MEDCouplingField *f);
}
%rename (MEDFileVersion) MEDFileVersionSwig;
%inline
{
- PyObject *MEDFileVersionSwig() throw(INTERP_KERNEL::Exception)
+ PyObject *MEDFileVersionSwig()
{
int major,minor,release;
MEDCoupling::MEDFileVersion(major,minor,release);
return ret;
}
- MEDCoupling::MEDCouplingField *ReadFieldSwig(const std::string& fileName) throw(INTERP_KERNEL::Exception)
+ MEDCoupling::MEDCouplingField *ReadFieldSwig(const std::string& fileName)
{
MCAuto<MEDCoupling::MEDCouplingField> ret(MEDCoupling::ReadField(fileName));
return ret.retn();
}
- MEDCoupling::MEDCouplingField *ReadFieldSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
+ MEDCoupling::MEDCouplingField *ReadFieldSwig(const std::string& fileName, const std::string& fieldName)
{
MCAuto<MEDCoupling::MEDCouplingField> ret(MEDCoupling::ReadField(fileName,fieldName));
return ret.retn();
}
- MEDCoupling::MEDCouplingField *ReadFieldSwig(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception)
+ MEDCoupling::MEDCouplingField *ReadFieldSwig(const std::string& fileName, const std::string& fieldName, int iteration, int order)
{
MCAuto<MEDCoupling::MEDCouplingField> ret(MEDCoupling::ReadField(fileName,fieldName,iteration,order));
return ret.retn();
}
- MEDCoupling::MEDCouplingField *ReadFieldSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception)
+ MEDCoupling::MEDCouplingField *ReadFieldSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order)
{
MCAuto<MEDCoupling::MEDCouplingField> ret(MEDCoupling::ReadField(type,fileName,meshName,meshDimRelToMax,fieldName,iteration,order));
return ret.retn();
}
- PyObject *GetFieldIterationsSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
+ PyObject *GetFieldIterationsSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName)
{
std::vector< std::pair<int,int> > res=MEDCoupling::GetFieldIterations(type,fileName,meshName,fieldName);
PyObject *ret=PyList_New(res.size());
return ret;
}
- PyObject *GetAllFieldIterationsSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
+ PyObject *GetAllFieldIterationsSwig(const std::string& fileName, const std::string& fieldName)
{
std::vector< std::pair< std::pair<int,int>, double> > res=MEDCoupling::GetAllFieldIterations(fileName,fieldName);
PyObject *ret=PyList_New(res.size());
return ret;
}
- PyObject *GetCellFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
+ PyObject *GetCellFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName)
{
std::vector< std::pair<int,int> > res=MEDCoupling::GetCellFieldIterations(fileName,meshName,fieldName);
PyObject *ret=PyList_New(res.size());
return ret;
}
- PyObject *GetNodeFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
+ PyObject *GetNodeFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName)
{
std::vector< std::pair<int,int> > res=MEDCoupling::GetNodeFieldIterations(fileName,meshName,fieldName);
PyObject *ret=PyList_New(res.size());
return ret;
}
- PyObject *GetComponentsNamesOfFieldSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
+ PyObject *GetComponentsNamesOfFieldSwig(const std::string& fileName, const std::string& fieldName)
{
std::vector< std::pair<std::string,std::string> > res=MEDCoupling::GetComponentsNamesOfField(fileName,fieldName);
PyObject *ret=PyList_New(res.size());
return ret;
}
- PyObject *GetUMeshGlobalInfoSwig(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
+ PyObject *GetUMeshGlobalInfoSwig(const std::string& fileName, const std::string& meshName)
{
int meshDim,spaceDim,numberOfNodes;
std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDCoupling::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
}
PyObject *ReadFieldsOnSameMeshSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
- const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
+ const std::string& fieldName, PyObject *liIts)
{
std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
std::vector<MEDCoupling::MEDCouplingFieldDouble *> res=MEDCoupling::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
return convertFieldDoubleVecToPy(res);
}
- void WriteUMeshesPartitionSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
+ void WriteUMeshesPartitionSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch)
{
std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
MEDCoupling::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
}
- void WriteUMeshesPartitionDepSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
+ void WriteUMeshesPartitionDepSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch)
{
std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
MEDCoupling::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
}
- void WriteUMeshesSwig(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
+ void WriteUMeshesSwig(const std::string& fileName, PyObject *li, bool writeFromScratch)
{
std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
MEDCoupling::WriteUMeshes(fileName,v,writeFromScratch);
}
- PyObject *GetTypesOfFieldSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
+ PyObject *GetTypesOfFieldSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName)
{
std::vector< MEDCoupling::TypeOfField > v=MEDCoupling::GetTypesOfField(fileName,meshName,fieldName);
int size=v.size();
return ret;
}
- MEDCoupling::MEDCouplingUMesh *ReadUMeshFromGroupsSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
+ MEDCoupling::MEDCouplingUMesh *ReadUMeshFromGroupsSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li)
{
std::vector<std::string> grps;
converPyListToVecString(li,grps);
return MEDCoupling::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
}
- MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFamiliesSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
+ MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFamiliesSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li)
{
std::vector<std::string> fams;
converPyListToVecString(li,fams);
{
public:
void copyOptionsFrom(const MEDFileWritable& other) const;
- int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
- void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
- int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
- void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
+ int getTooLongStrPolicy() const;
+ void setTooLongStrPolicy(int newVal);
+ int getZipConnPolicy();
+ void setZipConnPolicy(int newVal);
};
class MEDFileWritableStandAlone : public MEDFileWritable
{
public:
- void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
- void write33(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
+ void write(const std::string& fileName, int mode) const;
+ void write33(const std::string& fileName, int mode) const;
%extend
{
- DataArrayByte *serialize() const throw(INTERP_KERNEL::Exception)
+ DataArrayByte *serialize() const
{
MCAuto<DataArrayByte> ret(self->serialize());
return ret.retn();
}
- PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
+ PyObject *__getstate__()
{
PyObject *ret(PyList_New(0));
return ret;
}
- void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
+ void __setstate__(PyObject *inp)
{
}
}
void setGlobalNodeNumFieldReading(bool b);
%extend
{
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
std::ostringstream oss;
self->reprAll(oss);
return oss.str();
}
- std::string __repr__() const throw(INTERP_KERNEL::Exception)
+ std::string __repr__() const
{
std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
return oss.str();
class MEDFileJointCorrespondence : public RefCountObject, public MEDFileWritable
{
public:
- static MEDFileJointCorrespondence *New() throw(INTERP_KERNEL::Exception);
+ static MEDFileJointCorrespondence *New();
static MEDFileJointCorrespondence *New(DataArrayInt* correspondence) // nodes
- throw(INTERP_KERNEL::Exception);
+ ;
static MEDFileJointCorrespondence *New(DataArrayInt* correspondence, // cells
INTERP_KERNEL::NormalizedCellType loc_geo_type,
INTERP_KERNEL::NormalizedCellType rem_geo_type)
- throw(INTERP_KERNEL::Exception);
+ ;
std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
MEDFileJointCorrespondence *deepCopy() const;
MEDFileJointCorrespondence *shallowCpy() const;
INTERP_KERNEL::NormalizedCellType getLocalGeometryType() const;
void setRemoteGeometryType(INTERP_KERNEL::NormalizedCellType type);
INTERP_KERNEL::NormalizedCellType getRemoteGeometryType() const;
- void setCorrespondence(DataArrayInt *corr) throw(INTERP_KERNEL::Exception);
- void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName, int order, int iteration) const throw(INTERP_KERNEL::Exception);
- std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
+ void setCorrespondence(DataArrayInt *corr);
+ void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName, int order, int iteration) const;
+ std::string simpleRepr() const;
%extend
{
MEDFileJointCorrespondence()
{
return MEDFileJointCorrespondence::New();
}
- MEDFileJointCorrespondence(DataArrayInt* correspondence) throw(INTERP_KERNEL::Exception)
+ MEDFileJointCorrespondence(DataArrayInt* correspondence)
{
return MEDFileJointCorrespondence::New(correspondence);
}
MEDFileJointCorrespondence(DataArrayInt* correspondence, // cells
INTERP_KERNEL::NormalizedCellType loc_geo_type,
- INTERP_KERNEL::NormalizedCellType rem_geo_type) throw(INTERP_KERNEL::Exception)
+ INTERP_KERNEL::NormalizedCellType rem_geo_type)
{
return MEDFileJointCorrespondence::New(correspondence, loc_geo_type, rem_geo_type);
}
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->simpleRepr();
}
- DataArrayInt *getCorrespondence() const throw(INTERP_KERNEL::Exception)
+ DataArrayInt *getCorrespondence() const
{
const DataArrayInt *ret(self->getCorrespondence());
if(ret)
class MEDFileJointOneStep : public RefCountObject, public MEDFileWritable
{
public:
- static MEDFileJointOneStep *New(int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
- static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1) throw(INTERP_KERNEL::Exception);
+ static MEDFileJointOneStep *New(int dt=-1, int it=-1);
+ static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1);
MEDFileJointOneStep *deepCopy() const;
MEDFileJointOneStep *shallowCpy() const;
bool isEqual(const MEDFileJointOneStep *other) const;
int getIteration() const;
void pushCorrespondence(MEDFileJointCorrespondence* correspondence);
int getNumberOfCorrespondences() const;
- void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const throw(INTERP_KERNEL::Exception);
- std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
+ void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const;
+ std::string simpleRepr() const;
%extend
{
MEDFileJointOneStep()
return MEDFileJointOneStep::New();
}
- MEDFileJointOneStep(const std::string& fileName, const std::string& mName, const std::string& jointName, int number) throw(INTERP_KERNEL::Exception)
+ MEDFileJointOneStep(const std::string& fileName, const std::string& mName, const std::string& jointName, int number)
{
return MEDFileJointOneStep::New(fileName,mName,jointName,number);
}
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->simpleRepr();
}
- MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const throw(INTERP_KERNEL::Exception)
+ MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const
{
MEDFileJointCorrespondence *ret(self->getCorrespondenceAtPos(i));
if(ret)
return ret;
}
- MEDFileJointCorrespondence *__getitem__(int i) const throw(INTERP_KERNEL::Exception)
+ MEDFileJointCorrespondence *__getitem__(int i) const
{
return MEDCoupling_MEDFileJointOneStep_getCorrespondenceAtPos(self,i);
}
class MEDFileJoint : public RefCountObject, public MEDFileWritableStandAlone
{
public:
- static MEDFileJoint *New() throw(INTERP_KERNEL::Exception);
- static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception);
- static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum) throw(INTERP_KERNEL::Exception);
+ static MEDFileJoint *New();
+ static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num);
+ static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum);
MEDFileJoint *deepCopy() const;
MEDFileJoint *shallowCpy() const;
bool isEqual(const MEDFileJoint *other) const;
std::string getDescription() const;
void setJointName(const std::string& name);
std::string getJointName() const;
- bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
+ bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
void setDomainNumber(const int& number);
int getDomainNumber() const;
void pushStep(MEDFileJointOneStep* step);
return MEDFileJoint::New();
}
- MEDFileJoint(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception)
+ MEDFileJoint(const std::string& fileName, const std::string& mName, int num)
{
return MEDFileJoint::New(fileName,mName,num);
}
- MEDFileJoint(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum) throw(INTERP_KERNEL::Exception)
+ MEDFileJoint(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum)
{
return MEDFileJoint::New(jointName,locMeshName,remoteMeshName,remoteMeshNum);
}
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->simpleRepr();
}
- MEDFileJointOneStep *getStepAtPos(int i) const throw(INTERP_KERNEL::Exception)
+ MEDFileJointOneStep *getStepAtPos(int i) const
{
MEDFileJointOneStep *ret(self->getStepAtPos(i));
if(ret)
return ret;
}
- MEDFileJointOneStep *__getitem__(int i) throw(INTERP_KERNEL::Exception)
+ MEDFileJointOneStep *__getitem__(int i)
{
return MEDCoupling_MEDFileJoint_getStepAtPos(self,i);
}
class MEDFileJoints : public RefCountObject, public MEDFileWritableStandAlone
{
public:
- static MEDFileJoints *New() throw(INTERP_KERNEL::Exception);
- static MEDFileJoints *New(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
+ static MEDFileJoints *New();
+ static MEDFileJoints *New(const std::string& fileName, const std::string& meshName);
MEDFileJoints *deepCopy() const;
std::string simpleRepr() const;
std::string getMeshName() const;
int getNumberOfJoints() const;
std::vector<std::string> getJointsNames() const;
- bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
- void resize(int newSize) throw(INTERP_KERNEL::Exception);
+ bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
+ void resize(int newSize);
void pushJoint(MEDFileJoint *joint);
- void setJointAtPos(int i, MEDFileJoint *joint) throw(INTERP_KERNEL::Exception);
- void destroyJointAtPos(int i) throw(INTERP_KERNEL::Exception);
+ void setJointAtPos(int i, MEDFileJoint *joint);
+ void destroyJointAtPos(int i);
%extend
{
MEDFileJoints()
return MEDFileJoints::New();
}
- MEDFileJoints(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
+ MEDFileJoints(const std::string& fileName, const std::string& meshName)
{
return MEDFileJoints::New(fileName,meshName);
}
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->simpleRepr();
}
- MEDFileJoint *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ MEDFileJoint *__getitem__(PyObject *obj)
{
static const char msg[]="MEDFileJoints::__getitem__ : only integer or string with meshname supported !";
if(PyInt_Check(obj))
return ret;
}
- int __len__() const throw(INTERP_KERNEL::Exception)
+ int __len__() const
{
return self->getNumberOfJoints();
}
- MEDFileJoint *getJointAtPos(int i) const throw(INTERP_KERNEL::Exception)
+ MEDFileJoint *getJointAtPos(int i) const
{
MEDFileJoint *ret=self->getJointAtPos(i);
if(ret)
return ret;
}
- MEDFileJoint *getJointWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
+ MEDFileJoint *getJointWithName(const std::string& paramName) const
{
MEDFileJoint *ret=self->getJointWithName(paramName);
if(ret)
public:
void clear();
std::size_t size() const;
- void setArray(int meshDimRelToMax, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
- void setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
+ void setArray(int meshDimRelToMax, DataArrayInt *da);
+ void setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da);
%extend
{
- DataArrayInt *getArray(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
+ DataArrayInt *getArray(INTERP_KERNEL::NormalizedCellType type)
{
DataArrayInt *ret(self->getArray(type));
if(ret) ret->incrRef();
return ret;
}
- PyObject *getTypes() const throw(INTERP_KERNEL::Exception)
+ PyObject *getTypes() const
{
std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getTypes());
std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
MEDFileEquivalences();
public:
int size() const;
- std::vector<std::string> getEquivalenceNames() const throw(INTERP_KERNEL::Exception);
- void killEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception);
- void killEquivalenceAt(int i) throw(INTERP_KERNEL::Exception);
+ std::vector<std::string> getEquivalenceNames() const;
+ void killEquivalenceWithName(const std::string& name);
+ void killEquivalenceAt(int i);
void clear();
%extend
{
- MEDFileEquivalencePair *getEquivalence(int i) throw(INTERP_KERNEL::Exception)
+ MEDFileEquivalencePair *getEquivalence(int i)
{
MEDFileEquivalencePair *ret(self->getEquivalence(i));
if(ret) ret->incrRef();
return ret;
}
- MEDFileEquivalencePair *getEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
+ MEDFileEquivalencePair *getEquivalenceWithName(const std::string& name)
{
MEDFileEquivalencePair *ret(self->getEquivalenceWithName(name));
if(ret) ret->incrRef();
return ret;
}
- MEDFileEquivalencePair *appendEmptyEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
+ MEDFileEquivalencePair *appendEmptyEquivalenceWithName(const std::string& name)
{
MEDFileEquivalencePair *ret(self->appendEmptyEquivalenceWithName(name));
if(ret) ret->incrRef();
class MEDFileMesh : public RefCountObject, public MEDFileWritableStandAlone
{
public:
- static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
- static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
- static MEDFileMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
- virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
- virtual MEDFileMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
- virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
- virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
+ static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
+ static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
+ static MEDFileMesh *New(DataArrayByte *db);
+ virtual MEDFileMesh *createNewEmpty() const;
+ virtual MEDFileMesh *deepCopy() const;
+ virtual MEDFileMesh *shallowCpy() const;
+ virtual void clearNonDiscrAttributes() const;
void setName(const std::string& name);
std::string getName();
std::string getUnivName() const;
std::string getTimeUnit() const;
void setAxisType(MEDCouplingAxisType at);
MEDCouplingAxisType getAxisType() const;
- virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
- virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
- virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
- virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
- virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
- virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const throw(INTERP_KERNEL::Exception);
- virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
- virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
- virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
- virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
- virtual MEDFileMesh *cartesianize() const throw(INTERP_KERNEL::Exception);
- std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
- std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
- int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
+ virtual int getNumberOfNodes() const;
+ virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const;
+ virtual bool hasImplicitPart() const;
+ virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const;
+ virtual void releaseImplicitPartIfAny() const;
+ virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const;
+ virtual std::vector<int> getFamArrNonEmptyLevelsExt() const;
+ virtual std::vector<int> getNumArrNonEmptyLevelsExt() const;
+ virtual std::vector<int> getNameArrNonEmptyLevelsExt() const;
+ virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const;
+ virtual MEDFileMesh *cartesianize() const;
+ std::vector<int> getNonEmptyLevels() const;
+ std::vector<int> getNonEmptyLevelsExt() const;
+ int getSizeAtLevel(int meshDimRelToMaxExt) const;
//
- bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
- bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
- bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
- void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
- void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
- void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
- void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
- virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
- virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
- void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
- void clearGrpMap() throw(INTERP_KERNEL::Exception);
- void clearFamMap() throw(INTERP_KERNEL::Exception);
- void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
- const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
- const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
- std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
- std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
- std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
- void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
- void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
- std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
- void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
- std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
- std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
- std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
- std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
- std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
- std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
- std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
- std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
- std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
- std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
- std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
- std::vector<std::string> getFamiliesNamesWithFilePointOfView() const throw(INTERP_KERNEL::Exception);
+ bool existsGroup(const std::string& groupName) const;
+ bool existsFamily(int famId) const;
+ bool existsFamily(const std::string& familyName) const;
+ void setFamilyId(const std::string& familyName, int id);
+ void setFamilyIdUnique(const std::string& familyName, int id);
+ void addFamily(const std::string& familyName, int id);
+ void addFamilyOnGrp(const std::string& grpName, const std::string& famName);
+ virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName);
+ virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs);
+ void copyFamGrpMapsFrom(const MEDFileMesh& other);
+ void clearGrpMap();
+ void clearFamMap();
+ void clearFamGrpMaps();
+ const std::map<std::string,int>& getFamilyInfo() const;
+ const std::map<std::string, std::vector<std::string> >& getGroupInfo() const;
+ std::vector<std::string> getFamiliesOnGroup(const std::string& name) const;
+ std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const;
+ std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const;
+ void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams);
+ void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds);
+ std::vector<std::string> getGroupsOnFamily(const std::string& name) const;
+ void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps);
+ std::vector<std::string> getGroupsNames() const;
+ std::vector<std::string> getFamiliesNames() const;
+ std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const;
+ std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const;
+ std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const;
+ std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const;
+ std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const;
+ std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const;
+ std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const;
+ std::vector<int> getFamNonEmptyLevels(const std::string& fam) const;
+ std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const;
+ std::vector<std::string> getFamiliesNamesWithFilePointOfView() const;
static std::string GetMagicFamilyStr();
- void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
- std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
- void removeGroupAtLevel(int meshDimRelToMaxExt, const std::string& name) throw(INTERP_KERNEL::Exception);
- void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
- void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
- std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
- std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
- void removeFamiliesReferedByNoGroups() throw(INTERP_KERNEL::Exception);
- void rearrangeFamilies() throw(INTERP_KERNEL::Exception);
- void checkOrphanFamilyZero() const throw(INTERP_KERNEL::Exception);
- void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
- void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
- void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
- void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
+ void assignFamilyNameWithGroupName();
+ std::vector<std::string> removeEmptyGroups();
+ void removeGroupAtLevel(int meshDimRelToMaxExt, const std::string& name);
+ void removeGroup(const std::string& name);
+ void removeFamily(const std::string& name);
+ std::vector<std::string> removeOrphanGroups();
+ std::vector<std::string> removeOrphanFamilies();
+ void removeFamiliesReferedByNoGroups();
+ void rearrangeFamilies();
+ void checkOrphanFamilyZero() const;
+ void changeGroupName(const std::string& oldName, const std::string& newName);
+ void changeFamilyName(const std::string& oldName, const std::string& newName);
+ void changeFamilyId(int oldId, int newId);
+ void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames);
void setFamilyInfo(const std::map<std::string,int>& info);
void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
- int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
- int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
- int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
- int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
- int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
- int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
- int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
- virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
- virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
- virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
- DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
- DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
- std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
- std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
- bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
- void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
- void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
- virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
- virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
- virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
+ int getFamilyId(const std::string& name) const;
+ int getMaxAbsFamilyId() const;
+ int getMaxFamilyId() const;
+ int getMinFamilyId() const;
+ int getTheMaxAbsFamilyId() const;
+ int getTheMaxFamilyId() const;
+ int getTheMinFamilyId() const;
+ virtual int getMaxAbsFamilyIdInArrays() const;
+ virtual int getMaxFamilyIdInArrays() const;
+ virtual int getMinFamilyIdInArrays() const;
+ DataArrayInt *getAllFamiliesIdsReferenced() const;
+ DataArrayInt *computeAllFamilyIdsInUse() const;
+ std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const;
+ std::string getFamilyNameGivenId(int id) const;
+ bool ensureDifferentFamIdsPerLevel();
+ void normalizeFamIdsTrio();
+ void normalizeFamIdsMEDFile();
+ virtual int getMeshDimension() const;
+ virtual std::string simpleRepr() const;
+ virtual std::string advancedRepr() const;
//
- virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
- virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
- virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
- virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
- virtual void setGlobalNumFieldAtLevel(int meshDimRelToMaxExt, DataArrayInt *globalNumArr) throw(INTERP_KERNEL::Exception);
- virtual void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
- virtual void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
- virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
- virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
- virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
- virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
- virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
- virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
- virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
- virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
+ virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const;
+ virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr);
+ virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr);
+ virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr);
+ virtual void setGlobalNumFieldAtLevel(int meshDimRelToMaxExt, DataArrayInt *globalNumArr);
+ virtual void addNodeGroup(const DataArrayInt *ids);
+ virtual void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids);
+ virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const;
+ virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const;
+ virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const;
+ virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const;
+ virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const;
+ virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const;
+ virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const;
+ virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const;
int getNumberOfJoints();
MEDFileJoints *getJoints();
void setJoints( MEDFileJoints* joints );
void initializeEquivalences();
void killEquivalences();
- bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
- void killStructureElements() throw(INTERP_KERNEL::Exception);
+ bool presenceOfStructureElements() const;
+ void killStructureElements();
%extend
{
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->simpleRepr();
}
- MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
+ MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const
{
return self->getMeshAtLevel(meshDimRelToMaxExt,false);
}
- PyObject *getTime() throw(INTERP_KERNEL::Exception)
+ PyObject *getTime()
{
int tmp1,tmp2;
double tmp0=self->getTime(tmp1,tmp2);
return res;
}
- virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
+ virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const
{
std::string what;
bool ret0=self->isEqual(other,eps,what);
return res;
}
- void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
+ void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false)
{
std::vector<const DataArrayInt *> grps;
convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",grps);
self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
}
- PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
+ PyObject *areFamsEqual(const MEDFileMesh *other) const
{
std::string what;
bool ret0=self->areFamsEqual(other,what);
return res;
}
- PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
+ PyObject *areGrpsEqual(const MEDFileMesh *other) const
{
std::string what;
bool ret0=self->areGrpsEqual(other,what);
return res;
}
- PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
+ PyObject *getAllGeoTypes() const
{
std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
return res;
}
- PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
+ PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const
{
std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
return res;
}
- PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
+ PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const
{
const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
if(tmp)
return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
- PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception)
+ PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt)
{
const DataArrayInt *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
if(tmp)
return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
- PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
+ PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const
{
const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
if(tmp)
return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
- PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
+ PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const
{
const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
if(tmp)
return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
- PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
+ PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const
{
const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
if(tmp)
return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
}
- PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
+ PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created)
{
bool ret1;
std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
return ret;
}
- PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
+ PyObject *unPolyze()
{
DataArrayInt *ret3=0;
std::vector<int> ret1,ret2;
return ret;
}
- MEDFileEquivalences *getEquivalences() throw(INTERP_KERNEL::Exception)
+ MEDFileEquivalences *getEquivalences()
{
MEDFileEquivalences *ret(self->getEquivalences());
if(ret) ret->incrRef();
return ret;
}
- virtual DataArrayInt *getGlobalNumFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
+ virtual DataArrayInt *getGlobalNumFieldAtLevel(int meshDimRelToMaxExt) const
{
MCAuto<DataArrayInt> ret(self->getGlobalNumFieldAtLevel(meshDimRelToMaxExt));
return ret.retn();
class MEDFileUMesh : public MEDFileMesh
{
public:
- static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
- static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
- static MEDFileUMesh *New(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception);
- static MEDFileUMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
+ static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
+ static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
+ static MEDFileUMesh *New(const MEDCouplingMappedExtrudedMesh *mem);
+ static MEDFileUMesh *New(DataArrayByte *db);
static MEDFileUMesh *New();
static const char *GetSpeStr4ExtMesh();
~MEDFileUMesh();
- int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
- int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
- void checkConsistency() const throw(INTERP_KERNEL::Exception);
- void checkSMESHConsistency() const throw(INTERP_KERNEL::Exception);
+ int getSpaceDimension() const;
+ int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const;
+ void checkConsistency() const;
+ void checkSMESHConsistency() const;
void clearNodeAndCellNumbers();
//
- MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
- MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
- MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
- MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
- DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
- MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
- MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
- MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
- MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
- void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
+ MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const;
+ MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const;
+ MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const;
+ MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const;
+ DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const;
+ MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const;
+ MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const;
+ MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const;
+ MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const;
+ void forceComputationOfParts() const;
//
- void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
- void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
- void setCoordsForced(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
- void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
- void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
- void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
- void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
- void optimizeFamilies() throw(INTERP_KERNEL::Exception);
- DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
- DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
- DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
- MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
- MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const throw(INTERP_KERNEL::Exception);
- MEDFileUMesh *quadraticToLinear(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
- MEDCouplingMappedExtrudedMesh *convertToExtrudedMesh() const throw(INTERP_KERNEL::Exception);
+ void setFamilyNameAttachedOnId(int id, const std::string& newFamName);
+ void setCoords(DataArrayDouble *coords);
+ void setCoordsForced(DataArrayDouble *coords);
+ void eraseGroupsAtLevel(int meshDimRelToMaxExt);
+ void removeMeshAtLevel(int meshDimRelToMax);
+ void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m);
+ void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false);
+ void optimizeFamilies();
+ DataArrayInt *zipCoords();
+ DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const;
+ DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const;
+ MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const;
+ MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const;
+ MEDFileUMesh *quadraticToLinear(double eps=1e-12) const;
+ MEDCouplingMappedExtrudedMesh *convertToExtrudedMesh() const;
%extend
{
- MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
+ MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0)
{
return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
}
- MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
+ MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0)
{
return MEDFileUMesh::New(fileName,mrs);
}
- MEDFileUMesh(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception)
+ MEDFileUMesh(const MEDCouplingMappedExtrudedMesh *mem)
{
return MEDFileUMesh::New(mem);
}
- MEDFileUMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
+ MEDFileUMesh(DataArrayByte *db)
{
return MEDFileUMesh::New(db);
}
return MEDFileUMesh::New();
}
- static MEDFileUMesh *LoadPartOf(const std::string& fileName, const std::string& mName, PyObject *types, const std::vector<int>& slicPerTyp, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
+ static MEDFileUMesh *LoadPartOf(const std::string& fileName, const std::string& mName, PyObject *types, const std::vector<int>& slicPerTyp, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0)
{
std::vector<int> typesCpp1;
convertPyToNewIntArr3(types,typesCpp1);
return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
}
- PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
+ PyObject *__getstate__()
{
std::vector<double> a0;
std::vector<int> a1;
return ret;
}
- void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
+ void __setstate__(PyObject *inp)
{
static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
if(!PyTuple_Check(inp))
}
}
- void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
+ void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh)
{
if(!mesh)
throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
}
- void __delitem__(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
+ void __delitem__(int meshDimRelToMax)
{
self->removeMeshAtLevel(meshDimRelToMax);
}
- MEDFileUMesh *symmetry3DPlane(PyObject *point, PyObject *normalVector) const throw(INTERP_KERNEL::Exception)
+ MEDFileUMesh *symmetry3DPlane(PyObject *point, PyObject *normalVector) const
{
const char msg[]="Python wrap of MEDFileUMesh::symmetry3DPlane : ";
double val,val2;
return ret.retn();
}
- static MEDFileUMesh *Aggregate(PyObject *meshes) throw(INTERP_KERNEL::Exception)
+ static MEDFileUMesh *Aggregate(PyObject *meshes)
{
std::vector<const MEDFileUMesh *> meshesCpp;
convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileUMesh *>(meshes,SWIGTYPE_p_MEDCoupling__MEDFileUMesh,"MEDFileUMesh",meshesCpp);
return ret.retn();
}
- PyObject *getAllDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
+ PyObject *getAllDistributionOfTypes() const
{
std::vector< std::pair<int,int> > ret(self->getAllDistributionOfTypes());
return convertVecPairIntToPy(ret);
}
- DataArrayInt *deduceNodeSubPartFromCellSubPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
+ DataArrayInt *deduceNodeSubPartFromCellSubPart(PyObject *extractDef) const
{
std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
convertToMapIntDataArrayInt(extractDef,extractDefCpp);
return self->deduceNodeSubPartFromCellSubPart(extractDefCpp);
}
- MEDFileUMesh *extractPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
+ MEDFileUMesh *extractPart(PyObject *extractDef) const
{
std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
convertToMapIntDataArrayInt(extractDef,extractDefCpp);
return self->extractPart(extractDefCpp);
}
- void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
+ void setMeshes(PyObject *li, bool renum=false)
{
std::vector<const MEDCouplingUMesh *> ms;
convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
self->setMeshes(ms,renum);
}
- void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
+ void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false)
{
std::vector<const MEDCouplingUMesh *> ms;
convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
}
- void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
+ void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false)
{
std::vector<const MEDCouplingUMesh *> ms;
convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
}
- DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
+ DataArrayDouble *getCoords() const
{
DataArrayDouble *ret=self->getCoords();
if(ret)
return ret;
}
- PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
+ PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const
{
const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
if(ret)
return const_cast<PartDefinition *>(ret);
}
- PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
+ PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1)
{
DataArrayInt *ret0=0,*ret1=0,*ret2=0;
self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
return ret;
}
- MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
+ MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const
{
MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
if(ret)
return ret;
}
- PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
+ PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const
{
std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
std::size_t sz(tmp.size());
public:
%extend
{
- MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
+ MEDCoupling1SGTUMesh *getImplicitFaceMesh() const
{
MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
if(ret)
{
public:
static MEDFileCMesh *New();
- static MEDFileCMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
- static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
- static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
- void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
- int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
+ static MEDFileCMesh *New(DataArrayByte *db);
+ static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
+ static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
+ void setMesh(MEDCouplingCMesh *m);
+ int getSpaceDimension() const;
%extend
{
MEDFileCMesh()
return MEDFileCMesh::New();
}
- MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
+ MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0)
{
return MEDFileCMesh::New(fileName,mrs);
}
- MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
+ MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0)
{
return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
}
- MEDFileCMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
+ MEDFileCMesh(DataArrayByte *db)
{
return MEDFileCMesh::New(db);
}
- PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
+ PyObject *getMesh() const
{
const MEDCouplingCMesh *tmp=self->getMesh();
if(tmp)
{
public:
static MEDFileCurveLinearMesh *New();
- static MEDFileCurveLinearMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
- static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
- static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
- void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
+ static MEDFileCurveLinearMesh *New(DataArrayByte *db);
+ static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
+ static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
+ void setMesh(MEDCouplingCurveLinearMesh *m);
%extend
{
MEDFileCurveLinearMesh()
return MEDFileCurveLinearMesh::New();
}
- MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
+ MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0)
{
return MEDFileCurveLinearMesh::New(fileName,mrs);
}
- MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
+ MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0)
{
return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
}
- MEDFileCurveLinearMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
+ MEDFileCurveLinearMesh(DataArrayByte *db)
{
return MEDFileCurveLinearMesh::New(db);
}
- PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
+ PyObject *getMesh() const
{
const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
if(tmp)
{
public:
static MEDFileMeshMultiTS *New();
- static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
- static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
- MEDFileMeshMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
- std::string getName() const throw(INTERP_KERNEL::Exception);
- void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
- void cartesianizeMe() throw(INTERP_KERNEL::Exception);
+ static MEDFileMeshMultiTS *New(const std::string& fileName);
+ static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName);
+ MEDFileMeshMultiTS *deepCopy() const;
+ std::string getName() const;
+ void setOneTimeStep(MEDFileMesh *mesh1TimeStep);
+ void cartesianizeMe();
%extend
{
MEDFileMeshMultiTS()
return MEDFileMeshMultiTS::New();
}
- MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
+ MEDFileMeshMultiTS(const std::string& fileName)
{
return MEDFileMeshMultiTS::New(fileName);
}
- MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
+ MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName)
{
return MEDFileMeshMultiTS::New(fileName,mName);
}
- MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
+ MEDFileMesh *getOneTimeStep() const
{
MEDFileMesh *ret=self->getOneTimeStep();
if(ret)
public:
%extend
{
- PyObject *next() throw(INTERP_KERNEL::Exception)
+ PyObject *next()
{
MEDFileMesh *ret=self->nextt();
if(ret)
{
public:
static MEDFileMeshes *New();
- static MEDFileMeshes *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
- MEDFileMeshes *deepCopy() const throw(INTERP_KERNEL::Exception);
- int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
- std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
+ static MEDFileMeshes *New(DataArrayByte *db);
+ MEDFileMeshes *deepCopy() const;
+ int getNumberOfMeshes() const;
+ std::vector<std::string> getMeshesNames() const;
//
- void resize(int newSize) throw(INTERP_KERNEL::Exception);
- void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
- void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
- void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
- void cartesianizeMe() throw(INTERP_KERNEL::Exception);
- bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
- void killStructureElements() throw(INTERP_KERNEL::Exception);
+ void resize(int newSize);
+ void pushMesh(MEDFileMesh *mesh);
+ void setMeshAtPos(int i, MEDFileMesh *mesh);
+ void destroyMeshAtPos(int i);
+ void cartesianizeMe();
+ bool presenceOfStructureElements() const;
+ void killStructureElements();
%extend
{
MEDFileMeshes()
return MEDFileMeshes::New();
}
- MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
+ MEDFileMeshes(const std::string& fileName)
{
return MEDFileMeshes::New(fileName);
}
- MEDFileMeshes(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
+ MEDFileMeshes(DataArrayByte *db)
{
return MEDFileMeshes::New(db);
}
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->simpleRepr();
}
- MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ MEDFileMesh *__getitem__(PyObject *obj)
{
static const char msg[]="MEDFileMeshes::__getitem__ : only integer or string with meshname supported !";
if(PyInt_Check(obj))
return ret;
}
- MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
+ MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh)
{
self->setMeshAtPos(obj,mesh);
return self;
}
- MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
+ MEDFileMeshesIterator *__iter__()
{
return self->iterator();
}
- int __len__() const throw(INTERP_KERNEL::Exception)
+ int __len__() const
{
return self->getNumberOfMeshes();
}
- MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
+ MEDFileMesh *getMeshAtPos(int i) const
{
MEDFileMesh *ret=self->getMeshAtPos(i);
if(ret)
ret->incrRef();
return ret;
}
- MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
+ MEDFileMesh *getMeshWithName(const std::string& mname) const
{
MEDFileMesh *ret=self->getMeshWithName(mname);
if(ret)
const std::vector<double>& getRefCoords() const;
const std::vector<double>& getGaussCoords() const;
const std::vector<double>& getGaussWeights() const;
- bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
+ bool isEqual(const MEDFileFieldLoc& other, double eps) const;
%extend
{
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->repr();
}
{
public:
void resetContent();
- void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
- void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
- void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
- void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
- void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
- void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
- void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
- void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
- std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
- std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
- bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
- bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
- std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
- std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
- std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
- std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
- virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
- virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
- virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
- virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
- void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
- void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
- void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
- void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
- int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
- int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
- int getProfileId(const std::string& pfl) const throw(INTERP_KERNEL::Exception);
- void killStructureElementsInGlobs() throw(INTERP_KERNEL::Exception);
+ void shallowCpyGlobs(const MEDFileFieldGlobsReal& other);
+ void deepCpyGlobs(const MEDFileFieldGlobsReal& other);
+ void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other);
+ void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other);
+ void appendGlobs(const MEDFileFieldGlobsReal& other, double eps);
+ void checkGlobsCoherency() const;
+ void checkGlobsPflsPartCoherency() const;
+ void checkGlobsLocsPartCoherency() const;
+ std::vector<std::string> getPfls() const;
+ std::vector<std::string> getLocs() const;
+ bool existsPfl(const std::string& pflName) const;
+ bool existsLoc(const std::string& locName) const;
+ std::string createNewNameOfPfl() const;
+ std::string createNewNameOfLoc() const;
+ std::vector< std::vector<int> > whichAreEqualProfiles() const;
+ std::vector< std::vector<int> > whichAreEqualLocs(double eps) const;
+ virtual std::vector<std::string> getPflsReallyUsed() const;
+ virtual std::vector<std::string> getLocsReallyUsed() const;
+ virtual std::vector<std::string> getPflsReallyUsedMulti() const;
+ virtual std::vector<std::string> getLocsReallyUsedMulti() const;
+ void killProfileIds(const std::vector<int>& pflIds);
+ void killLocalizationIds(const std::vector<int>& locIds);
+ void changePflName(const std::string& oldName, const std::string& newName);
+ void changeLocName(const std::string& oldName, const std::string& newName);
+ int getNbOfGaussPtPerCell(int locId) const;
+ int getLocalizationId(const std::string& loc) const;
+ int getProfileId(const std::string& pfl) const;
+ void killStructureElementsInGlobs();
%extend
{
- PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
+ PyObject *getProfile(const std::string& pflName) const
{
const DataArrayInt *ret=self->getProfile(pflName);
if(ret)
return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
- PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
+ PyObject *getProfileFromId(int pflId) const
{
const DataArrayInt *ret=self->getProfileFromId(pflId);
if(ret)
return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
- PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
+ PyObject *getLocalizationFromId(int locId) const
{
const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
if(loc)
return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
}
- PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
+ PyObject *getLocalization(const std::string& locName) const
{
const MEDFileFieldLoc *loc=&self->getLocalization(locName);
if(loc)
return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
}
- PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
+ PyObject *zipPflsNames()
{
std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
return convertVecPairVecStToPy(ret);
}
- PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
+ PyObject *zipLocsNames(double eps)
{
std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
return convertVecPairVecStToPy(ret);
}
- void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
+ void changePflsNames(PyObject *li)
{
std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
self->changePflsNames(v);
}
- void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
+ void changePflsRefsNamesGen(PyObject *li)
{
std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
self->changePflsRefsNamesGen(v);
}
- void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
+ void changePflsNamesInStruct(PyObject *li)
{
std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
self->changePflsNamesInStruct(v);
}
- void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
+ void changeLocsNames(PyObject *li)
{
std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
self->changeLocsNames(v);
}
- void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
+ void changeLocsRefsNamesGen(PyObject *li)
{
std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
self->changeLocsRefsNamesGen(v);
}
- void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
+ void changeLocsNamesInStruct(PyObject *li)
{
std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
self->changeLocsNamesInStruct(v);
}
- std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
+ std::string simpleReprGlobs() const
{
std::ostringstream oss;
self->simpleReprGlobs(oss);
public:
%extend
{
- static MEDFileEntities *BuildFrom(PyObject *entities) throw(INTERP_KERNEL::Exception)
+ static MEDFileEntities *BuildFrom(PyObject *entities)
{
std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > inp;
std::vector< std::pair<int,int> > inp0(convertTimePairIdsFromPy(entities));
class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
{
public:
- static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
- static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
- static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
- static MEDFileAnyTypeField1TS *NewAdv(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileEntities *entities) throw(INTERP_KERNEL::Exception);
- void loadArrays() throw(INTERP_KERNEL::Exception);
- void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
- void unloadArrays() throw(INTERP_KERNEL::Exception);
- void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
- int getDimension() const throw(INTERP_KERNEL::Exception);
- int getIteration() const throw(INTERP_KERNEL::Exception);
- int getOrder() const throw(INTERP_KERNEL::Exception);
- std::string getName() throw(INTERP_KERNEL::Exception);
- void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
- std::string getMeshName() throw(INTERP_KERNEL::Exception);
- void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
- int getMeshIteration() const throw(INTERP_KERNEL::Exception);
- int getMeshOrder() const throw(INTERP_KERNEL::Exception);
- int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
- bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
- void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
- const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
- bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
- void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
- virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
- MEDFileAnyTypeField1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
- std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
- void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
+ static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true);
+ static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
+ static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
+ static MEDFileAnyTypeField1TS *NewAdv(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileEntities *entities);
+ void loadArrays();
+ void loadArraysIfNecessary();
+ void unloadArrays();
+ void unloadArraysWithoutDataLoss();
+ int getDimension() const;
+ int getIteration() const;
+ int getOrder() const;
+ std::string getName();
+ void setName(const std::string& name);
+ std::string getMeshName();
+ void setMeshName(const std::string& newMeshName);
+ int getMeshIteration() const;
+ int getMeshOrder() const;
+ int getNumberOfComponents() const;
+ bool isDealingTS(int iteration, int order) const;
+ void setInfo(const std::vector<std::string>& infos);
+ const std::vector<std::string>& getInfo() const;
+ bool presenceOfMultiDiscPerGeoType() const;
+ void setTime(int iteration, int order, double val);
+ virtual MEDFileAnyTypeField1TS *shallowCpy() const;
+ MEDFileAnyTypeField1TS *deepCopy() const;
+ std::string getDtUnit() const;
+ void setDtUnit(const std::string& dtUnit);
%extend
{
- PyObject *getTime() throw(INTERP_KERNEL::Exception)
+ PyObject *getTime()
{
int tmp1,tmp2;
double tmp0=self->getTime(tmp1,tmp2);
return res;
}
- PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
+ PyObject *getDtIt() const
{
std::pair<int,int> res=self->getDtIt();
PyObject *elt=PyTuple_New(2);
return elt;
}
- void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
+ void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false)
{
self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
}
- void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
+ void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false)
{
self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
}
- bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
+ bool changeMeshNames(PyObject *li)
{
std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
return self->changeMeshNames(modifTab);
}
- PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
+ PyObject *getTypesOfFieldAvailable() const
{
std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
PyObject *ret2=PyList_New(ret.size());
return ret2;
}
- PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
+ PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const
{
std::vector<int> ret1;
int ret0=self->getNonEmptyLevels(mname,ret1);
return elt;
}
- PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
+ PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const
{
std::vector<INTERP_KERNEL::NormalizedCellType> types;
std::vector< std::vector<TypeOfField> > typesF;
return ret2;
}
- PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
+ PyObject *splitComponents() const
{
std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
std::size_t sz=ret.size();
return retPy;
}
- PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
+ PyObject *splitDiscretizations() const
{
std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
std::size_t sz=ret.size();
return retPy;
}
- PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
+ PyObject *splitMultiDiscrPerGeoTypes() const
{
std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
std::size_t sz=ret.size();
return retPy;
}
- MEDFileAnyTypeField1TS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
+ MEDFileAnyTypeField1TS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const
{
std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
convertToMapIntDataArrayInt(extractDef,extractDefCpp);
class MEDFileField1TS : public MEDFileAnyTypeField1TS
{
public:
- static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
- static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
- static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
- static MEDFileField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
+ static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
+ static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
+ static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true);
+ static MEDFileField1TS *New(DataArrayByte *db);
static MEDFileField1TS *New();
- MEDCoupling::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
- void copyTimeInfoFrom(MEDCouplingFieldDouble *mcf) throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
+ MEDCoupling::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const;
+ void copyTimeInfoFrom(MEDCouplingFieldDouble *mcf);
+ MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const;
+ MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
+ MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
+ MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
+ MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
+ MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
//
- void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
- void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
- void setFieldProfileFlatly(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
- void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
- void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
+ void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field);
+ void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile);
+ void setFieldProfileFlatly(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile);
+ void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false);
+ void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false);
%extend
{
- MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
+ MEDFileField1TS(const std::string& fileName, bool loadAll=true)
{
return MEDFileField1TS::New(fileName,loadAll);
}
- MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
+ MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
{
return MEDFileField1TS::New(fileName,fieldName,loadAll);
}
- MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
+ MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
{
return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
}
- MEDFileField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
+ MEDFileField1TS(DataArrayByte *db)
{
return MEDFileField1TS::New(db);
}
return MEDFileField1TS::New();
}
- void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
+ void copyTinyInfoFrom(const MEDCouplingFieldDouble *field)
{
const DataArrayDouble *arr=0;
if(field)
self->copyTinyInfoFrom(field,arr);
}
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->simpleRepr();
}
- PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
+ PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
{
return MEDFileField1TS_getFieldWithProfile<double>(self,type,meshDimRelToMax,mesh);
}
- PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
+ PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const
{
std::vector<INTERP_KERNEL::NormalizedCellType> types;
std::vector< std::vector<TypeOfField> > typesF;
return ret2;
}
- DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
+ DataArrayDouble *getUndergroundDataArray() const
{
DataArrayDouble *ret=self->getUndergroundDataArray();
if(ret)
return ret;
}
- PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
+ PyObject *getUndergroundDataArrayExt() const
{
return MEDFileField1TS_getUndergroundDataArrayExt<double>(self);
}
{
public:
static MEDFileIntField1TS *New();
- static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
- static MEDFileIntField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
- static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
- static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
- MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
+ static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true);
+ static MEDFileIntField1TS *New(DataArrayByte *db);
+ static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
+ static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
+ MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const;
//
- void setFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
- void setFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
- void setFieldProfileFlatly(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
- void copyTimeInfoFrom(MEDCouplingFieldInt *mcf) throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldInt *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
+ void setFieldNoProfileSBT(const MEDCouplingFieldInt *field);
+ void setFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile);
+ void setFieldProfileFlatly(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile);
+ void copyTimeInfoFrom(MEDCouplingFieldInt *mcf);
+ MEDCouplingFieldInt *field(const MEDFileMesh *mesh) const;
+ MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
+ MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
+ MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
+ MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
+ MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
%extend
{
- MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
+ MEDFileIntField1TS()
{
return MEDFileIntField1TS::New();
}
- MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
+ MEDFileIntField1TS(const std::string& fileName, bool loadAll=true)
{
return MEDFileIntField1TS::New(fileName,loadAll);
}
- MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
+ MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
{
return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
}
- MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
+ MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
{
return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
}
- MEDFileIntField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
+ MEDFileIntField1TS(DataArrayByte *db)
{
return MEDFileIntField1TS::New(db);
}
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->simpleRepr();
}
- PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
+ PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
{
return MEDFileField1TS_getFieldWithProfile<int>(self,type,meshDimRelToMax,mesh);
}
- DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
+ DataArrayInt *getUndergroundDataArray() const
{
DataArrayInt *ret=self->getUndergroundDataArray();
if(ret)
return ret;
}
- PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
+ PyObject *getUndergroundDataArrayExt() const
{
return MEDFileField1TS_getUndergroundDataArrayExt<int>(self);
}
{
public:
static MEDFileFloatField1TS *New();
- static MEDFileFloatField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
- static MEDFileFloatField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
- static MEDFileFloatField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
- static MEDFileFloatField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
- MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
+ static MEDFileFloatField1TS *New(const std::string& fileName, bool loadAll=true);
+ static MEDFileFloatField1TS *New(DataArrayByte *db);
+ static MEDFileFloatField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
+ static MEDFileFloatField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
+ MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const;
//
- void setFieldNoProfileSBT(const MEDCouplingFieldFloat *field) throw(INTERP_KERNEL::Exception);
- void setFieldProfile(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
- void setFieldProfileFlatly(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
- void copyTimeInfoFrom(MEDCouplingFieldFloat *mcf) throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldFloat *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldFloat *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldFloat *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldFloat *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
+ void setFieldNoProfileSBT(const MEDCouplingFieldFloat *field);
+ void setFieldProfile(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile);
+ void setFieldProfileFlatly(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile);
+ void copyTimeInfoFrom(MEDCouplingFieldFloat *mcf);
+ MEDCouplingFieldFloat *field(const MEDFileMesh *mesh) const;
+ MEDCouplingFieldFloat *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
+ MEDCouplingFieldFloat *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
+ MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
+ MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
+ MEDCouplingFieldFloat *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
%extend
{
- MEDFileFloatField1TS() throw(INTERP_KERNEL::Exception)
+ MEDFileFloatField1TS()
{
return MEDFileFloatField1TS::New();
}
- MEDFileFloatField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
+ MEDFileFloatField1TS(const std::string& fileName, bool loadAll=true)
{
return MEDFileFloatField1TS::New(fileName,loadAll);
}
- MEDFileFloatField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
+ MEDFileFloatField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
{
return MEDFileFloatField1TS::New(fileName,fieldName,loadAll);
}
- MEDFileFloatField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
+ MEDFileFloatField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
{
return MEDFileFloatField1TS::New(fileName,fieldName,iteration,order,loadAll);
}
- MEDFileFloatField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
+ MEDFileFloatField1TS(DataArrayByte *db)
{
return MEDFileFloatField1TS::New(db);
}
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->simpleRepr();
}
- PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
+ PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
{
return MEDFileField1TS_getFieldWithProfile<float>(self,type,meshDimRelToMax,mesh);
}
- DataArrayFloat *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
+ DataArrayFloat *getUndergroundDataArray() const
{
DataArrayFloat *ret=self->getUndergroundDataArray();
if(ret)
return ret;
}
- PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
+ PyObject *getUndergroundDataArrayExt() const
{
return MEDFileField1TS_getUndergroundDataArrayExt<float>(self);
}
public:
%extend
{
- PyObject *next() throw(INTERP_KERNEL::Exception)
+ PyObject *next()
{
MEDFileAnyTypeField1TS *ret=self->nextt();
if(ret)
class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
{
public:
- static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
- static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
- MEDFileAnyTypeFieldMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
- virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
- std::string getName() const throw(INTERP_KERNEL::Exception);
- void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
- std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
- void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
- std::string getMeshName() const throw(INTERP_KERNEL::Exception);
- void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
- const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
- bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
- int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
- int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
- void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
- int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
- int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
- void loadArrays() throw(INTERP_KERNEL::Exception);
- void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
- void unloadArrays() throw(INTERP_KERNEL::Exception);
- void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
+ static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
+ static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
+ MEDFileAnyTypeFieldMultiTS *deepCopy() const;
+ virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const;
+ std::string getName() const;
+ void setName(const std::string& name);
+ std::string getDtUnit() const;
+ void setDtUnit(const std::string& dtUnit);
+ std::string getMeshName() const;
+ void setMeshName(const std::string& newMeshName);
+ const std::vector<std::string>& getInfo() const;
+ bool presenceOfMultiDiscPerGeoType() const;
+ int getNumberOfComponents() const;
+ int getNumberOfTS() const;
+ void eraseEmptyTS();
+ int getPosOfTimeStep(int iteration, int order) const;
+ int getPosGivenTime(double time, double eps=1e-8) const;
+ void loadArrays();
+ void loadArraysIfNecessary();
+ void unloadArrays();
+ void unloadArraysWithoutDataLoss();
//
- virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
- MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
- MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
- void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
- void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
- MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const throw(INTERP_KERNEL::Exception);
+ virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const;
+ MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const;
+ MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const;
+ void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts);
+ void synchronizeNameScope();
+ MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const;
%extend
{
- int __len__() const throw(INTERP_KERNEL::Exception)
+ int __len__() const
{
return self->getNumberOfTS();
}
- int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
+ int getTimeId(PyObject *elt0) const
{
if(elt0 && PyInt_Check(elt0))
{//fmts[3]
throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
}
- PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
+ PyObject *getIterations() const
{
std::vector< std::pair<int,int> > res(self->getIterations());
return convertVecPairIntToPy(res);
}
- PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
+ PyObject *getTimeSteps() const
{
std::vector<double> ret1;
std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
return ret2;
}
- PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
+ PyObject *getTypesOfFieldAvailable() const
{
std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
PyObject *ret2=PyList_New(ret.size());
return ret2;
}
- PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
+ PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const
{
std::vector<int> ret1;
int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
return elt;
}
- PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
+ PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const
{
std::vector<INTERP_KERNEL::NormalizedCellType> types;
std::vector< std::vector<TypeOfField> > typesF;
return ret2;
}
- std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
+ std::vector<int> getTimeIds(PyObject *elts) const
{
if(PyList_Check(elts))
{
}
}
- void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
+ void __delitem__(PyObject *elts)
{
if(PySlice_Check(elts))
{
}
}
- void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
+ void eraseTimeStepIds(PyObject *li)
{
int sw;
int pos1;
}
}
- MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
+ MEDFileAnyTypeFieldMultiTSIterator *__iter__()
{
return self->iterator();
}
- PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
+ PyObject *__getitem__(PyObject *elt0) const
{
if(elt0 && PyList_Check(elt0))
{
return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
}
- bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
+ bool changeMeshNames(PyObject *li)
{
std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
return self->changeMeshNames(modifTab);
}
- PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
+ PyObject *splitComponents() const
{
std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
std::size_t sz=ret.size();
return retPy;
}
- PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
+ PyObject *splitDiscretizations() const
{
std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
std::size_t sz=ret.size();
return retPy;
}
- PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
+ PyObject *splitMultiDiscrPerGeoTypes() const
{
std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
std::size_t sz=ret.size();
return retPy;
}
- void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
+ void pushBackTimeSteps(PyObject *li)
{
void *argp(0);
int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,0|0));
}
}
- MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
+ MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const
{
std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
convertToMapIntDataArrayInt(extractDef,extractDefCpp);
return self->extractPart(extractDefCpp,mm);
}
- static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
+ static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li)
{
std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
return retPy;
}
- static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
+ static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh)
{
std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
{
public:
- static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
- static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
- static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
- static MEDFileFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
+ static MEDFileFieldMultiTS *New();
+ static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
+ static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
+ static MEDFileFieldMultiTS *New(DataArrayByte *db);
//
- MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const;
+ MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
+ MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
+ MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
+ MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
+ MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
//
- void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
- void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
- MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
+ void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field);
+ void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile);
+ MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const;
%extend
{
MEDFileFieldMultiTS()
return MEDFileFieldMultiTS::New();
}
- MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
+ MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true)
{
return MEDFileFieldMultiTS::New(fileName,loadAll);
}
- MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
+ MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
{
return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
}
- MEDFileFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
+ MEDFileFieldMultiTS(DataArrayByte *db)
{
return MEDFileFieldMultiTS::New(db);
}
return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
}
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->simpleRepr();
}
- PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
+ PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const
{
DataArrayInt *ret1=0;
DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
return ret;
}
- PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
+ PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const
{
std::vector<INTERP_KERNEL::NormalizedCellType> types;
std::vector< std::vector<TypeOfField> > typesF;
}
return ret2;
}
- DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
+ DataArrayDouble *getUndergroundDataArray(int iteration, int order) const
{
DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
if(ret)
return ret;
}
- PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
+ PyObject *getUndergroundDataArrayExt(int iteration, int order) const
{
std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
public:
%extend
{
- PyObject *next() throw(INTERP_KERNEL::Exception)
+ PyObject *next()
{
MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
if(ret)
{
public:
static MEDFileIntFieldMultiTS *New();
- static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
- static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
- static MEDFileIntFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
+ static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
+ static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
+ static MEDFileIntFieldMultiTS *New(DataArrayByte *db);
//
- void appendFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
- void appendFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
- MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldInt *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
+ void appendFieldNoProfileSBT(const MEDCouplingFieldInt *field);
+ void appendFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile);
+ MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const;
+ MEDCouplingFieldInt *field(int iteration, int order, const MEDFileMesh *mesh) const;
+ MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
+ MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
+ MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
+ MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
+ MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
%extend
{
MEDFileIntFieldMultiTS()
return MEDFileIntFieldMultiTS::New();
}
- MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
+ MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true)
{
return MEDFileIntFieldMultiTS::New(fileName,loadAll);
}
- MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
+ MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
{
return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
}
- MEDFileIntFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
+ MEDFileIntFieldMultiTS(DataArrayByte *db)
{
return MEDFileIntFieldMultiTS::New(db);
}
return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
}
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->simpleRepr();
}
- PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
+ PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const
{
DataArrayInt *ret1=0;
DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
return ret;
}
- DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
+ DataArrayInt *getUndergroundDataArray(int iteration, int order) const
{
DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
if(ret)
{
public:
static MEDFileFloatFieldMultiTS *New();
- static MEDFileFloatFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
- static MEDFileFloatFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
- static MEDFileFloatFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
+ static MEDFileFloatFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
+ static MEDFileFloatFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
+ static MEDFileFloatFieldMultiTS *New(DataArrayByte *db);
//
- void appendFieldNoProfileSBT(const MEDCouplingFieldFloat *field) throw(INTERP_KERNEL::Exception);
- void appendFieldProfile(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
- MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldFloat *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldFloat *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldFloat *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldFloat *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
+ void appendFieldNoProfileSBT(const MEDCouplingFieldFloat *field);
+ void appendFieldProfile(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile);
+ MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const;
+ MEDCouplingFieldFloat *field(int iteration, int order, const MEDFileMesh *mesh) const;
+ MEDCouplingFieldFloat *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
+ MEDCouplingFieldFloat *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
+ MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
+ MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
+ MEDCouplingFieldFloat *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
%extend
{
MEDFileFloatFieldMultiTS()
return MEDFileFloatFieldMultiTS::New();
}
- MEDFileFloatFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
+ MEDFileFloatFieldMultiTS(const std::string& fileName, bool loadAll=true)
{
return MEDFileFloatFieldMultiTS::New(fileName,loadAll);
}
- MEDFileFloatFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
+ MEDFileFloatFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
{
return MEDFileFloatFieldMultiTS::New(fileName,fieldName,loadAll);
}
- MEDFileFloatFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
+ MEDFileFloatFieldMultiTS(DataArrayByte *db)
{
return MEDFileFloatFieldMultiTS::New(db);
}
return MEDFileFloatFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
}
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->simpleRepr();
}
- PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
+ PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const
{
DataArrayInt *ret1=0;
DataArrayFloat *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
return ret;
}
- DataArrayFloat *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
+ DataArrayFloat *getUndergroundDataArray(int iteration, int order) const
{
DataArrayFloat *ret=self->getUndergroundDataArray(iteration,order);
if(ret)
class MEDFileMeshSupports : public RefCountObject, public MEDFileWritableStandAlone
{
public:
- static MEDFileMeshSupports *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
- std::vector<std::string> getSupMeshNames() const throw(INTERP_KERNEL::Exception);
+ static MEDFileMeshSupports *New(const std::string& fileName);
+ std::vector<std::string> getSupMeshNames() const;
%extend
{
- MEDFileUMesh *getSupMeshWithName(const std::string& name) const throw(INTERP_KERNEL::Exception)
+ MEDFileUMesh *getSupMeshWithName(const std::string& name) const
{
const MEDFileUMesh *ret(self->getSupMeshWithName(name));
MEDFileUMesh *ret2(const_cast<MEDFileUMesh *>(ret));
class MEDFileStructureElements : public RefCountObject, public MEDFileWritableStandAlone
{
public:
- static MEDFileStructureElements *New(const std::string& fileName, const MEDFileMeshSupports *ms) throw(INTERP_KERNEL::Exception);
+ static MEDFileStructureElements *New(const std::string& fileName, const MEDFileMeshSupports *ms);
private:
MEDFileStructureElements();
};
class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
{
public:
- static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
- static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
- static MEDFileFields *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
- static MEDFileFields *NewAdv(const std::string& fileName, bool loadAll, const MEDFileEntities *entities) throw(INTERP_KERNEL::Exception);
- static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
- static MEDFileFields *NewWithDynGT(const std::string& fileName, const MEDFileStructureElements *se, bool loadAll=true) throw(INTERP_KERNEL::Exception);
- MEDFileFields *deepCopy() const throw(INTERP_KERNEL::Exception);
- MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
- void loadArrays() throw(INTERP_KERNEL::Exception);
- void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
- void unloadArrays() throw(INTERP_KERNEL::Exception);
- void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
+ static MEDFileFields *New();
+ static MEDFileFields *New(const std::string& fileName, bool loadAll=true);
+ static MEDFileFields *New(DataArrayByte *db);
+ static MEDFileFields *NewAdv(const std::string& fileName, bool loadAll, const MEDFileEntities *entities);
+ static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0);
+ static MEDFileFields *NewWithDynGT(const std::string& fileName, const MEDFileStructureElements *se, bool loadAll=true);
+ MEDFileFields *deepCopy() const;
+ MEDFileFields *shallowCpy() const;
+ void loadArrays();
+ void loadArraysIfNecessary();
+ void unloadArrays();
+ void unloadArraysWithoutDataLoss();
int getNumberOfFields() const;
- std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
- std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
+ std::vector<std::string> getFieldsNames() const;
+ std::vector<std::string> getMeshesNames() const;
//
- void resize(int newSize) throw(INTERP_KERNEL::Exception);
- void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
- void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
- int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
- MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
- MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
- MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
- bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
- void aggregate(const MEDFileFields& other) throw(INTERP_KERNEL::Exception);
- void killStructureElements() throw(INTERP_KERNEL::Exception);
- void keepOnlyStructureElements() throw(INTERP_KERNEL::Exception);
- void keepOnlyOnMeshSE(const std::string& meshName, const std::string& seName) throw(INTERP_KERNEL::Exception);
- void blowUpSE(MEDFileMeshes *ms, const MEDFileStructureElements *ses) throw(INTERP_KERNEL::Exception);
- void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
- bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
+ void resize(int newSize);
+ void pushField(MEDFileAnyTypeFieldMultiTS *field);
+ void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field);
+ int getPosFromFieldName(const std::string& fieldName) const;
+ MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const;
+ MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const;
+ MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const;
+ bool presenceOfStructureElements() const;
+ void aggregate(const MEDFileFields& other);
+ void killStructureElements();
+ void keepOnlyStructureElements();
+ void keepOnlyOnMeshSE(const std::string& meshName, const std::string& seName);
+ void blowUpSE(MEDFileMeshes *ms, const MEDFileStructureElements *ses);
+ void destroyFieldAtPos(int i);
+ bool removeFieldsWithoutAnyTimeStep();
%extend
{
MEDFileFields()
return MEDFileFields::New();
}
- MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
+ MEDFileFields(const std::string& fileName, bool loadAll=true)
{
return MEDFileFields::New(fileName,loadAll);
}
- MEDFileFields(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
+ MEDFileFields(DataArrayByte *db)
{
return MEDFileFields::New(db);
}
- MEDFileFields(const std::string& fileName, bool loadAll, const MEDFileEntities *entities) throw(INTERP_KERNEL::Exception)
+ MEDFileFields(const std::string& fileName, bool loadAll, const MEDFileEntities *entities)
{
return MEDFileFields::NewAdv(fileName,loadAll,entities);
}
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->simpleRepr();
}
- MEDFileFields *partOfThisOnStructureElements() const throw(INTERP_KERNEL::Exception)
+ MEDFileFields *partOfThisOnStructureElements() const
{
MCAuto<MEDFileFields> ret(self->partOfThisOnStructureElements());
return ret.retn();
}
- MEDFileFields *partOfThisLyingOnSpecifiedMeshSEName(const std::string& meshName, const std::string& seName) const throw(INTERP_KERNEL::Exception)
+ MEDFileFields *partOfThisLyingOnSpecifiedMeshSEName(const std::string& meshName, const std::string& seName) const
{
MCAuto<MEDFileFields> ret(self->partOfThisLyingOnSpecifiedMeshSEName(meshName,seName));
return ret.retn();
}
- static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
+ static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true)
{
std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
std::size_t sz(tmp.size());
return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
}
- PyObject *getMeshSENames() const throw(INTERP_KERNEL::Exception)
+ PyObject *getMeshSENames() const
{
std::vector< std::pair<std::string,std::string> > ps;
self->getMeshSENames(ps);
return convertVectPairStToPy(ps);
}
- PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
+ PyObject *getCommonIterations() const
{
bool ret1;
std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
return ret;
}
- MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
+ MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const
{
std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
}
- MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
+ MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const
{
std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
}
- PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *__getitem__(PyObject *obj)
{
if(obj && PyList_Check(obj))
{
return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
}
- MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
+ MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field)
{
self->setFieldAtPos(obj,field);
return self;
}
- int __len__() const throw(INTERP_KERNEL::Exception)
+ int __len__() const
{
return self->getNumberOfFields();
}
- MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
+ MEDFileFieldsIterator *__iter__()
{
return self->iterator();
}
- bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
+ bool changeMeshNames(PyObject *li)
{
std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
return self->changeMeshNames(modifTab);
}
- int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
+ int getPosOfField(PyObject *elt0) const
{
static const char msg[]="MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !";
if(!elt0)
return self->getPosFromFieldName(convertPyObjectToStr(elt0,msg));
}
- std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
+ std::vector<int> getPosOfFields(PyObject *elts) const
{
if(PyList_Check(elts))
{
}
}
- void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
+ void pushFields(PyObject *fields)
{
std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
self->pushFields(tmp);
}
- void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
+ void __delitem__(PyObject *elts)
{
if(elts && PySlice_Check(elts))
{
}
}
- MEDFileFields *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
+ MEDFileFields *extractPart(PyObject *extractDef, MEDFileMesh *mm) const
{
std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
convertToMapIntDataArrayInt(extractDef,extractDefCpp);
return self->extractPart(extractDefCpp,mm);
}
- MEDFileFields *linearToQuadratic(const MEDFileMeshes *oldLin, const MEDFileMeshes *newQuad) const throw(INTERP_KERNEL::Exception)
+ MEDFileFields *linearToQuadratic(const MEDFileMeshes *oldLin, const MEDFileMeshes *newQuad) const
{
MCAuto<MEDFileFields> ret(self->linearToQuadratic(oldLin,newQuad));
return ret.retn();
class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
{
public:
- void setValue(double val) throw(INTERP_KERNEL::Exception);
- double getValue() const throw(INTERP_KERNEL::Exception);
- std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
+ void setValue(double val);
+ double getValue() const;
+ std::string simpleRepr() const;
%extend
{
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->simpleRepr();
}
{
public:
static MEDFileParameterDouble1TS *New();
- static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
- static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
- static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
- virtual MEDFileParameter1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
- virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
- void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
- std::string getName() const throw(INTERP_KERNEL::Exception);
- void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
+ static MEDFileParameterDouble1TS *New(const std::string& fileName);
+ static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName);
+ static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it);
+ virtual MEDFileParameter1TS *deepCopy() const;
+ virtual std::string simpleRepr() const;
+ void setName(const std::string& name);
+ std::string getName() const;
+ void write(const std::string& fileName, int mode) const;
%extend
{
MEDFileParameterDouble1TS()
return MEDFileParameterDouble1TS::New();
}
- MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
+ MEDFileParameterDouble1TS(const std::string& fileName)
{
return MEDFileParameterDouble1TS::New(fileName);
}
- MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
+ MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName)
{
return MEDFileParameterDouble1TS::New(fileName,paramName);
}
- MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
+ MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it)
{
return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
}
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->simpleRepr();
}
- PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
+ PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const
{
std::string what;
bool ret0=self->isEqual(other,eps,what);
{
public:
static MEDFileParameterMultiTS *New();
- static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
- static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
+ static MEDFileParameterMultiTS *New(const std::string& fileName);
+ static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName);
std::string getName() const;
void setName(const std::string& name);
- MEDFileParameterMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
- void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
- std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
- void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
- double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
- int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
- int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
- int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
+ MEDFileParameterMultiTS *deepCopy() const;
+ void write(const std::string& fileName, int mode) const;
+ std::string simpleRepr() const;
+ void appendValue(int dt, int it, double time, double val);
+ double getDoubleValue(int iteration, int order) const;
+ int getPosOfTimeStep(int iteration, int order) const;
+ int getPosGivenTime(double time, double eps=1e-8) const;
+ int getNumberOfTS() const;
%extend
{
MEDFileParameterMultiTS()
return MEDFileParameterMultiTS::New(fileName,paramName);
}
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->simpleRepr();
}
- PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
+ PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const
{
std::string what;
bool ret0=self->isEqual(other,eps,what);
return res;
}
- void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
+ void eraseTimeStepIds(PyObject *ids)
{
int sw;
int pos1;
}
}
- int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
+ int getTimeStepId(PyObject *elt0) const
{
if(elt0 && PyInt_Check(elt0))
{//fmts[3]
throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
}
- MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
+ MEDFileParameter1TS *__getitem__(PyObject *elt0) const
{
MEDFileParameter1TS *ret=self->getTimeStepAtPos(MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
if(ret)
return ret;
}
- std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
+ std::vector<int> getTimeStepIds(PyObject *elts) const
{
if(PyList_Check(elts))
{
}
}
- void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
+ void __delitem__(PyObject *elts)
{
std::vector<int> idsToRemove=MEDCoupling_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
if(!idsToRemove.empty())
self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
}
- MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
+ MEDFileParameter1TS *getTimeStepAtPos(int posId) const
{
MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
if(ret)
return ret;
}
- PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
+ PyObject *getIterations() const
{
std::vector< std::pair<int,int> > res=self->getIterations();
PyObject *ret=PyList_New(res.size());
return ret;
}
- PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
+ PyObject *getTimeSteps() const
{
std::vector<double> res2;
std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
{
public:
static MEDFileParameters *New();
- static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
- static MEDFileParameters *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
- MEDFileParameters *deepCopy() const throw(INTERP_KERNEL::Exception);
- std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
- std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
- void resize(int newSize) throw(INTERP_KERNEL::Exception);
- void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
- void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
- void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
- int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
- int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
+ static MEDFileParameters *New(const std::string& fileName);
+ static MEDFileParameters *New(DataArrayByte *db);
+ MEDFileParameters *deepCopy() const;
+ std::vector<std::string> getParamsNames() const;
+ std::string simpleRepr() const;
+ void resize(int newSize);
+ void pushParam(MEDFileParameterMultiTS *param);
+ void setParamAtPos(int i, MEDFileParameterMultiTS *param);
+ void destroyParamAtPos(int i);
+ int getPosFromParamName(const std::string& paramName) const;
+ int getNumberOfParams() const;
%extend
{
MEDFileParameters()
return MEDFileParameters::New(fileName);
}
- MEDFileParameters(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
+ MEDFileParameters(DataArrayByte *db)
{
return MEDFileParameters::New(db);
}
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->simpleRepr();
}
- MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ MEDFileParameterMultiTS *__getitem__(PyObject *obj)
{
static const char msg[]="MEDFileParameters::__getitem__ : only integer or string with meshname supported !";
if(PyInt_Check(obj))
return ret;
}
- int __len__() const throw(INTERP_KERNEL::Exception)
+ int __len__() const
{
return self->getNumberOfParams();
}
- MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
+ MEDFileParameterMultiTS *getParamAtPos(int i) const
{
MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
if(ret)
return ret;
}
- MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
+ MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const
{
MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
if(ret)
return ret;
}
- PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
+ PyObject *isEqual(const MEDFileParameters *other, double eps) const
{
std::string what;
bool ret0=self->isEqual(other,eps,what);
class MEDFileData : public RefCountObject, public MEDFileWritableStandAlone
{
public:
- static MEDFileData *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
- static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
+ static MEDFileData *New(DataArrayByte *db);
+ static MEDFileData *New(const std::string& fileName);
static MEDFileData *New();
- MEDFileData *deepCopy() const throw(INTERP_KERNEL::Exception);
- void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
- void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
- void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
- int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
- int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
- int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
+ MEDFileData *deepCopy() const;
+ void setFields(MEDFileFields *fields);
+ void setMeshes(MEDFileMeshes *meshes);
+ void setParams(MEDFileParameters *params);
+ int getNumberOfFields() const;
+ int getNumberOfMeshes() const;
+ int getNumberOfParams() const;
//
- bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
- bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
- void dealWithStructureElements() throw(INTERP_KERNEL::Exception);
- std::string getHeader() const throw(INTERP_KERNEL::Exception);
- void setHeader(const std::string& header) throw(INTERP_KERNEL::Exception);
+ bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName);
+ bool unPolyzeMeshes();
+ void dealWithStructureElements();
+ std::string getHeader() const;
+ void setHeader(const std::string& header);
//
%extend
{
- MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
+ MEDFileData(const std::string& fileName)
{
return MEDFileData::New(fileName);
}
- MEDFileData(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
+ MEDFileData(DataArrayByte *db)
{
return MEDFileData::New(db);
}
return MEDFileData::New();
}
- std::string __str__() const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const
{
return self->simpleRepr();
}
- MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
+ MEDFileMeshes *getMeshes() const
{
MEDFileMeshes *ret=self->getMeshes();
if(ret)
return ret;
}
- MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
+ MEDFileParameters *getParams() const
{
MEDFileParameters *ret=self->getParams();
if(ret)
return ret;
}
- MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
+ MEDFileFields *getFields() const
{
MEDFileFields *ret=self->getFields();
if(ret)
return ret;
}
- bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
+ bool changeMeshNames(PyObject *li)
{
std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
return self->changeMeshNames(modifTab);
}
- static MEDFileData *Aggregate(PyObject *mfds) throw(INTERP_KERNEL::Exception)
+ static MEDFileData *Aggregate(PyObject *mfds)
{
std::vector<const MEDFileData *> mfdsCpp;
convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileData *>(mfds,SWIGTYPE_p_MEDCoupling__MEDFileData,"MEDFileData",mfdsCpp);
class SauvReader : public RefCountObject
{
public:
- static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
- MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
+ static SauvReader* New(const std::string& fileName);
+ MEDFileData * loadInMEDFileDS();
%extend
{
- SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
+ SauvReader(const std::string& fileName)
{
return SauvReader::New(fileName);
}
{
public:
static SauvWriter * New();
- void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
- void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
- void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
- bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
+ void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0);
+ void write(const std::string& fileName);
+ void setCpyGrpIfOnASingleFamilyStatus(bool status);
+ bool getCpyGrpIfOnASingleFamilyStatus() const;
%extend
{
- SauvWriter() throw(INTERP_KERNEL::Exception)
+ SauvWriter()
{
return SauvWriter::New();
}
class MEDFileField1TSStructItem
{
public:
- static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
+ static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt);
};
class MEDFileMeshStruct : public RefCountObject
{
public:
- static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
+ static MEDFileMeshStruct *New(const MEDFileMesh *mesh);
protected:
~MEDFileMeshStruct();
};
class MEDMeshMultiLev : public RefCountObject
{
public:
- virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
- DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
- DataArrayInt *retrieveGlobalNodeIdsIfAny() const throw(INTERP_KERNEL::Exception);
+ virtual MEDMeshMultiLev *prepare() const;
+ DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const;
+ DataArrayInt *retrieveGlobalNodeIdsIfAny() const;
protected:
~MEDMeshMultiLev();
public:
%extend
{
- PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
+ PyObject *retrieveFamilyIdsOnCells() const
{
DataArrayInt *famIds(0);
bool isWithoutCopy(false);
return ret;
}
- PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
+ PyObject *retrieveNumberIdsOnCells() const
{
DataArrayInt *numIds(0);
bool isWithoutCopy(false);
return ret;
}
- PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
+ PyObject *retrieveFamilyIdsOnNodes() const
{
DataArrayInt *famIds(0);
bool isWithoutCopy(false);
return ret;
}
- PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
+ PyObject *retrieveNumberIdsOnNodes() const
{
DataArrayInt *numIds(0);
bool isWithoutCopy(false);
return ret;
}
- PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
+ PyObject *getGeoTypes() const
{
std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
public:
%extend
{
- PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
+ PyObject *buildVTUArrays() const
{
DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
public:
%extend
{
- PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
+ PyObject *buildVTUArrays() const
{
bool isInternal;
std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
public:
%extend
{
- PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
+ PyObject *buildVTUArrays() const
{
DataArrayDouble *ret0(0);
std::vector<int> ret1;
class MEDFileFastCellSupportComparator : public RefCountObject
{
public:
- static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
- MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
- bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
- int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
+ static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref);
+ MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const;
+ bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const;
+ int getNumberOfTS() const;
protected:
~MEDFileFastCellSupportComparator();
public:
%extend
{
- PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
+ PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const
{
std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2017 CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
if 1 in mfm.getFamArrNonEmptyLevelsExt():
mlPart.setFamilyFieldArr(1,mfm.getFamilyFieldAtLevel(1)[trad])
pass
- for k,v in dAddlevs.iteritems():
+ for k,v in dAddlevs.items():
part=v.getCellIdsFullyIncludedInNodeIds(trad)
mSubPart=v[part] ; mSubPart.renumberNodesInConn(trado2n) ; mSubPart.setCoords(mPart.getCoords())
mlPart[k]=mSubPart
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
self.assertRaises(Exception,MEDLoader.ReadField,MEDLoader.ON_CELLS,fname,"mesh",0,"field2",5,5) # invalid time step
pass
+ def testMultiWriteFieldOnMergeableNodesMeshes(self):
+ fname="Pyfile120.med"
+ arr=MEDLoader.DataArrayDouble([(0,0),(1,0),(0,1),(0,0),(1,0),(0,1)])
+ m=MEDLoader.MEDCouplingUMesh("mesh",2)
+ m.setCoords(arr)
+ m.allocateCells()
+ m.insertNextCell(MEDLoader.NORM_TRI3,[0,4,2])
+ m.insertNextCell(MEDLoader.NORM_TRI3,[3,1,5])
+ m.setName("mesh")
+ #
+ f=MEDLoader.MEDCouplingFieldDouble(MEDLoader.ON_CELLS)
+ f.setMesh(m)
+ f.setArray(MEDLoader.DataArrayDouble([5,6]))
+ f.setName("field")
+ #
+ f.setTime(0.,0,0)
+ MEDLoader.WriteField(fname,f,True)
+ f.setTime(1.,1,0)
+ MEDLoader.WriteField(fname,f,False)
+ pass
+
pass
if __name__ == "__main__":
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2016 CEA/DEN, EDF R&D
+# Copyright (C) 2016-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include <vector>
-static PyObject *convertMEDFileMesh(MEDCoupling::MEDFileMesh* mesh, int owner) throw(INTERP_KERNEL::Exception)
+static PyObject *convertMEDFileMesh(MEDCoupling::MEDFileMesh* mesh, int owner)
{
PyObject *ret=0;
if(!mesh)
return ret;
}
-static PyObject *convertMEDFileParameter1TS(MEDCoupling::MEDFileParameter1TS* p1ts, int owner) throw(INTERP_KERNEL::Exception)
+static PyObject *convertMEDFileParameter1TS(MEDCoupling::MEDFileParameter1TS* p1ts, int owner)
{
PyObject *ret=0;
if(!p1ts)
return ret;
}
-static PyObject *convertMEDFileField1TS(MEDCoupling::MEDFileAnyTypeField1TS *p, int owner) throw(INTERP_KERNEL::Exception)
+static PyObject *convertMEDFileField1TS(MEDCoupling::MEDFileAnyTypeField1TS *p, int owner)
{
PyObject *ret=0;
if(!p)
return ret;
}
-static PyObject *convertMEDFileFieldMultiTS(MEDCoupling::MEDFileAnyTypeFieldMultiTS *p, int owner) throw(INTERP_KERNEL::Exception)
+static PyObject *convertMEDFileFieldMultiTS(MEDCoupling::MEDFileAnyTypeFieldMultiTS *p, int owner)
{
PyObject *ret=0;
if(!p)
return ret;
}
-static PyObject *convertMEDMeshMultiLev(MEDCoupling::MEDMeshMultiLev *p, int owner) throw(INTERP_KERNEL::Exception)
+static PyObject *convertMEDMeshMultiLev(MEDCoupling::MEDMeshMultiLev *p, int owner)
{
PyObject *ret=0;
if(!p)
return ret;
}
-static std::vector<std::pair<int,int> > convertTimePairIdsFromPy(PyObject *pyLi) throw(INTERP_KERNEL::Exception)
+static std::vector<std::pair<int,int> > convertTimePairIdsFromPy(PyObject *pyLi)
{
std::vector<std::pair<int,int> > ret;
if(PyList_Check(pyLi))
* Called by MEDFileAnyTypeFieldMultiTS::__getitem__ when \a elt0 is neither a list nor a slice.
* In this case a MEDFileAnyTypeField1TS object is returned.
*/
-int MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(const MEDFileAnyTypeFieldMultiTS *self, PyObject *elt0) throw(INTERP_KERNEL::Exception)
+int MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(const MEDFileAnyTypeFieldMultiTS *self, PyObject *elt0)
{
if(elt0 && PyInt_Check(elt0))
{//fmts[3]
* Called by MEDFileAnyTypeFieldMultiTS::__getitem__ when \a obj is neither a list nor a slice.
* In this case a MEDFileAnyTypeField1TS object is returned.
*/
-int MEDFileFieldsgetitemSingleTS__(const MEDFileFields *self, PyObject *obj) throw(INTERP_KERNEL::Exception)
+int MEDFileFieldsgetitemSingleTS__(const MEDFileFields *self, PyObject *obj)
{
static const char msg[]="MEDFileFields::__getitem__ : only integer or string with fieldname supported !";
if(PyInt_Check(obj))
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
self.assertTrue(ids1.isEqual(ids2))
pass
+ @unittest.skipUnless(HasXDR(),"requires XDR")
+ def testReadSauvXDRCastem17(self):
+ """test reading Castem17 XDR sauv with 'ENREGISTREMENT DE TYPE 8'"""
+ sauvFile = os.path.join(self.__getResourcesDirectory(),"castem17_result_xdr.sauv")
+ self.assertTrue( os.access( sauvFile, os.F_OK))
+ sr=SauvReader.New(sauvFile)
+ mfd2=sr.loadInMEDFileDS()
+ mfMesh=mfd2.getMeshes()[0]
+ umesh0 = mfMesh.getMeshAtLevel(0)
+ #
+ self.assertEqual(2,umesh0.getNumberOfCellsWithType( NORM_HEXA8 ))
+ self.assertEqual(12,umesh0.getNumberOfNodes())
+ #
+ mfField=mfd2.getFields().getFieldWithName("TEMP1")
+ iterations = mfField.getIterations()
+ field0 = mfField.getFieldOnMeshAtLevel(ON_NODES, iterations[0][0],iterations[0][1],umesh0)
+ fieldArray = field0.getArray()
+ expectedValues = [238.46153846153845]*4 + [169.23076923076923]*4 + [100]*4
+ expectedArray = DataArrayDouble(expectedValues)
+ self.assertTrue( fieldArray.isEqualWithoutConsideringStr( expectedArray, 1e-12 ))
+ pass
+
+ def testReadSauvAsciiCastem17(self):
+ """test reading Castem17 ascii sauv with 'ENREGISTREMENT DE TYPE 8'"""
+ sauvFile = os.path.join(self.__getResourcesDirectory(),"castem17_result_ascii.sauv")
+ self.assertTrue( os.access( sauvFile, os.F_OK))
+ sr=SauvReader.New(sauvFile)
+ mfd2=sr.loadInMEDFileDS()
+ mfMesh=mfd2.getMeshes()[0]
+ umesh0 = mfMesh.getMeshAtLevel(0)
+ #
+ self.assertEqual(2,umesh0.getNumberOfCellsWithType( NORM_HEXA8 ))
+ self.assertEqual(12,umesh0.getNumberOfNodes())
+ #
+ mfField=mfd2.getFields().getFieldWithName("TEMP1")
+ iterations = mfField.getIterations()
+ field0 = mfField.getFieldOnMeshAtLevel(ON_NODES, iterations[0][0],iterations[0][1],umesh0)
+ fieldArray = field0.getArray()
+ expectedValues = [238.46153846153845]*4 + [169.23076923076923]*4 + [100]*4
+ expectedArray = DataArrayDouble(expectedValues)
+ self.assertTrue( fieldArray.isEqualWithoutConsideringStr( expectedArray, 1e-12 ))
+ pass
+
def testGaussPt(self):
"""issue 22321: [CEA 933] Bug when reading a sauve file containing field on Gauss Pt.
The problem was that a field ON_GAUSS_PT was created but no Gauss Localization
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#!/usr/bin/env python
# --
-# Copyright (C) 2009-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2009-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# -*- coding: iso-8859-1 -*-
# --
-# Copyright (C) 2009-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2009-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#!/usr/bin/env python
# --
-# Copyright (C) 2009-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2009-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-# Copyright (C) 2017 CEA/DEN, EDF R&D
+# Copyright (C) 2017-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-# Copyright (C) 2012-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-# Copyright (C) 2015-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2015-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-# Copyright (C) 2012-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2017 CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2017 CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-# Copyright (C) 2012-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-# Copyright (C) 2015-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2015-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
int nbv=coor.size()/2; //nb of vertices
DataArrayDouble *myCoords=DataArrayDouble::New();
- myCoords->useArray( &coor[0], /*ownership=*/false, CPP_DEALLOC, nbv, 2 );
+ myCoords->useArray( &coor[0], /*ownership=*/false, DeallocType::CPP_DEALLOC, nbv, 2 );
mesh->setCoords(myCoords);
mesh->setName("FacesIn2D");
myCoords->decrRef();
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-# Copyright (C) 2012-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-# Copyright (C) 2015-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2015-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
public:
typedef enum {METIS,SCOTCH,PTSCOTCH} splitter_type;
public:
- virtual void partGraph(int ndomain, const std::string& options_string="", ParaDomainSelector *sel=0) throw(INTERP_KERNEL::Exception);
+ virtual void partGraph(int ndomain, const std::string& options_string="", ParaDomainSelector *sel=0);
MEDCoupling::MEDCouplingSkyLineArray *getGraph() const
{
const MEDCoupling::MEDCouplingSkyLineArray *ret(self->getGraph());
class MEDPartitioner
{
public:
- MEDPartitioner(const std::string& filename, int ndomains=1, const std::string& library="metis",bool create_boundary_faces=false, bool create_joints=false, bool mesure_memory=false) throw(INTERP_KERNEL::Exception);
- MEDPartitioner(const MEDCoupling::MEDFileData* fileData, int ndomains=1, const std::string& library="metis",bool create_boundary_faces=false, bool create_joints=false, bool mesure_memory=false) throw(INTERP_KERNEL::Exception);
- MEDPartitioner(const MEDCoupling::MEDFileData* fileData, Graph* graph, bool create_boundary_faces=false, bool create_joints=false, bool mesure_memory=false) throw(INTERP_KERNEL::Exception);
- static MEDPARTITIONER::Graph* Graph(MEDCoupling::MEDCouplingSkyLineArray* graph, Graph::splitter_type split=Graph::METIS, int* edgeweight=0, MEDCoupling::DataArrayInt* vlbloctab=0) throw(INTERP_KERNEL::Exception);
+ MEDPartitioner(const std::string& filename, int ndomains=1, const std::string& library="metis",bool create_boundary_faces=false, bool create_joints=false, bool mesure_memory=false);
+ MEDPartitioner(const MEDCoupling::MEDFileData* fileData, int ndomains=1, const std::string& library="metis",bool create_boundary_faces=false, bool create_joints=false, bool mesure_memory=false);
+ MEDPartitioner(const MEDCoupling::MEDFileData* fileData, Graph* graph, bool create_boundary_faces=false, bool create_joints=false, bool mesure_memory=false);
+ static MEDPARTITIONER::Graph* Graph(MEDCoupling::MEDCouplingSkyLineArray* graph, Graph::splitter_type split=Graph::METIS, int* edgeweight=0, MEDCoupling::DataArrayInt* vlbloctab=0);
static std::vector<std::string> AvailableAlgorithms();
static std::vector<std::string> AllAlgorithms();
- MEDCoupling::MEDFileData* getMEDFileData() throw(INTERP_KERNEL::Exception);
- void write(const std::string& filename) throw(INTERP_KERNEL::Exception);
+ MEDCoupling::MEDFileData* getMEDFileData();
+ void write(const std::string& filename);
};
}
-# Copyright (C) 2012-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-# Copyright (C) 2012-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-# Copyright (C) 2012-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
value[ielem*ncomp+icomp]=_recvbuffer[counters[iproc]*ncomp+icomp];
counters[iproc]++;
}
- _local_field->getField()->getArray()->useArray(value,true,CPP_DEALLOC,nb_local,_topotarget->getNbComponents());
+ _local_field->getField()->getArray()->useArray(value,true,DeallocType::CPP_DEALLOC,nb_local,_topotarget->getNbComponents());
}
void ExplicitCoincidentDEC::sendData()
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-# Copyright (C) 2012-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
paramesh=new ParaMESH(mesh,*target_group,targetMeshName);
DataArrayInt *da=DataArrayInt::New();
const int globalNumberingP2[5]={0,1,2,3,4};
- da->useArray(globalNumberingP2,false,CPP_DEALLOC,5,1);
+ da->useArray(globalNumberingP2,false,DeallocType::CPP_DEALLOC,5,1);
paramesh->setNodeGlobal(da);
da->decrRef();
}
paramesh=new ParaMESH(mesh,*target_group,targetMeshName);
DataArrayInt *da=DataArrayInt::New();
const int globalNumberingP3[3]={4,2,5};
- da->useArray(globalNumberingP3,false,CPP_DEALLOC,3,1);
+ da->useArray(globalNumberingP3,false,DeallocType::CPP_DEALLOC,3,1);
paramesh->setNodeGlobal(da);
da->decrRef();
}
paramesh=new ParaMESH(mesh,*target_group,targetMeshName);
DataArrayInt *da=DataArrayInt::New();
const int globalNumberingP4[6]={3,6,7,4,8,5};
- da->useArray(globalNumberingP4,false,CPP_DEALLOC,6,1);
+ da->useArray(globalNumberingP4,false,DeallocType::CPP_DEALLOC,6,1);
paramesh->setNodeGlobal(da);
da->decrRef();
}
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-# Copyright (C) 2012-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2017 CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-# Copyright (C) 2017 CEA/DEN, EDF R&D
+# Copyright (C) 2017-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-# Copyright (C) 2017 CEA/DEN, EDF R&D
+# Copyright (C) 2017-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2017 CEA/DEN, EDF R&D
+# Copyright (C) 2017-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2017 CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2017 CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-# Copyright (C) 2017 CEA/DEN, EDF R&D
+# Copyright (C) 2017-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-# Copyright (C) 2012-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-# Copyright (C) 2012-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-# Copyright (C) 2015-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2015-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// Copyright (C) 2017 CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
public:
%extend
{
- virtual PyObject *renumber(const MEDCoupling::DataArrayInt *graph, const MEDCoupling::DataArrayInt *index_graph) throw(INTERP_KERNEL::Exception)
+ virtual PyObject *renumber(const MEDCoupling::DataArrayInt *graph, const MEDCoupling::DataArrayInt *index_graph)
{
if(!graph || !index_graph)
throw INTERP_KERNEL::Exception("wrap of Renumbering::renumber : One of the input arrays is NULL !");
namespace MED_RENUMBER
{
- Renumbering *RenumberingFactory(const std::string& s) throw(INTERP_KERNEL::Exception);
+ Renumbering *RenumberingFactory(const std::string& s);
std::vector<std::string> RenumberAvailableMethods();
std::vector<std::string> AllRenumberMethods();
}
-# Copyright (C) 2012-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
if sys.platform == "win32":
from MEDCouplingCompat import *
else:
- from MEDCoupling import *
+ from medcoupling import *
from math import pi, sqrt
-# Copyright (C) 2012-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
+# Copyright (C) 2016-2019 CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
import os
rep=("namespace ParaMEDMEM","namespace MEDCoupling")
rep=("ParaMEDMEM::","MEDCoupling::")
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public