# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2023 CEA, EDF
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
import sys
-if sys.platform == "win32":
- from MEDCouplingCompat import *
-else:
- from medcoupling import *
+from medcoupling import *
from math import pi, sqrt
import MEDCouplingCompat as MEDCoupling
else:
import MEDCoupling
+
+def build2DTargetMesh_1():
+ targetCoords=[-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 ];
+ targetConn=[0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4];
+ targetMesh=MEDCouplingUMesh.New();
+ targetMesh.setMeshDimension(2);
+ targetMesh.allocateCells(5);
+ targetMesh.insertNextCell(NORM_QUAD4,4,targetConn[0:4]);
+ targetMesh.insertNextCell(NORM_TRI3,3,targetConn[4:7]);
+ targetMesh.insertNextCell(NORM_TRI3,3,targetConn[7:10]);
+ targetMesh.insertNextCell(NORM_QUAD4,4,targetConn[10:14]);
+ targetMesh.insertNextCell(NORM_QUAD4,4,targetConn[14:18]);
+ targetMesh.finishInsertingCells();
+ myCoords=DataArrayDouble.New();
+ myCoords.setValues(targetCoords,9,2);
+ targetMesh.setCoords(myCoords);
+ return targetMesh;
-from MEDCouplingDataForTest import MEDCouplingDataForTest
-m=MEDCouplingDataForTest.build2DTargetMesh_1();
+
+m=build2DTargetMesh_1()
#! [UG_Optimization_0]
from MEDRenumber import RenumberingFactory
ren=RenumberingFactory("BOOST")