1 # Copyright (C) 2012-2015 CEA/DEN, EDF R&D
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 from MEDLoader import *
22 fns=['DomainMesh_1.med', 'DomainMesh_2.med','DomainMesh_3.med']
23 outs=["out1.vtu","out2.vtu","out3.vtu","out4.vtu"]
24 trs=[(-0.714,-0.714,0.),(0.,0.,0.),(-0.577,-0.577,-0.577)]
39 m.translate([scal*elt for elt in trs[i]])
40 f=MEDCouplingFieldDouble.New(ON_CELLS,NO_TIME)
42 da=DataArrayDouble.New()
43 da.alloc(m.getNumberOfCells(),1)
52 f=MEDCouplingFieldDouble.MergeFields(fs)
55 MEDCouplingFieldDouble.WriteVTK("Domain.vtu",[f])
56 dd=DataArrayDouble.Aggregate(dds)
57 m=MEDCouplingUMesh.MergeUMeshes(mns)
59 m.translate([3.*elt for elt in [0.577,0.577,0.577]])
60 f2=MEDCouplingFieldDouble.New(ON_CELLS,NO_TIME)
64 MEDCouplingFieldDouble.WriteVTK('DomainMesh.vtu',[f2])
65 #m=MEDCouplingUMesh.MergeUMeshes(mns)
66 #m.writeVTK("DomainMesh.vtu")