#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2012 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2015 CEA/DEN, EDF 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.
+# 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
nproc_source = 3
procs_source = range( nproc_source )
procs_target = range( size - nproc_source + 1, size)
-
+
interface = CommInterface()
target_group = MPIProcessorGroup(interface, procs_target)
source_group = MPIProcessorGroup(interface, procs_source)
dec = InterpKernelDEC(source_group, target_group)
-
+
mesh =0
support =0
paramesh =0
parafield =0
icocofield =0
- data_dir = os.environ['MED_ROOT_DIR']
+ data_dir = os.environ['MEDCOUPLING_ROOT_DIR']
tmp_dir = os.environ['TMP']
-
+
if not tmp_dir or len(tmp_dir)==0:
tmp_dir = "/tmp"
pass
-
- filename_xml1 = os.path.join(data_dir, "share/salome/resources/med/square1_split")
- filename_xml2 = os.path.join(data_dir, "share/salome/resources/med/square2_split")
-
+
+ filename_xml1 = os.path.join(data_dir, "share/resources/med/square1_split")
+ filename_xml2 = os.path.join(data_dir, "share/resources/med/square2_split")
+
MPI_Barrier(MPI_COMM_WORLD)
if source_group.containsMyRank():
filename = filename_xml1 + str(rank+1) + ".med"
meshname = "Mesh_2_" + str(rank+1)
- mesh=MEDLoader.ReadUMeshFromFile(filename,meshname,0)
+ mesh=ReadUMeshFromFile(filename,meshname,0)
paramesh=ParaMESH(mesh,source_group,"source mesh")
comptopo = ComponentTopology()
parafield = ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo)
else:
filename = filename_xml2 + str(rank - nproc_source + 1) + ".med"
meshname = "Mesh_3_" + str(rank - nproc_source + 1)
- mesh=MEDLoader.ReadUMeshFromFile(filename,meshname,0)
+ mesh=ReadUMeshFromFile(filename,meshname,0)
paramesh=ParaMESH(mesh,target_group,"target mesh")
comptopo = ComponentTopology()
parafield = ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo)
dec.setMethod("P0")
dec.attachLocalField(icocofield)
pass
-
+
if source_group.containsMyRank():
field_before_int = parafield.getVolumeIntegral(0,True)
dec.synchronize()