-# Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+# 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "ParaMEDLoader.hxx"
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef __PARAMEDLOADER_HXX__
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "BlockTopology.hxx"
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef __BLOCKTOPOLOGY_HXX__
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "CommInterface.hxx"
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef __COMMINTERFACE_HXX__
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "ComponentTopology.hxx"
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef __COMPONENTTOPOLOGY_HXX__
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "CommInterface.hxx"
#include <cmath>
-/*! \defgroup dec DEC
- *
- * \section decintroduction Introduction
- *
- * Interface class for creation of a link between two
- * processor groups for exhanging mesh or field data.
- * The DEC is defined by attaching a field on the receiving or on the
- * sending side.
- * On top of attaching a ParaMEDMEM::FIELD, it is possible to
- * attach a ICoCo::Field. This class is an abstract class that enables
- * coupling of codes that respect the ICoCo interface \ref icoco. It has two implementations:
- * one for codes that express their fields as MEDCoupling fields (ICoCo::MEDField) and one
- * for codes that express their fields as Trio/U fields.
- *
- * \section dec_options DEC Options
- * Options supported by DEC objects are
- *
- * <TABLE BORDER=1 >
- * <TR><TD>Option</TD><TD>Description</TD><TD>Default value</TD></TR>
- * <TR><TD>ForcedRenormalization</TD><TD>After receiving data, the target field is renormalized so that L2-norms of the source and target fields match.</TD><TD> false </TD></TR>
- *</TABLE>
-
-
- The following code excerpt shows how to set options for an object that inherits from DEC :
-
- \code
- InterpKernelDEC dec(source_group,target_group);
- dec.setOptions("ForcedRenormalization",true);
- dec.attachLocalField(field);
- dec.synchronize();
- if (source_group.containsMyRank())
- dec.sendData();
- else
- dec.recvData();
- \endcode
-*/
-
namespace ParaMEDMEM
{
-
-
- /*! \addtogroup dec
- @{
- */
- DEC::DEC(ProcessorGroup& source_group, ProcessorGroup& target_group):_local_field(0),
- _source_group(&source_group),
- _target_group(&target_group),
- _owns_field(false),
- _owns_groups(false),
- _icoco_field(0)
- {
- _union_group = source_group.fuse(target_group);
- }
- DEC::DEC(const std::set<int>& source_ids, const std::set<int>& target_ids, const MPI_Comm& world_comm):_local_field(0),
- _owns_field(false),
- _owns_groups(true),
- _icoco_field(0)
- {
- ParaMEDMEM::CommInterface comm;
- // Create the list of procs including source and target
- std::set<int> union_ids; // source and target ids in world_comm
- union_ids.insert(source_ids.begin(),source_ids.end());
- union_ids.insert(target_ids.begin(),target_ids.end());
- int* union_ranks_world=new int[union_ids.size()]; // ranks of sources and targets in world_comm
- std::copy<std::set<int>::const_iterator,int*> (union_ids.begin(), union_ids.end(), union_ranks_world);
-
- // Create a communicator on these procs
- MPI_Group union_group,world_group;
- comm.commGroup(world_comm,&world_group);
- comm.groupIncl(world_group,union_ids.size(),union_ranks_world,&union_group);
- MPI_Comm union_comm;
- comm.commCreate(world_comm,union_group,&union_comm);
- delete[] union_ranks_world;
-
- if (union_comm==MPI_COMM_NULL)
- { // This process is not in union
- _source_group=0;
- _target_group=0;
- _union_group=0;
- return;
- }
-
- // Translate source_ids and target_ids from world_comm to union_comm
- int* source_ranks_world=new int[source_ids.size()]; // ranks of sources in world_comm
- std::copy<std::set<int>::const_iterator,int*> (source_ids.begin(), source_ids.end(),source_ranks_world);
- int* source_ranks_union=new int[source_ids.size()]; // ranks of sources in union_comm
- int* target_ranks_world=new int[target_ids.size()]; // ranks of targets in world_comm
- std::copy<std::set<int>::const_iterator,int*> (target_ids.begin(), target_ids.end(),target_ranks_world);
- int* target_ranks_union=new int[target_ids.size()]; // ranks of targets in union_comm
- MPI_Group_translate_ranks(world_group,source_ids.size(),source_ranks_world,union_group,source_ranks_union);
- MPI_Group_translate_ranks(world_group,target_ids.size(),target_ranks_world,union_group,target_ranks_union);
- std::set<int> source_ids_union;
- for (int i=0;i<(int)source_ids.size();i++)
- source_ids_union.insert(source_ranks_union[i]);
- std::set<int> target_ids_union;
- for (int i=0;i<(int)target_ids.size();i++)
- target_ids_union.insert(target_ranks_union[i]);
- delete [] source_ranks_world;
- delete [] source_ranks_union;
- delete [] target_ranks_world;
- delete [] target_ranks_union;
-
- // Create the MPIProcessorGroups
- _source_group= new MPIProcessorGroup(comm,source_ids_union,union_comm);
- _target_group = new MPIProcessorGroup(comm,target_ids_union,union_comm);
- _union_group = _source_group->fuse(*_target_group);
-
- }
-
DEC::~DEC()
{
- if(_owns_field)
- delete _local_field;
- if(_owns_groups)
- {
- delete _source_group;
- delete _target_group;
- }
- delete _icoco_field;
- delete _union_group;
- }
-
- void DEC::setNature(NatureOfField nature)
- {
- if(_local_field)
- _local_field->getField()->setNature(nature);
- }
-
- /*! Attaches a local field to a DEC.
- If the processor is on the receiving end of the DEC, the field
- will be updated by a recvData() call.
- Reversely, if the processor is on the sending end, the field will be read, possibly transformed, and sent appropriately to the other side.
- */
- void DEC::attachLocalField(const ParaFIELD* field, bool ownPt)
- {
- if(!isInUnion())
- return ;
- if(_owns_field)
- delete _local_field;
- _local_field=field;
- _owns_field=ownPt;
- _comm_interface=&(field->getTopology()->getProcGroup()->getCommInterface());
- compareFieldAndMethod();
- }
-
- /*! Attaches a local field to a DEC. The method will test whether the processor
- is on the source or the target side and will associate the mesh underlying the
- field to the local side.
-
- If the processor is on the receiving end of the DEC, the field
- will be updated by a recvData() call.
- Reversely, if the processor is on the sending end, the field will be read, possibly transformed,
- and sent appropriately to the other side.
- */
-
- void DEC::attachLocalField(MEDCouplingFieldDouble* field)
- {
- if(!isInUnion())
- return ;
- ProcessorGroup* local_group;
- if (_source_group->containsMyRank())
- local_group=_source_group;
- else if (_target_group->containsMyRank())
- local_group=_target_group;
- else
- throw INTERP_KERNEL::Exception("Invalid procgroup for field attachment to DEC");
- ParaMESH *paramesh=new ParaMESH((MEDCouplingPointSet *)field->getMesh(),*local_group,field->getMesh()->getName());
- ParaFIELD *tmp=new ParaFIELD(field, paramesh, *local_group);
- tmp->setOwnSupport(true);
- attachLocalField(tmp,true);
- //_comm_interface=&(local_group->getCommInterface());
- }
-
- /*!
- Attaches a local field to a DEC.
- If the processor is on the receiving end of the DEC, the field
- will be updated by a recvData() call.
- Reversely, if the processor is on the sending end, the field will be read, possibly transformed, and sent appropriately to the other side.
- The field type is a generic ICoCo Field, so that the DEC can couple a number of different fields :
- - a ICoCo::MEDField, that is created from a MEDCoupling structure
- - a ICOCo::TrioField, that is created from tables extracted from a TRIO-U structure.
-
- */
-
- void DEC::attachLocalField(const ICoCo::Field* field)
- {
- if(!isInUnion())
- return ;
- const ICoCo::MEDField* medfield=dynamic_cast<const ICoCo::MEDField*> (field);
- if(medfield !=0)
- {
- attachLocalField(medfield->getField());
- return;
- }
- const ICoCo::TrioField* triofield=dynamic_cast<const ICoCo::TrioField*> (field);
- if (triofield !=0)
- {
- ProcessorGroup* localgroup;
- if (_source_group->containsMyRank())
- localgroup=_source_group;
- else
- localgroup=_target_group;
- delete _icoco_field;
-
- _icoco_field=new ICoCo::MEDField(*const_cast<ICoCo::TrioField* >(triofield));
- attachLocalField(_icoco_field);
- return;
- }
- throw INTERP_KERNEL::Exception("incompatible field type");
- }
-
- /*!
- Computes the field norm over its support
- on the source side and renormalizes the field on the target side
- so that the norms match.
-
- \f[
- I_{source}=\sum_{i=1}^{n_{source}}V_{i}.|\Phi^{source}_{i}|^2,
- \f]
-
- \f[
- I_{target}=\sum_{i=1}^{n_{target}}V_{i}.|\Phi^{target}_{i}|^2,
- \f]
-
- \f[
- \Phi^{target}:=\Phi^{target}.\sqrt{I_{source}/I_{target}}.
- \f]
-
- */
- void DEC::renormalizeTargetField(bool isWAbs)
- {
- if (_source_group->containsMyRank())
- for (int icomp=0; icomp<_local_field->getField()->getArray()->getNumberOfComponents(); icomp++)
- {
- double total_norm = _local_field->getVolumeIntegral(icomp+1,isWAbs);
- double source_norm = total_norm;
- _comm_interface->broadcast(&source_norm, 1, MPI_DOUBLE, 0,* dynamic_cast<MPIProcessorGroup*>(_union_group)->getComm());
-
- }
- if (_target_group->containsMyRank())
- {
- for (int icomp=0; icomp<_local_field->getField()->getArray()->getNumberOfComponents(); icomp++)
- {
- double total_norm = _local_field->getVolumeIntegral(icomp+1,isWAbs);
- double source_norm=total_norm;
- _comm_interface->broadcast(&source_norm, 1, MPI_DOUBLE, 0,* dynamic_cast<MPIProcessorGroup*>(_union_group)->getComm());
-
- if (fabs(total_norm)>1e-100)
- _local_field->getField()->applyLin(source_norm/total_norm,0.0,icomp+1);
- }
- }
- }
- /*! @} */
-
- bool DEC::isInSourceSide() const
- {
- if(!_source_group)
- return false;
- return _source_group->containsMyRank();
- }
-
- bool DEC::isInTargetSide() const
- {
- if(!_target_group)
- return false;
- return _target_group->containsMyRank();
- }
-
- bool DEC::isInUnion() const
- {
- if(!_union_group)
- return false;
- return _union_group->containsMyRank();
- }
-
- void DEC::compareFieldAndMethod() const throw(INTERP_KERNEL::Exception)
- {
- if (_local_field)
- {
- TypeOfField entity = _local_field->getField()->getTypeOfField();
- if ( getMethod() == "P0" )
- {
- if ( entity != ON_CELLS )
- throw INTERP_KERNEL::Exception("Field support and interpolation method mismatch."
- " For P0 interpolation, field must be on MED_CELL's");
- }
- else if ( getMethod() == "P1" )
- {
- if ( entity != ON_NODES )
- throw INTERP_KERNEL::Exception("Field support and interpolation method mismatch."
- " For P1 interpolation, field must be on MED_NODE's");
- }
- else if ( getMethod() == "P1d" )
- {
- if ( entity != ON_CELLS )
- throw INTERP_KERNEL::Exception("Field support and interpolation method mismatch."
- " For P1d interpolation, field must be on MED_CELL's");
- if ( _target_group->containsMyRank() )
- throw INTERP_KERNEL::Exception("Projection to P1d field not supported");
- }
- else
- {
- throw INTERP_KERNEL::Exception("Unknown interpolation method. Possible methods: P0, P1, P1d");
- }
- }
- }
-
- /*!
- If way==true, source procs call sendData() and target procs call recvData().
- if way==false, it's the other way round.
- */
- void DEC::sendRecvData(bool way)
- {
- if(!isInUnion())
- return;
- if(isInSourceSide())
- {
- if(way)
- sendData();
- else
- recvData();
- }
- else if(isInTargetSide())
- {
- if(way)
- recvData();
- else
- sendData();
- }
}
}
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef __DEC_HXX__
#include "NormalizedUnstructuredMesh.hxx"
#include "DECOptions.hxx"
-#include <set>
-
-namespace ICoCo
-{
- class Field;
-}
-
namespace ParaMEDMEM
{
- class ProcessorGroup;
- class ParaFIELD;
class CommInterface;
class DEC : public DECOptions
{
public:
- DEC():_local_field(0) { }
- DEC(ProcessorGroup& source_group, ProcessorGroup& target_group);
- DEC(const std::set<int>& src_ids, const std::set<int>& trg_ids,
- const MPI_Comm& world_comm=MPI_COMM_WORLD);
- void setNature(NatureOfField nature);
- void attachLocalField( MEDCouplingFieldDouble* field);
- void attachLocalField(const ParaFIELD* field, bool ownPt=false);
- void attachLocalField(const ICoCo::Field* field);
-
- virtual void prepareSourceDE() = 0;
- virtual void prepareTargetDE() = 0;
- virtual void recvData() = 0;
- virtual void sendData() = 0;
- void sendRecvData(bool way=true);
virtual void synchronize() = 0;
+ virtual void sendRecvData(bool way=true) = 0;
virtual ~DEC();
- virtual void computeProcGroup() { }
- void renormalizeTargetField(bool isWAbs);
- //
- ProcessorGroup *getSourceGrp() const { return _source_group; }
- ProcessorGroup *getTargetGrp() const { return _target_group; }
- bool isInSourceSide() const;
- bool isInTargetSide() const;
- bool isInUnion() const;
- protected:
- void compareFieldAndMethod() const throw(INTERP_KERNEL::Exception);
protected:
- const ParaFIELD* _local_field;
- //! Processor group representing the union of target and source processors
- ProcessorGroup* _union_group;
- ProcessorGroup* _source_group;
- ProcessorGroup* _target_group;
-
const CommInterface* _comm_interface;
- bool _owns_field;
- bool _owns_groups;
- private:
- ICoCo::Field* _icoco_field;
};
}
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef __DECOPTIONS_HXX__
--- /dev/null
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+//
+// 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
+//
+
+#include "DisjointDEC.hxx"
+#include "CommInterface.hxx"
+#include "Topology.hxx"
+#include "BlockTopology.hxx"
+#include "ComponentTopology.hxx"
+#include "ParaFIELD.hxx"
+#include "ParaMESH.hxx"
+#include "ICoCoField.hxx"
+#include "ICoCoMEDField.hxx"
+#include "ICoCoTrioField.hxx"
+#include "MPIProcessorGroup.hxx"
+
+#include <cmath>
+
+/*! \defgroup dec DEC
+ *
+ * \section decintroduction Introduction
+ *
+ * Interface class for creation of a link between two
+ * processor groups for exhanging mesh or field data.
+ * The \c DEC is defined by attaching a field on the receiving or on the
+ * sending side.
+ * On top of attaching a \c ParaMEDMEM::FIELD, it is possible to
+ * attach a ICoCo::Field. This class is an abstract class that enables
+ * coupling of codes that respect the ICoCo interface \ref icoco. It has two implementations:
+ * one for codes that express their fields as \ref medoupling fields (ICoCo::MEDField) and one
+ * for codes that express their fields as Trio/U fields.
+ *
+ * \section dec_options DEC Options
+ * Options supported by \c DEC objects are
+ *
+ * <TABLE BORDER=1 >
+ * <TR><TD>Option</TD><TD>Description</TD><TD>Default value</TD></TR>
+ * <TR><TD>ForcedRenormalization</TD><TD>After receiving data, the target field is renormalized so that L2-norms of the source and target fields match.</TD><TD> false </TD></TR>
+ *</TABLE>
+
+
+ The following code excerpt shows how to set options for an object that inherits from \c DEC :
+
+ \code
+ InterpKernelDEC dec(source_group,target_group);
+ dec.setOptions("ForcedRenormalization",true);
+ dec.attachLocalField(field);
+ dec.synchronize();
+ if (source_group.containsMyRank())
+ dec.sendData();
+ else
+ dec.recvData();
+ \endcode
+*/
+
+namespace ParaMEDMEM
+{
+
+
+ /*! \addtogroup dec
+ @{
+ */
+ DisjointDEC::DisjointDEC(ProcessorGroup& source_group, ProcessorGroup& target_group):_local_field(0),
+ _source_group(&source_group),
+ _target_group(&target_group),
+ _owns_field(false),
+ _owns_groups(false),
+ _icoco_field(0)
+ {
+ _union_group = source_group.fuse(target_group);
+ }
+
+ DisjointDEC::DisjointDEC(const std::set<int>& source_ids, const std::set<int>& target_ids, const MPI_Comm& world_comm):_local_field(0),
+ _owns_field(false),
+ _owns_groups(true),
+ _icoco_field(0)
+ {
+ ParaMEDMEM::CommInterface comm;
+ // Create the list of procs including source and target
+ std::set<int> union_ids; // source and target ids in world_comm
+ union_ids.insert(source_ids.begin(),source_ids.end());
+ union_ids.insert(target_ids.begin(),target_ids.end());
+ if(union_ids.size()!=(source_ids.size()+target_ids.size()))
+ throw INTERP_KERNEL::Exception("DisjointDEC constructor : source_ids and target_ids overlap partially or fully. This type of DEC does not support it ! OverlapDEC class could be the solution !");
+ int* union_ranks_world=new int[union_ids.size()]; // ranks of sources and targets in world_comm
+ std::copy(union_ids.begin(), union_ids.end(), union_ranks_world);
+
+ // Create a communicator on these procs
+ MPI_Group union_group,world_group;
+ comm.commGroup(world_comm,&world_group);
+ comm.groupIncl(world_group,union_ids.size(),union_ranks_world,&union_group);
+ MPI_Comm union_comm;
+ comm.commCreate(world_comm,union_group,&union_comm);
+ delete[] union_ranks_world;
+
+ if (union_comm==MPI_COMM_NULL)
+ { // This process is not in union
+ _source_group=0;
+ _target_group=0;
+ _union_group=0;
+ return;
+ }
+
+ // Translate source_ids and target_ids from world_comm to union_comm
+ int* source_ranks_world=new int[source_ids.size()]; // ranks of sources in world_comm
+ std::copy(source_ids.begin(), source_ids.end(),source_ranks_world);
+ int* source_ranks_union=new int[source_ids.size()]; // ranks of sources in union_comm
+ int* target_ranks_world=new int[target_ids.size()]; // ranks of targets in world_comm
+ std::copy(target_ids.begin(), target_ids.end(),target_ranks_world);
+ int* target_ranks_union=new int[target_ids.size()]; // ranks of targets in union_comm
+ MPI_Group_translate_ranks(world_group,source_ids.size(),source_ranks_world,union_group,source_ranks_union);
+ MPI_Group_translate_ranks(world_group,target_ids.size(),target_ranks_world,union_group,target_ranks_union);
+ std::set<int> source_ids_union;
+ for (int i=0;i<(int)source_ids.size();i++)
+ source_ids_union.insert(source_ranks_union[i]);
+ std::set<int> target_ids_union;
+ for (int i=0;i<(int)target_ids.size();i++)
+ target_ids_union.insert(target_ranks_union[i]);
+ delete [] source_ranks_world;
+ delete [] source_ranks_union;
+ delete [] target_ranks_world;
+ delete [] target_ranks_union;
+
+ // Create the MPIProcessorGroups
+ _source_group = new MPIProcessorGroup(comm,source_ids_union,union_comm);
+ _target_group = new MPIProcessorGroup(comm,target_ids_union,union_comm);
+ _union_group = _source_group->fuse(*_target_group);
+
+ }
+
+ DisjointDEC::~DisjointDEC()
+ {
+ if(_owns_field)
+ delete _local_field;
+ if(_owns_groups)
+ {
+ delete _source_group;
+ delete _target_group;
+ }
+ delete _icoco_field;
+ delete _union_group;
+ }
+
+ void DisjointDEC::setNature(NatureOfField nature)
+ {
+ if(_local_field)
+ _local_field->getField()->setNature(nature);
+ }
+
+ /*! Attaches a local field to a DEC.
+ If the processor is on the receiving end of the DEC, the field
+ will be updated by a recvData() call.
+ Reversely, if the processor is on the sending end, the field will be read, possibly transformed, and sent appropriately to the other side.
+ */
+ void DisjointDEC::attachLocalField(const ParaFIELD* field, bool ownPt)
+ {
+ if(!isInUnion())
+ return ;
+ if(_owns_field)
+ delete _local_field;
+ _local_field=field;
+ _owns_field=ownPt;
+ _comm_interface=&(field->getTopology()->getProcGroup()->getCommInterface());
+ compareFieldAndMethod();
+ }
+
+ /*! Attaches a local field to a DEC. The method will test whether the processor
+ is on the source or the target side and will associate the mesh underlying the
+ field to the local side.
+
+ If the processor is on the receiving end of the DEC, the field
+ will be updated by a recvData() call.
+ Reversely, if the processor is on the sending end, the field will be read, possibly transformed,
+ and sent appropriately to the other side.
+ */
+
+ void DisjointDEC::attachLocalField(MEDCouplingFieldDouble* field)
+ {
+ if(!isInUnion())
+ return ;
+ ProcessorGroup* local_group;
+ if (_source_group->containsMyRank())
+ local_group=_source_group;
+ else if (_target_group->containsMyRank())
+ local_group=_target_group;
+ else
+ throw INTERP_KERNEL::Exception("Invalid procgroup for field attachment to DEC");
+ ParaMESH *paramesh=new ParaMESH((MEDCouplingPointSet *)field->getMesh(),*local_group,field->getMesh()->getName());
+ ParaFIELD *tmp=new ParaFIELD(field, paramesh, *local_group);
+ tmp->setOwnSupport(true);
+ attachLocalField(tmp,true);
+ //_comm_interface=&(local_group->getCommInterface());
+ }
+
+ /*!
+ Attaches a local field to a DEC.
+ If the processor is on the receiving end of the DEC, the field
+ will be updated by a recvData() call.
+ Reversely, if the processor is on the sending end, the field will be read, possibly transformed, and sent appropriately to the other side.
+ The field type is a generic ICoCo Field, so that the DEC can couple a number of different fields :
+ - a ICoCo::MEDField, that is created from a MEDCoupling structure
+ - a ICOCo::TrioField, that is created from tables extracted from a TRIO-U structure.
+
+ */
+ void DisjointDEC::attachLocalField(const ICoCo::Field* field)
+ {
+ if(!isInUnion())
+ return ;
+ const ICoCo::MEDField* medfield=dynamic_cast<const ICoCo::MEDField*> (field);
+ if(medfield !=0)
+ {
+ attachLocalField(medfield->getField());
+ return;
+ }
+ const ICoCo::TrioField* triofield=dynamic_cast<const ICoCo::TrioField*> (field);
+ if (triofield !=0)
+ {
+ ProcessorGroup* localgroup;
+ if (_source_group->containsMyRank())
+ localgroup=_source_group;
+ else
+ localgroup=_target_group;
+ delete _icoco_field;
+
+ _icoco_field=new ICoCo::MEDField(*const_cast<ICoCo::TrioField* >(triofield));
+ attachLocalField(_icoco_field);
+ return;
+ }
+ throw INTERP_KERNEL::Exception("incompatible field type");
+ }
+
+ /*!
+ Computes the field norm over its support
+ on the source side and renormalizes the field on the target side
+ so that the norms match.
+
+ \f[
+ I_{source}=\sum_{i=1}^{n_{source}}V_{i}.|\Phi^{source}_{i}|^2,
+ \f]
+
+ \f[
+ I_{target}=\sum_{i=1}^{n_{target}}V_{i}.|\Phi^{target}_{i}|^2,
+ \f]
+
+ \f[
+ \Phi^{target}:=\Phi^{target}.\sqrt{I_{source}/I_{target}}.
+ \f]
+
+ */
+ void DisjointDEC::renormalizeTargetField(bool isWAbs)
+ {
+ if (_source_group->containsMyRank())
+ for (int icomp=0; icomp<_local_field->getField()->getArray()->getNumberOfComponents(); icomp++)
+ {
+ double total_norm = _local_field->getVolumeIntegral(icomp+1,isWAbs);
+ double source_norm = total_norm;
+ _comm_interface->broadcast(&source_norm, 1, MPI_DOUBLE, 0,* dynamic_cast<MPIProcessorGroup*>(_union_group)->getComm());
+
+ }
+ if (_target_group->containsMyRank())
+ {
+ for (int icomp=0; icomp<_local_field->getField()->getArray()->getNumberOfComponents(); icomp++)
+ {
+ double total_norm = _local_field->getVolumeIntegral(icomp+1,isWAbs);
+ double source_norm=total_norm;
+ _comm_interface->broadcast(&source_norm, 1, MPI_DOUBLE, 0,* dynamic_cast<MPIProcessorGroup*>(_union_group)->getComm());
+
+ if (fabs(total_norm)>1e-100)
+ _local_field->getField()->applyLin(source_norm/total_norm,0.0,icomp+1);
+ }
+ }
+ }
+ /*! @} */
+
+ bool DisjointDEC::isInSourceSide() const
+ {
+ if(!_source_group)
+ return false;
+ return _source_group->containsMyRank();
+ }
+
+ bool DisjointDEC::isInTargetSide() const
+ {
+ if(!_target_group)
+ return false;
+ return _target_group->containsMyRank();
+ }
+
+ bool DisjointDEC::isInUnion() const
+ {
+ if(!_union_group)
+ return false;
+ return _union_group->containsMyRank();
+ }
+
+ void DisjointDEC::compareFieldAndMethod() const throw(INTERP_KERNEL::Exception)
+ {
+ if (_local_field)
+ {
+ TypeOfField entity = _local_field->getField()->getTypeOfField();
+ if ( getMethod() == "P0" )
+ {
+ if ( entity != ON_CELLS )
+ throw INTERP_KERNEL::Exception("Field support and interpolation method mismatch."
+ " For P0 interpolation, field must be on MED_CELL's");
+ }
+ else if ( getMethod() == "P1" )
+ {
+ if ( entity != ON_NODES )
+ throw INTERP_KERNEL::Exception("Field support and interpolation method mismatch."
+ " For P1 interpolation, field must be on MED_NODE's");
+ }
+ else if ( getMethod() == "P1d" )
+ {
+ if ( entity != ON_CELLS )
+ throw INTERP_KERNEL::Exception("Field support and interpolation method mismatch."
+ " For P1d interpolation, field must be on MED_CELL's");
+ if ( _target_group->containsMyRank() )
+ throw INTERP_KERNEL::Exception("Projection to P1d field not supported");
+ }
+ else
+ {
+ throw INTERP_KERNEL::Exception("Unknown interpolation method. Possible methods: P0, P1, P1d");
+ }
+ }
+ }
+
+ /*!
+ If way==true, source procs call sendData() and target procs call recvData().
+ if way==false, it's the other way round.
+ */
+ void DisjointDEC::sendRecvData(bool way)
+ {
+ if(!isInUnion())
+ return;
+ if(isInSourceSide())
+ {
+ if(way)
+ sendData();
+ else
+ recvData();
+ }
+ else if(isInTargetSide())
+ {
+ if(way)
+ recvData();
+ else
+ sendData();
+ }
+ }
+}
--- /dev/null
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+//
+// 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
+//
+
+#ifndef __DISJOINTDEC_HXX__
+#define __DISJOINTDEC_HXX__
+
+#include "MEDCouplingFieldDouble.hxx"
+#include "NormalizedUnstructuredMesh.hxx"
+#include "DEC.hxx"
+
+#include <mpi.h>
+#include <set>
+
+namespace ICoCo
+{
+ class Field;
+}
+
+namespace ParaMEDMEM
+{
+ class ProcessorGroup;
+ class ParaFIELD;
+
+ class DisjointDEC : public DEC
+ {
+ public:
+ DisjointDEC():_local_field(0) { }
+ DisjointDEC(ProcessorGroup& source_group, ProcessorGroup& target_group);
+ DisjointDEC(const std::set<int>& src_ids, const std::set<int>& trg_ids,
+ const MPI_Comm& world_comm=MPI_COMM_WORLD);
+ void setNature(NatureOfField nature);
+ void attachLocalField( MEDCouplingFieldDouble* field);
+ void attachLocalField(const ParaFIELD* field, bool ownPt=false);
+ void attachLocalField(const ICoCo::Field* field);
+
+ virtual void prepareSourceDE() = 0;
+ virtual void prepareTargetDE() = 0;
+ virtual void recvData() = 0;
+ virtual void sendData() = 0;
+ void sendRecvData(bool way=true);
+ virtual void synchronize() = 0;
+ virtual ~DisjointDEC();
+ virtual void computeProcGroup() { }
+ void renormalizeTargetField(bool isWAbs);
+ //
+ ProcessorGroup *getSourceGrp() const { return _source_group; }
+ ProcessorGroup *getTargetGrp() const { return _target_group; }
+ bool isInSourceSide() const;
+ bool isInTargetSide() const;
+ bool isInUnion() const;
+ protected:
+ void compareFieldAndMethod() const throw(INTERP_KERNEL::Exception);
+ protected:
+ const ParaFIELD* _local_field;
+ //! Processor group representing the union of target and source processors
+ ProcessorGroup* _union_group;
+ ProcessorGroup* _source_group;
+ ProcessorGroup* _target_group;
+
+ const CommInterface* _comm_interface;
+ bool _owns_field;
+ bool _owns_groups;
+ private:
+ ICoCo::Field* _icoco_field;
+ };
+}
+
+#endif
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <mpi.h>
INTERP_KERNEL::DirectedBoundingBox dbb;
double* distant_bb = _domain_bounding_boxes+rank*dbb.dataSize(_local_cell_mesh_space_dim);
dbb.setData(distant_bb);
- _local_cell_mesh->giveElemsInBoundingBox(dbb,getBoundingBoxAdjustment(),elems);
+ _local_cell_mesh->getCellsInBoundingBox(dbb,getBoundingBoxAdjustment(),elems);
#else
double* distant_bb = _domain_bounding_boxes+rank*2*_local_cell_mesh_space_dim;
- _local_cell_mesh->giveElemsInBoundingBox(distant_bb,getBoundingBoxAdjustment(),elems);
+ _local_cell_mesh->getCellsInBoundingBox(distant_bb,getBoundingBoxAdjustment(),elems);
#endif
DataArrayInt *distant_ids_send;
// First stage : exchanging sizes
// ------------------------------
+ vector<double> tinyInfoLocalD,tinyInfoDistantD(1);//not used for the moment
vector<int> tinyInfoLocal,tinyInfoDistant;
vector<string> tinyInfoLocalS;
//Getting tiny info of local mesh to allow the distant proc to initialize and allocate
//the transmitted mesh.
- local_mesh->getTinySerializationInformation(tinyInfoLocal,tinyInfoLocalS);
+ local_mesh->getTinySerializationInformation(tinyInfoLocalD,tinyInfoLocal,tinyInfoLocalS);
tinyInfoLocal.push_back(distant_ids_send->getNumberOfTuples());
tinyInfoDistant.resize(tinyInfoLocal.size());
std::fill(tinyInfoDistant.begin(),tinyInfoDistant.end(),0);
//
distant_mesh=distant_mesh_tmp;
//finish unserialization
- distant_mesh->unserialization(tinyInfoDistant,v1Distant,v2Distant,unusedTinyDistantSts);
+ distant_mesh->unserialization(tinyInfoDistantD,tinyInfoDistant,v1Distant,v2Distant,unusedTinyDistantSts);
//
distant_ids_recv=new int[tinyInfoDistant.back()];
comm_interface.sendRecv((void *)distant_ids_send->getConstPointer(),tinyInfoLocal.back(), MPI_INT,
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef __ELEMENTLOCATOR_HXX__
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <mpi.h>
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef __EXPLICITCOINCIDENTDEC_HXX__
#define __EXPLICITCOINCIDENTDEC_HXX__
-#include "DEC.hxx"
+#include "DisjointDEC.hxx"
#include "ExplicitMapping.hxx"
#include "ExplicitTopology.hxx"
{
class BlockTopology;
- class ExplicitCoincidentDEC : public DEC
+ class ExplicitCoincidentDEC : public DisjointDEC
{
public:
ExplicitCoincidentDEC();
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef __EXPLICITMAPPING_HXX__
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "CommInterface.hxx"
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef __EXPLICITTOPOLOGY_HXX__
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// ICoCo file common to several codes
-// ICoCoField.cpp
+// ICoCoField.cxx
// version 1.2 10/05/2010
#include <ICoCoField.hxx>
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+//
+// 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
+//
+
// ICoCo file common to several codes
// ICoCoField.h
// version 1.2 10/05/2010
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "ICoCoMEDField.hxx"
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef __ICOCOMEDFIELD_HXX__
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// ICoCo file common to several codes
-// ICoCoTrioField.cpp
+// ICoCoTrioField.cxx
// version 1.2 10/05/2010
#include <ICoCoTrioField.hxx>
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// ICoCo file common to several codes
// ICoCoTrioField.h
// version 1.2 10/05/2010
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <mpi.h>
*/
InterpKernelDEC::InterpKernelDEC(ProcessorGroup& source_group, ProcessorGroup& target_group):
- DEC(source_group, target_group),_interpolation_matrix(0)
+ DisjointDEC(source_group, target_group),_interpolation_matrix(0)
{
}
InterpKernelDEC::InterpKernelDEC(const std::set<int>& src_ids, const std::set<int>& trg_ids,
- const MPI_Comm& world_comm):DEC(src_ids,trg_ids,world_comm),
+ const MPI_Comm& world_comm):DisjointDEC(src_ids,trg_ids,world_comm),
_interpolation_matrix(0)
{
}
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef __INTERPKERNELDEC_HXX__
#define __INTERPKERNELDEC_HXX__
-#include "DEC.hxx"
+#include "DisjointDEC.hxx"
#include "MxN_Mapping.hxx"
#include "InterpolationOptions.hxx"
{
class InterpolationMatrix;
- class InterpKernelDEC : public DEC, public INTERP_KERNEL::InterpolationOptions
+ class InterpKernelDEC : public DisjointDEC, public INTERP_KERNEL::InterpolationOptions
{
public:
InterpKernelDEC();
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "ParaMESH.hxx"
#include "TranslationRotationMatrix.hxx"
#include "Interpolation.hxx"
#include "Interpolation1D.txx"
-#include "Interpolation2DCurve.txx"
+#include "Interpolation2DCurve.hxx"
#include "Interpolation2D.txx"
-#include "Interpolation3DSurf.txx"
+#include "Interpolation3DSurf.hxx"
#include "Interpolation3D.txx"
#include "MEDCouplingUMesh.hxx"
#include "MEDCouplingNormalizedUnstructuredMesh.txx"
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef __INTERPOLATIONMATRIX_HXX__
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "LinearTimeInterpolator.hxx"
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef __LINEARTIMEINTERPOLATOR_HXX__
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "MPIAccess.hxx"
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef __MPIACCESS_HXX__
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "MPIAccessDEC.hxx"
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef __MPIACCESSDEC_HXX__
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "ProcessorGroup.hxx"
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef __MPIPROCESSORGROUP_HXX__
#define __MPIPROCESSORGROUP_HXX__
+#include "ProcessorGroup.hxx"
+
#include <set>
#include <mpi.h>
namespace ParaMEDMEM
{
- class ProcessorGroup;
class CommInterface;
class MPIProcessorGroup : public ProcessorGroup
-# Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+# 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
ExplicitTopology.hxx\
ParaFIELD.hxx\
DEC.hxx\
+DisjointDEC.hxx\
+OverlapDEC.hxx\
DECOptions.hxx\
MxN_Mapping.hxx\
+OverlapMapping.hxx\
StructuredCoincidentDEC.hxx\
InterpolationMatrix.hxx\
+OverlapInterpolationMatrix.hxx\
InterpKernelDEC.hxx\
ExplicitCoincidentDEC.hxx\
ElementLocator.hxx\
+OverlapElementLocator.hxx\
ExplicitMapping.hxx\
ICoCoField.hxx \
ICoCoMEDField.hxx \
ComponentTopology.cxx\
MPIAccess.cxx \
InterpolationMatrix.cxx\
+OverlapInterpolationMatrix.cxx\
StructuredCoincidentDEC.cxx\
ExplicitCoincidentDEC.cxx\
InterpKernelDEC.cxx\
ElementLocator.cxx\
+OverlapElementLocator.cxx\
MPIAccessDEC.cxx \
TimeInterpolator.cxx \
LinearTimeInterpolator.cxx\
DEC.cxx\
+DisjointDEC.cxx\
+OverlapDEC.cxx\
ExplicitTopology.cxx\
MxN_Mapping.cxx\
+OverlapMapping.cxx\
ICoCoMEDField.cxx\
ICoCoField.cxx\
ICoCoTrioField.cxx\
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "CommInterface.hxx"
namespace ParaMEDMEM
{
+ MxN_Mapping::MxN_Mapping()
+ {
+ }
+
MxN_Mapping::MxN_Mapping(const ProcessorGroup& source_group, const ProcessorGroup& target_group,const DECOptions& dec_options)
: DECOptions(dec_options),_union_group(source_group.fuse(target_group))
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef __MXN_MAPPING_HXX__
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <mpi.h>
\c NonCoincidentDEC enables nonconservative remapping of fields
between two parallel codes.
The computation is possible for 3D meshes and 2D meshes.
- It is not available for 3D surfaces. The computation enables fast parallel localization, based on the
- FVM library. The computation is based on a point in element search, followed
+ It is not available for 3D surfaces. The computation enables fast parallel localization, and is based on a point in element search, followed
by a field evaluation at the point location. Thus, it is typically
faster than the \ref interpkerneldec which gives a \ref conservativeremapping.
It is particularly true for the initialisation phase (synchronize)
@{
*/
- /*! Constructor of a non coincident DEC with
+ /*! Constructor of a non coincident \ref dec with
* a source group on which lies a field lying on a mesh and a
* target group on which lies a mesh.
*
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef __NONCOINCIDENTDEC_HXX__
--- /dev/null
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+//
+// 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
+//
+
+#include "OverlapDEC.hxx"
+#include "CommInterface.hxx"
+#include "ParaFIELD.hxx"
+#include "MPIProcessorGroup.hxx"
+#include "OverlapElementLocator.hxx"
+#include "OverlapInterpolationMatrix.hxx"
+/*!
+ \defgroup overlapdec OverlapDEC
+ The \c OverlapDEC enables the \ref InterpKerRemapGlobal "conservative remapping" of fields between two parallel codes. This remapping is based on the computation of intersection volumes on a \b same \b processor \b group. On this processor group are defined two field-templates called A and B. The computation is possible for 3D meshes, 2D meshes, 3D-surface meshes, 1D meshes and 2D-curve meshes. Dimensions must be similar for the distribution templates A and B.
+ The main difference with \ref interpkerneldec is that this \ref dec manages 2 field templates on each processor of the processor group (A and B) called source and target.
+ Furthermore all processors in processor group cooperates in global interpolation matrix computation. In this respect \ref InterpKernelIDEC is a specialization of \c OverlapDEC.
+
+ \section ParaMEDMEMOverlapDECAlgorithmDescription Algorithm Description
+
+ Let's consider the following use case that is ran in ParaMEDMEMTest_OverlapDEC.cxx to describes the different steps of the computation. The processor group contains 3 processors.
+ \anchor ParaMEDMEMOverlapDECImgTest1
+ \image html OverlapDEC1.png "Example showing the use case in order to explain the different steps."
+
+ \subsection ParaMEDMEMOverlapDECAlgoStep1 Step 1 : Bounding box exchange and global interaction between procs computation.
+
+ In order to reduce as much as possible the amount of communications between distant processors, every processor computes a bounding box for A and B. Then a AllToAll communication is performed so that
+ every processor can compute the \b global interactions between processor.
+ This computation leads every processor to compute the same global TODO list expressed as a list of pair. A pair (x,y) means that proc \b x fieldtemplate A can interact with fieltemplate B of proc \b y because the two bounding boxes interact.
+ In the \ref ParaMEDMEMOverlapDECImgTest1 "example above" this computation leads to the following a \b global TODO list :
+
+ \b (0,0),(0,1),(1,0),(1,2),(2,0),(2,1),(2,2)
+
+ Here the pair (0,2) does not appear because the bounding box of fieldtemplateA of proc#2 does not intersect that of fieldtemplate B on proc#0.
+
+ Stage performed by ParaMEDMEM::OverlapElementLocator::computeBoundingBoxes.
+
+ \subsection ParaMEDMEMOverlapDECAlgoStep2 Step 2 : Computation of local TODO list
+
+ Starting from the global interaction previously computed in \ref ParaMEDMEMOverlapDECAlgoStep1 "Step 1", each proc computes the TODO list per proc.
+ The following rules is chosen : a pair (x,y) can be treated by either proc #x or proc #y, in order to reduce the amount of data transfert among
+ processors. The algorithm chosen for load balancing is the following : Each processor has an empty \b local TODO list at the beginning. Then for each pair (k,m) in
+ \b global TODO list, if proc#k has less temporary local list than proc#m pair, (k,m) is added to temparary local TODO list of proc#k.
+ If proc#m has less temporary local TODO list than proc#k pair, (k,m) is added to temporary local TODO list of proc#m.
+ If proc#k and proc#m have the same amount of temporary local TODO list pair, (k,m) is added to temporary local TODO list of proc#k.
+
+ In the \ref ParaMEDMEMOverlapDECImgTest1 "example above" this computation leads to the following local TODO list :
+
+ - proc#0 : (0,0)
+ - proc#1 : (0,1),(1,0)
+ - proc#2 : (1,2),(2,0),(2,1),(2,2)
+
+ The algorithm described here is not perfect for this use case, we hope to enhance it soon.
+
+ At this stage each proc knows precisely its \b local TODO list (with regard to interpolation). The \b local TODO list of other procs than local
+ is kept for future computations.
+
+ \subsection ParaMEDMEMOverlapDECAlgoStep3 Step 3 : Matrix echange between procs
+
+ Knowing the \b local TODO list, the aim now is to exchange field-templates between procs. Each proc computes knowing TODO list per
+ proc computed in \ref ParaMEDMEMOverlapDECAlgoStep2 "Step 2" the exchange TODO list :
+
+ In the \ref ParaMEDMEMOverlapDECImgTest1 "example above" the exchange TODO list gives the following results :
+
+ Sending TODO list per proc :
+
+ - proc #0 : Send fieldtemplate A to Proc#1, Send fieldtemplate B to Proc#1, Send fieldtemplate B to Proc#2
+ - Proc #1 : Send fieldtemplate A to Proc#2, Send fieldtemplate B to Proc#2
+ - Proc #2 : No send.
+
+ Receiving TODO list per proc :
+
+ - proc #0 : No receiving
+ - proc #1 : receiving fieldtemplate A from Proc#0, receiving fieldtemplate B from Proc#0
+ - proc #2 : receiving fieldtemplate B from Proc#0, receiving fieldtemplate A from Proc#1, receiving fieldtemplate B from Proc#1
+
+ To avoid as much as possible large volumes of transfers between procs, only relevant parts of meshes are sent. In order for proc#k to send fieldtemplate A to fieldtemplate B
+ of proc #m., proc#k computes the part of mesh A contained in the boundingbox B of proc#m. It implies that the corresponding cellIds or nodeIds of the
+ corresponding part are sent to proc #m too.
+
+ Let's consider the couple (k,m) in the TODO list. This couple is treated by either k or m as seen in \ref ParaMEDMEMOverlapDECAlgoStep2 "here in Step2".
+
+ As will be dealt in Step 6, for final matrix-vector computations, the resulting matrix of the couple (k,m) whereever it is computed (proc #k or proc #m)
+ will be stored in \b proc#m.
+
+ - If proc #k is in charge (performs the matrix computation) for this couple (k,m), target ids (cells or nodes) of the mesh in proc #m are renumbered, because proc #m has seelected a sub mesh of the target mesh to avoid large amounts of data to transfer. In this case as proc #m is ultimately in charge of the matrix, proc #k must keep preciously the
+ source ids needed to be sent to proc#m. No problem will appear for matrix assembling in proc m for source ids because no restriction was done.
+ Concerning source ids to be sent for the matrix-vector computation, proc k will know precisely which source ids field values to send to proc #m.
+ This is embodied by OverlapMapping::keepTracksOfTargetIds in proc m.
+
+ - If proc #m is in charge (performs matrix computation) for this couple (k,m), source ids (cells or nodes) of the mesh in proc #k are renumbered, because proc #k has selected a sub mesh of the source mesh to avoid large amounts of data to transfer. In this case as proc #k is ultimately in charge of the matrix, proc #m receives the source ids
+ from remote proc #k, and thus the matrix is directly correct, no need for renumbering as in \ref ParaMEDMEMOverlapDECAlgoStep5 "Step 5". However proc #k must
+ keep track of the ids sent to proc #m for te matrix-vector computation.
+ This is incarnated by OverlapMapping::keepTracksOfSourceIds in proc k.
+
+ This step is performed in ParaMEDMEM::OverlapElementLocator::exchangeMeshes method.
+
+ \subsection ParaMEDMEMOverlapDECAlgoStep4 Step 4 : Computation of the interpolation matrix
+
+ After mesh exchange in \ref ParaMEDMEMOverlapDECAlgoStep3 "Step3" each processor has all the required information to treat its \b local TODO list computed in
+ \ref ParaMEDMEMOverlapDECAlgoStep2 "Step2". This step is potentially CPU costly, which is why the \b local TODO list per proc is expected to
+ be as well balanced as possible.
+
+ The interpolation is performed as \ref ParaMEDMEM::MEDCouplingRemapper "Remapper" does.
+
+ This operation is performed by OverlapInterpolationMatrix::addContribution method.
+
+ \subsection ParaMEDMEMOverlapDECAlgoStep5 Step 5 : Global matrix construction.
+
+ After having performed the TODO list at the end of \ref ParaMEDMEMOverlapDECAlgoStep4 "Step4" we need to assemble the final matrix.
+
+ The final aim is to have a distributed matrix \f$ M_k \f$ on each proc#k. In order to reduce data exchange during the matrix product process,
+ \f$ M_k \f$ is built using sizeof(Proc group) \c std::vector< \c std::map<int,double> \c >.
+
+ For a proc#k, it is necessary to fetch info of all matrices built in \ref ParaMEDMEMOverlapDECAlgoStep4 "Step4" where the first element in pair (i,j)
+ is equal to k.
+
+ After this step, the matrix repartition is the following after a call to ParaMEDMEM::OverlapMapping::prepare :
+
+ - proc#0 : (0,0),(1,0),(2,0)
+ - proc#1 : (0,1),(2,1)
+ - proc#2 : (1,2),(2,2)
+
+ Tuple (2,1) computed on proc 2 is stored in proc 1 after execution of the function "prepare". This is an example of item 0 in \ref ParaMEDMEMOverlapDECAlgoStep2 "Step2".
+ Tuple (0,1) computed on proc 1 is stored in proc 1 too. This is an example of item 1 in \ref ParaMEDMEMOverlapDECAlgoStep2 "Step2".
+
+ In the end ParaMEDMEM::OverlapMapping::_proc_ids_to_send_vector_st will contain :
+
+ - Proc#0 : 0,1
+ - Proc#1 : 0,2
+ - Proc#2 : 0,1,2
+
+ In the end ParaMEDMEM::OverlapMapping::_proc_ids_to_recv_vector_st will contain :
+
+ - Proc#0 : 0,1,2
+ - Proc#1 : 0,2
+ - Proc#2 : 1,2
+
+ The method in charge to perform this is : ParaMEDMEM::OverlapMapping::prepare.
+*/
+namespace ParaMEDMEM
+{
+ OverlapDEC::OverlapDEC(const std::set<int>& procIds, const MPI_Comm& world_comm):_own_group(true),_interpolation_matrix(0),
+ _source_field(0),_own_source_field(false),
+ _target_field(0),_own_target_field(false)
+ {
+ ParaMEDMEM::CommInterface comm;
+ int *ranks_world=new int[procIds.size()]; // ranks of sources and targets in world_comm
+ std::copy(procIds.begin(),procIds.end(),ranks_world);
+ MPI_Group group,world_group;
+ comm.commGroup(world_comm,&world_group);
+ comm.groupIncl(world_group,procIds.size(),ranks_world,&group);
+ delete [] ranks_world;
+ MPI_Comm theComm;
+ comm.commCreate(world_comm,group,&theComm);
+ comm.groupFree(&group);
+ if(theComm==MPI_COMM_NULL)
+ {
+ _group=0;
+ return ;
+ }
+ std::set<int> idsUnion;
+ for(std::size_t i=0;i<procIds.size();i++)
+ idsUnion.insert(i);
+ _group=new MPIProcessorGroup(comm,idsUnion,theComm);
+ }
+
+ OverlapDEC::~OverlapDEC()
+ {
+ if(_own_group)
+ delete _group;
+ if(_own_source_field)
+ delete _source_field;
+ if(_own_target_field)
+ delete _target_field;
+ delete _interpolation_matrix;
+ }
+
+ void OverlapDEC::sendRecvData(bool way)
+ {
+ if(way)
+ sendData();
+ else
+ recvData();
+ }
+
+ void OverlapDEC::sendData()
+ {
+ _interpolation_matrix->multiply();
+ }
+
+ void OverlapDEC::recvData()
+ {
+ throw INTERP_KERNEL::Exception("Not implemented yet !!!!");
+ //_interpolation_matrix->transposeMultiply();
+ }
+
+ void OverlapDEC::synchronize()
+ {
+ if(!isInGroup())
+ return ;
+ delete _interpolation_matrix;
+ _interpolation_matrix=new OverlapInterpolationMatrix(_source_field,_target_field,*_group,*this,*this);
+ OverlapElementLocator locator(_source_field,_target_field,*_group);
+ locator.copyOptions(*this);
+ locator.exchangeMeshes(*_interpolation_matrix);
+ std::vector< std::pair<int,int> > jobs=locator.getToDoList();
+ std::string srcMeth=locator.getSourceMethod();
+ std::string trgMeth=locator.getTargetMethod();
+ for(std::vector< std::pair<int,int> >::const_iterator it=jobs.begin();it!=jobs.end();it++)
+ {
+ const MEDCouplingPointSet *src=locator.getSourceMesh((*it).first);
+ const DataArrayInt *srcIds=locator.getSourceIds((*it).first);
+ const MEDCouplingPointSet *trg=locator.getTargetMesh((*it).second);
+ const DataArrayInt *trgIds=locator.getTargetIds((*it).second);
+ _interpolation_matrix->addContribution(src,srcIds,srcMeth,(*it).first,trg,trgIds,trgMeth,(*it).second);
+ }
+ _interpolation_matrix->prepare(locator.getProcsInInteraction());
+ _interpolation_matrix->computeDeno();
+ }
+
+ void OverlapDEC::attachSourceLocalField(ParaFIELD *field, bool ownPt)
+ {
+ if(!isInGroup())
+ return ;
+ if(_own_source_field)
+ delete _source_field;
+ _source_field=field;
+ _own_source_field=ownPt;
+ }
+
+ void OverlapDEC::attachTargetLocalField(ParaFIELD *field, bool ownPt)
+ {
+ if(!isInGroup())
+ return ;
+ if(_own_target_field)
+ delete _target_field;
+ _target_field=field;
+ _own_target_field=ownPt;
+ }
+
+ bool OverlapDEC::isInGroup() const
+ {
+ if(!_group)
+ return false;
+ return _group->containsMyRank();
+ }
+}
--- /dev/null
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+//
+// 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
+//
+
+#ifndef __OVERLAPDEC_HXX__
+#define __OVERLAPDEC_HXX__
+
+#include "DEC.hxx"
+#include "InterpolationOptions.hxx"
+
+#include <mpi.h>
+
+namespace ParaMEDMEM
+{
+ class OverlapInterpolationMatrix;
+ class ProcessorGroup;
+ class ParaFIELD;
+
+ class OverlapDEC : public DEC, public INTERP_KERNEL::InterpolationOptions
+ {
+ public:
+ OverlapDEC(const std::set<int>& procIds,const MPI_Comm& world_comm=MPI_COMM_WORLD);
+ virtual ~OverlapDEC();
+ void sendRecvData(bool way=true);
+ void sendData();
+ void recvData();
+ void synchronize();
+ void attachSourceLocalField(ParaFIELD *field, bool ownPt=false);
+ void attachTargetLocalField(ParaFIELD *field, bool ownPt=false);
+ ProcessorGroup *getGrp() { return _group; }
+ bool isInGroup() const;
+ private:
+ bool _own_group;
+ OverlapInterpolationMatrix* _interpolation_matrix;
+ ProcessorGroup *_group;
+ private:
+ ParaFIELD *_source_field;
+ bool _own_source_field;
+ ParaFIELD *_target_field;
+ bool _own_target_field;
+ };
+}
+
+#endif
--- /dev/null
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+//
+// 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
+//
+
+#include "OverlapElementLocator.hxx"
+
+#include <mpi.h>
+#include "CommInterface.hxx"
+#include "Topology.hxx"
+#include "BlockTopology.hxx"
+#include "ParaFIELD.hxx"
+#include "ParaMESH.hxx"
+#include "ProcessorGroup.hxx"
+#include "MPIProcessorGroup.hxx"
+#include "OverlapInterpolationMatrix.hxx"
+#include "MEDCouplingFieldDouble.hxx"
+#include "MEDCouplingFieldDiscretization.hxx"
+#include "DirectedBoundingBox.hxx"
+#include "InterpKernelAutoPtr.hxx"
+
+#include <map>
+#include <set>
+#include <limits>
+
+using namespace std;
+
+namespace ParaMEDMEM
+{
+ OverlapElementLocator::OverlapElementLocator(const ParaFIELD *sourceField, const ParaFIELD *targetField, const ProcessorGroup& group)
+ : _local_source_field(sourceField),
+ _local_target_field(targetField),
+ _local_source_mesh(0),
+ _local_target_mesh(0),
+ _domain_bounding_boxes(0),
+ _group(group)
+ {
+ if(_local_source_field)
+ _local_source_mesh=_local_source_field->getSupport()->getCellMesh();
+ if(_local_target_field)
+ _local_target_mesh=_local_target_field->getSupport()->getCellMesh();
+ _comm=getCommunicator();
+ computeBoundingBoxes();
+ }
+
+ OverlapElementLocator::~OverlapElementLocator()
+ {
+ delete [] _domain_bounding_boxes;
+ }
+
+ const MPI_Comm *OverlapElementLocator::getCommunicator() const
+ {
+ const MPIProcessorGroup* group=static_cast<const MPIProcessorGroup*>(&_group);
+ return group->getComm();
+ }
+
+ void OverlapElementLocator::computeBoundingBoxes()
+ {
+ CommInterface comm_interface=_group.getCommInterface();
+ const MPIProcessorGroup* group=static_cast<const MPIProcessorGroup*> (&_group);
+ _local_space_dim=0;
+ if(_local_source_mesh)
+ _local_space_dim=_local_source_mesh->getSpaceDimension();
+ else
+ _local_space_dim=_local_target_mesh->getSpaceDimension();
+ //
+ const MPI_Comm* comm = group->getComm();
+ int bbSize=2*2*_local_space_dim;//2 (for source/target) 2 (min/max)
+ _domain_bounding_boxes=new double[bbSize*_group.size()];
+ INTERP_KERNEL::AutoPtr<double> minmax=new double[bbSize];
+ //Format minmax : Xmin_src,Xmax_src,Ymin_src,Ymax_src,Zmin_src,Zmax_src,Xmin_trg,Xmax_trg,Ymin_trg,Ymax_trg,Zmin_trg,Zmax_trg
+ if(_local_source_mesh)
+ _local_source_mesh->getBoundingBox(minmax);
+ else
+ {
+ for(int i=0;i<_local_space_dim;i++)
+ {
+ minmax[i*2]=std::numeric_limits<double>::max();
+ minmax[i*2+1]=-std::numeric_limits<double>::max();
+ }
+ }
+ if(_local_target_mesh)
+ _local_target_mesh->getBoundingBox(minmax+2*_local_space_dim);
+ else
+ {
+ for(int i=0;i<_local_space_dim;i++)
+ {
+ minmax[i*2+2*_local_space_dim]=std::numeric_limits<double>::max();
+ minmax[i*2+1+2*_local_space_dim]=-std::numeric_limits<double>::max();
+ }
+ }
+ comm_interface.allGather(minmax, bbSize, MPI_DOUBLE,
+ _domain_bounding_boxes,bbSize, MPI_DOUBLE,
+ *comm);
+
+ // Computation of all pairs needing an interpolation pairs are duplicated now !
+
+ _proc_pairs.clear();//first is source second is target
+ _proc_pairs.resize(_group.size());
+ for(int i=0;i<_group.size();i++)
+ for(int j=0;j<_group.size();j++)
+ {
+ if(intersectsBoundingBox(i,j))
+ _proc_pairs[i].push_back(j);
+ }
+
+ // OK now let's assigning as balanced as possible, job to each proc of group
+ std::vector< std::vector< std::pair<int,int> > > pairsToBeDonePerProc(_group.size());
+ int i=0;
+ for(std::vector< std::vector< int > >::const_iterator it1=_proc_pairs.begin();it1!=_proc_pairs.end();it1++,i++)
+ for(std::vector< int >::const_iterator it2=(*it1).begin();it2!=(*it1).end();it2++)
+ {
+ if(pairsToBeDonePerProc[i].size()<=pairsToBeDonePerProc[*it2].size())//it includes the fact that i==*it2
+ pairsToBeDonePerProc[i].push_back(std::pair<int,int>(i,*it2));
+ else
+ pairsToBeDonePerProc[*it2].push_back(std::pair<int,int>(i,*it2));
+ }
+ //Keeping todo list of current proc. _to_do_list contains a set of pair where at least _group.myRank() appears once.
+ //This proc will be in charge to perform interpolation of any of element of '_to_do_list'
+ //If _group.myRank()==myPair.first, current proc should fetch target mesh of myPair.second (if different from _group.myRank()).
+ //If _group.myRank()==myPair.second, current proc should fetch source mesh of myPair.second.
+
+ int myProcId=_group.myRank();
+ _to_do_list=pairsToBeDonePerProc[myProcId];
+
+ //Feeding now '_procs_to_send'. A same id can appears twice. The second parameter in pair means what to send true=source, false=target
+ _procs_to_send.clear();
+ for(int i=_group.size()-1;i>=0;i--)
+ if(i!=myProcId)
+ {
+ const std::vector< std::pair<int,int> >& anRemoteProcToDoList=pairsToBeDonePerProc[i];
+ for(std::vector< std::pair<int,int> >::const_iterator it=anRemoteProcToDoList.begin();it!=anRemoteProcToDoList.end();it++)
+ {
+ if((*it).first==myProcId)
+ _procs_to_send.push_back(std::pair<int,bool>(i,true));
+ if((*it).second==myProcId)
+ _procs_to_send.push_back(std::pair<int,bool>(i,false));
+ }
+ }
+ }
+
+ /*!
+ * The aim of this method is to perform the communication to get data corresponding to '_to_do_list' attribute.
+ * The principle is the following : if proc n1 and n2 need to perform a cross sending with n1<n2, then n1 will send first and receive then.
+ */
+ void OverlapElementLocator::exchangeMeshes(OverlapInterpolationMatrix& matrix)
+ {
+ int myProcId=_group.myRank();
+ //starting to receive every procs whose id is lower than myProcId.
+ std::vector< std::pair<int,int> > toDoListForFetchRemaining;
+ for(std::vector< std::pair<int,int> >::const_iterator it=_to_do_list.begin();it!=_to_do_list.end();it++)
+ {
+ if((*it).first!=(*it).second)
+ {
+ if((*it).first==myProcId)
+ {
+ if((*it).second<myProcId)
+ receiveRemoteMesh((*it).second,false);
+ else
+ toDoListForFetchRemaining.push_back(std::pair<int,int>((*it).first,(*it).second));
+ }
+ else
+ {//(*it).second==myProcId
+ if((*it).first<myProcId)
+ receiveRemoteMesh((*it).first,true);
+ else
+ toDoListForFetchRemaining.push_back(std::pair<int,int>((*it).first,(*it).second));
+ }
+ }
+ }
+ //sending source or target mesh to remote procs
+ for(std::vector< std::pair<int,bool> >::const_iterator it2=_procs_to_send.begin();it2!=_procs_to_send.end();it2++)
+ sendLocalMeshTo((*it2).first,(*it2).second,matrix);
+ //fetching remaining meshes
+ for(std::vector< std::pair<int,int> >::const_iterator it=toDoListForFetchRemaining.begin();it!=toDoListForFetchRemaining.end();it++)
+ {
+ if((*it).first!=(*it).second)
+ {
+ if((*it).first==myProcId)
+ receiveRemoteMesh((*it).second,false);
+ else//(*it).second==myProcId
+ receiveRemoteMesh((*it).first,true);
+ }
+ }
+ }
+
+ std::string OverlapElementLocator::getSourceMethod() const
+ {
+ return _local_source_field->getField()->getDiscretization()->getStringRepr();
+ }
+
+ std::string OverlapElementLocator::getTargetMethod() const
+ {
+ return _local_target_field->getField()->getDiscretization()->getStringRepr();
+ }
+
+ const MEDCouplingPointSet *OverlapElementLocator::getSourceMesh(int procId) const
+ {
+ int myProcId=_group.myRank();
+ if(myProcId==procId)
+ return _local_source_mesh;
+ std::pair<int,bool> p(procId,true);
+ std::map<std::pair<int,bool>, MEDCouplingAutoRefCountObjectPtr< MEDCouplingPointSet > >::const_iterator it=_remote_meshes.find(p);
+ return (*it).second;
+ }
+
+ const DataArrayInt *OverlapElementLocator::getSourceIds(int procId) const
+ {
+ int myProcId=_group.myRank();
+ if(myProcId==procId)
+ return 0;
+ std::pair<int,bool> p(procId,true);
+ std::map<std::pair<int,bool>, MEDCouplingAutoRefCountObjectPtr< DataArrayInt > >::const_iterator it=_remote_elems.find(p);
+ return (*it).second;
+ }
+
+ const MEDCouplingPointSet *OverlapElementLocator::getTargetMesh(int procId) const
+ {
+ int myProcId=_group.myRank();
+ if(myProcId==procId)
+ return _local_target_mesh;
+ std::pair<int,bool> p(procId,false);
+ std::map<std::pair<int,bool>, MEDCouplingAutoRefCountObjectPtr< MEDCouplingPointSet > >::const_iterator it=_remote_meshes.find(p);
+ return (*it).second;
+ }
+
+ const DataArrayInt *OverlapElementLocator::getTargetIds(int procId) const
+ {
+ int myProcId=_group.myRank();
+ if(myProcId==procId)
+ return 0;
+ std::pair<int,bool> p(procId,false);
+ std::map<std::pair<int,bool>, MEDCouplingAutoRefCountObjectPtr< DataArrayInt > >::const_iterator it=_remote_elems.find(p);
+ return (*it).second;
+ }
+
+ bool OverlapElementLocator::intersectsBoundingBox(int isource, int itarget) const
+ {
+ const double *source_bb=_domain_bounding_boxes+isource*2*2*_local_space_dim;
+ const double *target_bb=_domain_bounding_boxes+itarget*2*2*_local_space_dim+2*_local_space_dim;
+
+ for (int idim=0; idim < _local_space_dim; idim++)
+ {
+ const double eps = -1e-12;//tony to change
+ bool intersects = (target_bb[idim*2]<source_bb[idim*2+1]+eps)
+ && (source_bb[idim*2]<target_bb[idim*2+1]+eps);
+ if (!intersects)
+ return false;
+ }
+ return true;
+ }
+
+ /*!
+ * This methods sends local source if 'sourceOrTarget'==True to proc 'procId'.
+ * This methods sends local target if 'sourceOrTarget'==False to proc 'procId'.
+ *
+ * This method prepares the matrix too, for matrix assembling and future matrix-vector computation.
+ */
+ void OverlapElementLocator::sendLocalMeshTo(int procId, bool sourceOrTarget, OverlapInterpolationMatrix& matrix) const
+ {
+ vector<int> elems;
+ //int myProcId=_group.myRank();
+ const double *distant_bb=0;
+ MEDCouplingPointSet *local_mesh=0;
+ const ParaFIELD *field=0;
+ if(sourceOrTarget)//source for local but target for distant
+ {
+ distant_bb=_domain_bounding_boxes+procId*2*2*_local_space_dim+2*_local_space_dim;
+ local_mesh=_local_source_mesh;
+ field=_local_source_field;
+ }
+ else//target for local but source for distant
+ {
+ distant_bb=_domain_bounding_boxes+procId*2*2*_local_space_dim;
+ local_mesh=_local_target_mesh;
+ field=_local_target_field;
+ }
+ local_mesh->getCellsInBoundingBox(distant_bb,getBoundingBoxAdjustment(),elems);
+ DataArrayInt *idsToSend;
+ MEDCouplingPointSet *send_mesh=static_cast<MEDCouplingPointSet *>(field->getField()->buildSubMeshData(&elems[0],&elems[elems.size()],idsToSend));
+ if(sourceOrTarget)
+ matrix.keepTracksOfSourceIds(procId,idsToSend);//Case#1 in Step2 of main algorithm.
+ else
+ matrix.keepTracksOfTargetIds(procId,idsToSend);//Case#0 in Step2 of main algorithm.
+ sendMesh(procId,send_mesh,idsToSend);
+ send_mesh->decrRef();
+ idsToSend->decrRef();
+ }
+
+ /*!
+ * This method recieves source remote mesh on proc 'procId' if sourceOrTarget==True
+ * This method recieves target remote mesh on proc 'procId' if sourceOrTarget==False
+ */
+ void OverlapElementLocator::receiveRemoteMesh(int procId, bool sourceOrTarget)
+ {
+ DataArrayInt *da=0;
+ MEDCouplingPointSet *m=0;
+ receiveMesh(procId,m,da);
+ std::pair<int,bool> p(procId,sourceOrTarget);
+ _remote_meshes[p]=m;
+ _remote_elems[p]=da;
+ }
+
+ void OverlapElementLocator::sendMesh(int procId, const MEDCouplingPointSet *mesh, const DataArrayInt *idsToSend) const
+ {
+ CommInterface comInterface=_group.getCommInterface();
+ // First stage : exchanging sizes
+ vector<double> tinyInfoLocalD;//tinyInfoLocalD not used for the moment
+ vector<int> tinyInfoLocal;
+ vector<string> tinyInfoLocalS;
+ mesh->getTinySerializationInformation(tinyInfoLocalD,tinyInfoLocal,tinyInfoLocalS);
+ const MPI_Comm *comm=getCommunicator();
+ //
+ int lgth[2];
+ lgth[0]=tinyInfoLocal.size();
+ lgth[1]=idsToSend->getNbOfElems();
+ comInterface.send(&lgth,2,MPI_INT,procId,1140,*_comm);
+ comInterface.send(&tinyInfoLocal[0],tinyInfoLocal.size(),MPI_INT,procId,1141,*comm);
+ //
+ DataArrayInt *v1Local=0;
+ DataArrayDouble *v2Local=0;
+ mesh->serialize(v1Local,v2Local);
+ comInterface.send(v1Local->getPointer(),v1Local->getNbOfElems(),MPI_INT,procId,1142,*comm);
+ comInterface.send(v2Local->getPointer(),v2Local->getNbOfElems(),MPI_DOUBLE,procId,1143,*comm);
+ //finished for mesh, ids now
+ comInterface.send((int *)idsToSend->getConstPointer(),lgth[1],MPI_INT,procId,1144,*comm);
+ //
+ v1Local->decrRef();
+ v2Local->decrRef();
+ }
+
+ void OverlapElementLocator::receiveMesh(int procId, MEDCouplingPointSet* &mesh, DataArrayInt *&ids) const
+ {
+ int lgth[2];
+ MPI_Status status;
+ const MPI_Comm *comm=getCommunicator();
+ CommInterface comInterface=_group.getCommInterface();
+ comInterface.recv(lgth,2,MPI_INT,procId,1140,*_comm,&status);
+ std::vector<int> tinyInfoDistant(lgth[0]);
+ ids=DataArrayInt::New();
+ ids->alloc(lgth[1],1);
+ comInterface.recv(&tinyInfoDistant[0],lgth[0],MPI_INT,procId,1141,*comm,&status);
+ mesh=MEDCouplingPointSet::BuildInstanceFromMeshType((MEDCouplingMeshType)tinyInfoDistant[0]);
+ std::vector<std::string> unusedTinyDistantSts;
+ vector<double> tinyInfoDistantD(1);//tinyInfoDistantD not used for the moment
+ DataArrayInt *v1Distant=DataArrayInt::New();
+ DataArrayDouble *v2Distant=DataArrayDouble::New();
+ mesh->resizeForUnserialization(tinyInfoDistant,v1Distant,v2Distant,unusedTinyDistantSts);
+ comInterface.recv(v1Distant->getPointer(),v1Distant->getNbOfElems(),MPI_INT,procId,1142,*comm,&status);
+ comInterface.recv(v2Distant->getPointer(),v2Distant->getNbOfElems(),MPI_DOUBLE,procId,1143,*comm,&status);
+ mesh->unserialization(tinyInfoDistantD,tinyInfoDistant,v1Distant,v2Distant,unusedTinyDistantSts);
+ //finished for mesh, ids now
+ comInterface.recv(ids->getPointer(),lgth[1],MPI_INT,procId,1144,*comm,&status);
+ //
+ v1Distant->decrRef();
+ v2Distant->decrRef();
+ }
+}
--- /dev/null
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+//
+// 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
+//
+
+#ifndef __OVERLAPELEMENTLOCATOR_HXX__
+#define __OVERLAPELEMENTLOCATOR_HXX__
+
+#include "InterpolationOptions.hxx"
+#include "MEDCouplingNatureOfField.hxx"
+#include "MEDCouplingPointSet.hxx"
+#include "MEDCouplingMemArray.hxx"
+#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+
+#include <mpi.h>
+#include <vector>
+#include <map>
+#include <set>
+
+namespace ParaMEDMEM
+{
+ class ParaFIELD;
+ class ProcessorGroup;
+ class ParaSUPPORT;
+ class OverlapInterpolationMatrix;
+
+ class OverlapElementLocator : public INTERP_KERNEL::InterpolationOptions
+ {
+ public:
+ OverlapElementLocator(const ParaFIELD *sourceField, const ParaFIELD *targetField, const ProcessorGroup& group);
+ virtual ~OverlapElementLocator();
+ const MPI_Comm *getCommunicator() const;
+ void exchangeMeshes(OverlapInterpolationMatrix& matrix);
+ std::vector< std::pair<int,int> > getToDoList() const { return _to_do_list; }
+ std::vector< std::vector< int > > getProcsInInteraction() const { return _proc_pairs; }
+ std::string getSourceMethod() const;
+ std::string getTargetMethod() const;
+ const MEDCouplingPointSet *getSourceMesh(int procId) const;
+ const DataArrayInt *getSourceIds(int procId) const;
+ const MEDCouplingPointSet *getTargetMesh(int procId) const;
+ const DataArrayInt *getTargetIds(int procId) const;
+ private:
+ void computeBoundingBoxes();
+ bool intersectsBoundingBox(int i, int j) const;
+ void sendLocalMeshTo(int procId, bool sourceOrTarget, OverlapInterpolationMatrix& matrix) const;
+ void receiveRemoteMesh(int procId, bool sourceOrTarget);
+ void sendMesh(int procId, const MEDCouplingPointSet *mesh, const DataArrayInt *idsToSend) const;
+ void receiveMesh(int procId, MEDCouplingPointSet* &mesh, DataArrayInt *&ids) const;
+ private:
+ const ParaFIELD *_local_source_field;
+ const ParaFIELD *_local_target_field;
+ int _local_space_dim;
+ MEDCouplingPointSet *_local_source_mesh;
+ MEDCouplingPointSet *_local_target_mesh;
+ std::vector<MEDCouplingPointSet*> _distant_cell_meshes;
+ std::vector<MEDCouplingPointSet*> _distant_face_meshes;
+ //! of size _group.size(). Contains for each source proc i, the ids of proc j the targets interact with. This vector is common for all procs in _group.
+ std::vector< std::vector< int > > _proc_pairs;
+ //! list of interpolations couple to be done
+ std::vector< std::pair<int,int> > _to_do_list;
+ std::vector< std::pair<int,bool> > _procs_to_send;
+ std::map<std::pair<int,bool>, MEDCouplingAutoRefCountObjectPtr< MEDCouplingPointSet > > _remote_meshes;
+ std::map<std::pair<int,bool>, MEDCouplingAutoRefCountObjectPtr< DataArrayInt > > _remote_elems;
+ double* _domain_bounding_boxes;
+ const ProcessorGroup& _group;
+ std::vector<int> _distant_proc_ids;
+ const MPI_Comm *_comm;
+ //Attributes only used by lazy side
+ //std::vector<double> _values_added;
+ //std::vector< std::vector<int> > _ids_per_working_proc;
+ //std::vector< std::vector<int> > _ids_per_working_proc3;
+ //std::vector< std::vector<double> > _values_per_working_proc;
+ };
+
+}
+
+#endif
--- /dev/null
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+//
+// 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
+//
+
+#include "OverlapInterpolationMatrix.hxx"
+#include "ParaMESH.hxx"
+#include "ParaFIELD.hxx"
+#include "ProcessorGroup.hxx"
+#include "TranslationRotationMatrix.hxx"
+#include "Interpolation.hxx"
+#include "Interpolation1D.txx"
+#include "Interpolation2DCurve.hxx"
+#include "Interpolation2D.txx"
+#include "Interpolation3DSurf.hxx"
+#include "Interpolation3D.txx"
+#include "MEDCouplingUMesh.hxx"
+#include "MEDCouplingNormalizedUnstructuredMesh.txx"
+#include "InterpolationOptions.hxx"
+#include "NormalizedUnstructuredMesh.hxx"
+#include "ElementLocator.hxx"
+#include "InterpKernelAutoPtr.hxx"
+
+#include <algorithm>
+
+using namespace std;
+
+namespace ParaMEDMEM
+{
+ OverlapInterpolationMatrix::OverlapInterpolationMatrix(ParaFIELD *source_field,
+ ParaFIELD *target_field,
+ const ProcessorGroup& group,
+ const DECOptions& dec_options,
+ const INTERP_KERNEL::InterpolationOptions& i_opt):
+ INTERP_KERNEL::InterpolationOptions(i_opt),
+ DECOptions(dec_options),
+ _source_field(source_field),
+ _target_field(target_field),
+ _source_support(source_field->getSupport()->getCellMesh()),
+ _target_support(target_field->getSupport()->getCellMesh()),
+ _mapping(group),
+ _group(group)
+ {
+ int nbelems = source_field->getField()->getNumberOfTuples();
+ _row_offsets.resize(nbelems+1);
+ _coeffs.resize(nbelems);
+ _target_volume.resize(nbelems);
+ }
+
+ void OverlapInterpolationMatrix::keepTracksOfSourceIds(int procId, DataArrayInt *ids)
+ {
+ _mapping.keepTracksOfSourceIds(procId,ids);
+ }
+
+ void OverlapInterpolationMatrix::keepTracksOfTargetIds(int procId, DataArrayInt *ids)
+ {
+ _mapping.keepTracksOfTargetIds(procId,ids);
+ }
+
+ OverlapInterpolationMatrix::~OverlapInterpolationMatrix()
+ {
+ }
+
+ void OverlapInterpolationMatrix::addContribution(const MEDCouplingPointSet *src, const DataArrayInt *srcIds, const std::string& srcMeth, int srcProcId,
+ const MEDCouplingPointSet *trg, const DataArrayInt *trgIds, const std::string& trgMeth, int trgProcId)
+ {
+ std::string interpMethod(srcMeth);
+ interpMethod+=trgMeth;
+ //creating the interpolator structure
+ vector<map<int,double> > surfaces;
+ int colSize=0;
+ //computation of the intersection volumes between source and target elements
+ const MEDCouplingUMesh *trgC=dynamic_cast<const MEDCouplingUMesh *>(trg);
+ const MEDCouplingUMesh *srcC=dynamic_cast<const MEDCouplingUMesh *>(src);
+ if ( src->getMeshDimension() == -1 )
+ {
+ if(trgC->getMeshDimension()==2 && trgC->getSpaceDimension()==2)
+ {
+ MEDCouplingNormalizedUnstructuredMesh<2,2> target_mesh_wrapper(trgC);
+ INTERP_KERNEL::Interpolation2D interpolation(*this);
+ colSize=interpolation.fromIntegralUniform(target_mesh_wrapper,surfaces,trgMeth.c_str());
+ }
+ else if(trgC->getMeshDimension()==3 && trgC->getSpaceDimension()==3)
+ {
+ MEDCouplingNormalizedUnstructuredMesh<3,3> target_mesh_wrapper(trgC);
+ INTERP_KERNEL::Interpolation3D interpolation(*this);
+ colSize=interpolation.fromIntegralUniform(target_mesh_wrapper,surfaces,trgMeth.c_str());
+ }
+ else if(trgC->getMeshDimension()==2 && trgC->getSpaceDimension()==3)
+ {
+ MEDCouplingNormalizedUnstructuredMesh<3,2> target_mesh_wrapper(trgC);
+ INTERP_KERNEL::Interpolation3DSurf interpolation(*this);
+ colSize=interpolation.fromIntegralUniform(target_mesh_wrapper,surfaces,trgMeth.c_str());
+ }
+ else
+ throw INTERP_KERNEL::Exception("No para interpolation available for the given mesh and space dimension of source mesh to -1D targetMesh");
+ }
+ else if ( trg->getMeshDimension() == -1 )
+ {
+ if(srcC->getMeshDimension()==2 && srcC->getSpaceDimension()==2)
+ {
+ MEDCouplingNormalizedUnstructuredMesh<2,2> local_mesh_wrapper(srcC);
+ INTERP_KERNEL::Interpolation2D interpolation(*this);
+ colSize=interpolation.toIntegralUniform(local_mesh_wrapper,surfaces,srcMeth.c_str());
+ }
+ else if(srcC->getMeshDimension()==3 && srcC->getSpaceDimension()==3)
+ {
+ MEDCouplingNormalizedUnstructuredMesh<3,3> local_mesh_wrapper(srcC);
+ INTERP_KERNEL::Interpolation3D interpolation(*this);
+ colSize=interpolation.toIntegralUniform(local_mesh_wrapper,surfaces,srcMeth.c_str());
+ }
+ else if(srcC->getMeshDimension()==2 && srcC->getSpaceDimension()==3)
+ {
+ MEDCouplingNormalizedUnstructuredMesh<3,2> local_mesh_wrapper(srcC);
+ INTERP_KERNEL::Interpolation3DSurf interpolation(*this);
+ colSize=interpolation.toIntegralUniform(local_mesh_wrapper,surfaces,srcMeth.c_str());
+ }
+ else
+ throw INTERP_KERNEL::Exception("No para interpolation available for the given mesh and space dimension of distant mesh to -1D sourceMesh");
+ }
+ else if (trg->getMeshDimension() != _source_support->getMeshDimension())
+ {
+ throw INTERP_KERNEL::Exception("local and distant meshes do not have the same space and mesh dimensions");
+ }
+ else if( src->getMeshDimension() == 1
+ && src->getSpaceDimension() == 1 )
+ {
+ MEDCouplingNormalizedUnstructuredMesh<1,1> target_wrapper(trgC);
+ MEDCouplingNormalizedUnstructuredMesh<1,1> source_wrapper(srcC);
+
+ INTERP_KERNEL::Interpolation1D interpolation(*this);
+ colSize=interpolation.interpolateMeshes(source_wrapper,target_wrapper,surfaces,interpMethod.c_str());
+ target_wrapper.releaseTempArrays();
+ source_wrapper.releaseTempArrays();
+ }
+ else if( trg->getMeshDimension() == 1
+ && trg->getSpaceDimension() == 2 )
+ {
+ MEDCouplingNormalizedUnstructuredMesh<2,1> target_wrapper(trgC);
+ MEDCouplingNormalizedUnstructuredMesh<2,1> source_wrapper(srcC);
+
+ INTERP_KERNEL::Interpolation2DCurve interpolation(*this);
+ colSize=interpolation.interpolateMeshes(source_wrapper,target_wrapper,surfaces,interpMethod.c_str());
+ target_wrapper.releaseTempArrays();
+ source_wrapper.releaseTempArrays();
+ }
+ else if ( trg->getMeshDimension() == 2
+ && trg->getSpaceDimension() == 3 )
+ {
+ MEDCouplingNormalizedUnstructuredMesh<3,2> target_wrapper(trgC);
+ MEDCouplingNormalizedUnstructuredMesh<3,2> source_wrapper(srcC);
+
+ INTERP_KERNEL::Interpolation3DSurf interpolator (*this);
+ colSize=interpolator.interpolateMeshes(source_wrapper,target_wrapper,surfaces,interpMethod.c_str());
+ target_wrapper.releaseTempArrays();
+ source_wrapper.releaseTempArrays();
+ }
+ else if ( trg->getMeshDimension() == 2
+ && trg->getSpaceDimension() == 2)
+ {
+ MEDCouplingNormalizedUnstructuredMesh<2,2> target_wrapper(trgC);
+ MEDCouplingNormalizedUnstructuredMesh<2,2> source_wrapper(srcC);
+
+ INTERP_KERNEL::Interpolation2D interpolator (*this);
+ colSize=interpolator.interpolateMeshes(source_wrapper,target_wrapper,surfaces,interpMethod.c_str());
+ target_wrapper.releaseTempArrays();
+ source_wrapper.releaseTempArrays();
+ }
+ else if ( trg->getMeshDimension() == 3
+ && trg->getSpaceDimension() == 3 )
+ {
+ MEDCouplingNormalizedUnstructuredMesh<3,3> target_wrapper(trgC);
+ MEDCouplingNormalizedUnstructuredMesh<3,3> source_wrapper(srcC);
+
+ INTERP_KERNEL::Interpolation3D interpolator (*this);
+ colSize=interpolator.interpolateMeshes(source_wrapper,target_wrapper,surfaces,interpMethod.c_str());
+ target_wrapper.releaseTempArrays();
+ source_wrapper.releaseTempArrays();
+ }
+ else
+ {
+ throw INTERP_KERNEL::Exception("no interpolator exists for these mesh and space dimensions ");
+ }
+ bool needSourceSurf=isSurfaceComputationNeeded(srcMeth);
+ MEDCouplingFieldDouble *source_triangle_surf=0;
+ if(needSourceSurf)
+ source_triangle_surf=src->getMeasureField(getMeasureAbsStatus());
+ //
+ fillDistributedMatrix(surfaces,srcIds,srcProcId,trgIds,trgProcId);
+ //
+ if(needSourceSurf)
+ source_triangle_surf->decrRef();
+ }
+
+ /*!
+ * \b res rows refers to target and column (first param of map) to source.
+ */
+ void OverlapInterpolationMatrix::fillDistributedMatrix(const std::vector< std::map<int,double> >& res,
+ const DataArrayInt *srcIds, int srcProc,
+ const DataArrayInt *trgIds, int trgProc)
+ {
+ _mapping.addContributionST(res,srcIds,srcProc,trgIds,trgProc);
+ }
+
+ /*!
+ * 'procsInInteraction' gives the global view of interaction between procs.
+ * In 'procsInInteraction' for a proc with id i, is in interaction with procs listed in procsInInteraction[i]
+ */
+ void OverlapInterpolationMatrix::prepare(const std::vector< std::vector<int> >& procsInInteraction)
+ {
+ if(_source_support)
+ _mapping.prepare(procsInInteraction,_target_field->getField()->getNumberOfTuplesExpected());
+ else
+ _mapping.prepare(procsInInteraction,0);
+ }
+
+ void OverlapInterpolationMatrix::computeDeno()
+ {
+ if(_target_field->getField()->getNature()==ConservativeVolumic)
+ _mapping.computeDenoConservativeVolumic(_target_field->getField()->getNumberOfTuplesExpected());
+ else
+ throw INTERP_KERNEL::Exception("Policy Not implemented yet : only ConservativeVolumic defined !");
+ }
+
+ void OverlapInterpolationMatrix::multiply()
+ {
+ _mapping.multiply(_source_field->getField(),_target_field->getField());
+ }
+
+ void OverlapInterpolationMatrix::transposeMultiply()
+ {
+ _mapping.transposeMultiply(_target_field->getField(),_source_field->getField());
+ }
+
+ bool OverlapInterpolationMatrix::isSurfaceComputationNeeded(const std::string& method) const
+ {
+ return method=="P0";
+ }
+}
--- /dev/null
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+//
+// 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
+//
+
+#ifndef __OVERLAPINTERPOLATIONMATRIX_HXX__
+#define __OVERLAPINTERPOLATIONMATRIX_HXX__
+
+#include "MPIAccessDEC.hxx"
+#include "OverlapMapping.hxx"
+#include "InterpolationOptions.hxx"
+#include "DECOptions.hxx"
+
+namespace ParaMEDMEM
+{
+ class ParaFIELD;
+ class MEDCouplingPointSet;
+
+ class OverlapInterpolationMatrix : public INTERP_KERNEL::InterpolationOptions,
+ public DECOptions
+ {
+ public:
+
+ OverlapInterpolationMatrix(ParaFIELD *source_field,
+ ParaFIELD *target_field,
+ const ProcessorGroup& group,
+ const DECOptions& dec_opt,
+ const InterpolationOptions& i_opt);
+
+ void keepTracksOfSourceIds(int procId, DataArrayInt *ids);
+
+ void keepTracksOfTargetIds(int procId, DataArrayInt *ids);
+
+ void addContribution(const MEDCouplingPointSet *src, const DataArrayInt *srcIds, const std::string& srcMeth, int srcProcId,
+ const MEDCouplingPointSet *trg, const DataArrayInt *trgIds, const std::string& trgMeth, int trgProcId);
+
+ void prepare(const std::vector< std::vector<int> >& procsInInteraction);
+
+ void computeDeno();
+
+ void multiply();
+
+ void transposeMultiply();
+
+ virtual ~OverlapInterpolationMatrix();
+#if 0
+ void addContribution(MEDCouplingPointSet& distant_support, int iproc_distant,
+ const int* distant_elems, const std::string& srcMeth, const std::string& targetMeth);
+ void finishContributionW(ElementLocator& elementLocator);
+ void finishContributionL(ElementLocator& elementLocator);
+ void multiply(MEDCouplingFieldDouble& field) const;
+ void transposeMultiply(MEDCouplingFieldDouble& field)const;
+ void prepare();
+ int getNbRows() const { return _row_offsets.size(); }
+ MPIAccessDEC* getAccessDEC() { return _mapping.getAccessDEC(); }
+ private:
+ void computeConservVolDenoW(ElementLocator& elementLocator);
+ void computeIntegralDenoW(ElementLocator& elementLocator);
+ void computeRevIntegralDenoW(ElementLocator& elementLocator);
+ void computeGlobConstraintDenoW(ElementLocator& elementLocator);
+ void computeConservVolDenoL(ElementLocator& elementLocator);
+ void computeIntegralDenoL(ElementLocator& elementLocator);
+ void computeRevIntegralDenoL(ElementLocator& elementLocator);
+
+ void computeLocalColSum(std::vector<double>& res) const;
+ void computeLocalRowSum(const std::vector<int>& distantProcs, std::vector<std::vector<int> >& resPerProcI,
+ std::vector<std::vector<double> >& resPerProcD) const;
+ void computeGlobalRowSum(ElementLocator& elementLocator, std::vector<std::vector<double> >& denoStrorage, std::vector<std::vector<double> >& denoStrorageInv);
+ void computeGlobalColSum(std::vector<std::vector<double> >& denoStrorage);
+ void resizeGlobalColSum(std::vector<std::vector<double> >& denoStrorage);
+ void fillDSFromVM(int iproc_distant, const int* distant_elems, const std::vector< std::map<int,double> >& values, MEDCouplingFieldDouble *surf);
+ void serializeMe(std::vector< std::vector< std::map<int,double> > >& data1, std::vector<int>& data2) const;
+ void initialize();
+ void findAdditionnalElements(ElementLocator& elementLocator, std::vector<std::vector<int> >& elementsToAdd,
+ const std::vector<std::vector<int> >& resPerProcI, const std::vector<std::vector<int> >& globalIdsPartial);
+ void addGhostElements(const std::vector<int>& distantProcs, const std::vector<std::vector<int> >& elementsToAdd);
+ int mergePolicies(const std::vector<int>& policyPartial);
+ void mergeRowSum(const std::vector< std::vector<double> >& rowsPartialSumD, const std::vector< std::vector<int> >& globalIdsPartial,
+ std::vector<int>& globalIdsLazySideInteraction, std::vector<double>& sumCorresponding);
+ void mergeRowSum2(const std::vector< std::vector<int> >& globalIdsPartial, std::vector< std::vector<double> >& rowsPartialSumD,
+ const std::vector<int>& globalIdsLazySideInteraction, const std::vector<double>& sumCorresponding);
+ void mergeRowSum3(const std::vector< std::vector<int> >& globalIdsPartial, std::vector< std::vector<double> >& rowsPartialSumD);
+ void mergeCoeffs(const std::vector<int>& procsInInteraction, const std::vector< std::vector<int> >& rowsPartialSumI,
+ const std::vector<std::vector<int> >& globalIdsPartial, std::vector<std::vector<double> >& denoStrorageInv);
+ void divideByGlobalRowSum(const std::vector<int>& distantProcs, const std::vector<std::vector<int> >& resPerProcI,
+ const std::vector<std::vector<double> >& resPerProcD, std::vector<std::vector<double> >& deno);
+#endif
+ private:
+ bool isSurfaceComputationNeeded(const std::string& method) const;
+ void fillDistributedMatrix(const std::vector< std::map<int,double> >& res,
+ const DataArrayInt *srcIds, int srcProc,
+ const DataArrayInt *trgIds, int trgProc);
+ private:
+ ParaMEDMEM::ParaFIELD *_source_field;
+ ParaMEDMEM::ParaFIELD *_target_field;
+ std::vector<int> _row_offsets;
+ std::map<std::pair<int,int>, int > _col_offsets;
+ MEDCouplingPointSet *_source_support;
+ MEDCouplingPointSet *_target_support;
+ OverlapMapping _mapping;
+
+ const ProcessorGroup& _group;
+ std::vector< std::vector<double> > _target_volume;
+ std::vector<std::vector<std::pair<int,double> > > _coeffs;
+ std::vector<std::vector<double> > _deno_multiply;
+ std::vector<std::vector<double> > _deno_reverse_multiply;
+ };
+}
+
+#endif
--- /dev/null
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+//
+// 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
+//
+
+#include "OverlapMapping.hxx"
+#include "MPIProcessorGroup.hxx"
+
+#include "MEDCouplingFieldDouble.hxx"
+#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+
+#include "InterpKernelAutoPtr.hxx"
+
+#include <numeric>
+#include <algorithm>
+
+using namespace ParaMEDMEM;
+
+OverlapMapping::OverlapMapping(const ProcessorGroup& group):_group(group)
+{
+}
+
+/*!
+ * This method keeps tracks of source ids to know in step 6 of main algorithm, which tuple ids to send away.
+ * This method incarnates item#1 of step2 algorithm.
+ */
+void OverlapMapping::keepTracksOfSourceIds(int procId, DataArrayInt *ids)
+{
+ ids->incrRef();
+ _src_ids_st2.push_back(ids);
+ _src_proc_st2.push_back(procId);
+}
+
+/*!
+ * This method keeps tracks of target ids to know in step 6 of main algorithm.
+ * This method incarnates item#0 of step2 algorithm.
+ */
+void OverlapMapping::keepTracksOfTargetIds(int procId, DataArrayInt *ids)
+{
+ ids->incrRef();
+ _trg_ids_st2.push_back(ids);
+ _trg_proc_st2.push_back(procId);
+}
+
+/*!
+ * This method stores from a matrix in format Target(rows)/Source(cols) for a source procId 'srcProcId' and for a target procId 'trgProcId'.
+ * All ids (source and target) are in format of local ids.
+ */
+void OverlapMapping::addContributionST(const std::vector< std::map<int,double> >& matrixST, const DataArrayInt *srcIds, int srcProcId, const DataArrayInt *trgIds, int trgProcId)
+{
+ _matrixes_st.push_back(matrixST);
+ _source_proc_id_st.push_back(srcProcId);
+ _target_proc_id_st.push_back(trgProcId);
+ if(srcIds)
+ {//item#1 of step2 algorithm in proc m. Only to know in advanced nb of recv ids [ (0,1) computed on proc1 and Matrix-Vector on proc1 ]
+ _nb_of_src_ids_proc_st2.push_back(srcIds->getNumberOfTuples());
+ _src_ids_proc_st2.push_back(srcProcId);
+ }
+ else
+ {//item#0 of step2 algorithm in proc k
+ std::set<int> s;
+ for(std::vector< std::map<int,double> >::const_iterator it1=matrixST.begin();it1!=matrixST.end();it1++)
+ for(std::map<int,double>::const_iterator it2=(*it1).begin();it2!=(*it1).end();it2++)
+ s.insert((*it2).first);
+ _src_ids_zip_st2.resize(_src_ids_zip_st2.size()+1);
+ _src_ids_zip_st2.back().insert(_src_ids_zip_st2.back().end(),s.begin(),s.end());
+ _src_ids_zip_proc_st2.push_back(trgProcId);
+ }
+}
+
+/*!
+ * 'procsInInteraction' gives the global view of interaction between procs.
+ * In 'procsInInteraction' for a proc with id i, is in interaction with procs listed in procsInInteraction[i].
+ *
+ * This method is in charge to send matrixes in AlltoAll mode.
+ * After the call of this method 'this' contains the matrixST for all source elements of the current proc
+ */
+void OverlapMapping::prepare(const std::vector< std::vector<int> >& procsInInteraction, int nbOfTrgElems)
+{
+ CommInterface commInterface=_group.getCommInterface();
+ const MPIProcessorGroup *group=static_cast<const MPIProcessorGroup*>(&_group);
+ const MPI_Comm *comm=group->getComm();
+ int grpSize=_group.size();
+ INTERP_KERNEL::AutoPtr<int> nbsend=new int[grpSize];
+ INTERP_KERNEL::AutoPtr<int> nbsend2=new int[grpSize];
+ INTERP_KERNEL::AutoPtr<int> nbsend3=new int[grpSize];
+ std::fill<int *>(nbsend,nbsend+grpSize,0);
+ int myProcId=_group.myRank();
+ _proc_ids_to_recv_vector_st.clear();
+ int curProc=0;
+ for(std::vector< std::vector<int> >::const_iterator it1=procsInInteraction.begin();it1!=procsInInteraction.end();it1++,curProc++)
+ if(std::find((*it1).begin(),(*it1).end(),myProcId)!=(*it1).end())
+ _proc_ids_to_recv_vector_st.push_back(curProc);
+ _proc_ids_to_send_vector_st=procsInInteraction[myProcId];
+ for(std::size_t i=0;i<_matrixes_st.size();i++)
+ if(_source_proc_id_st[i]==myProcId)
+ nbsend[_target_proc_id_st[i]]=_matrixes_st[i].size();
+ INTERP_KERNEL::AutoPtr<int> nbrecv=new int[grpSize];
+ commInterface.allToAll(nbsend,1,MPI_INT,nbrecv,1,MPI_INT,*comm);
+ //exchanging matrix
+ //first exchanging offsets+ids_source
+ INTERP_KERNEL::AutoPtr<int> nbrecv1=new int[grpSize];
+ INTERP_KERNEL::AutoPtr<int> nbrecv2=new int[grpSize];
+ //
+ int *tmp=0;
+ serializeMatrixStep0ST(nbrecv,
+ tmp,nbsend2,nbsend3,
+ nbrecv1,nbrecv2);
+ INTERP_KERNEL::AutoPtr<int> bigArr=tmp;
+ INTERP_KERNEL::AutoPtr<int> bigArrRecv=new int[nbrecv2[grpSize-1]+nbrecv1[grpSize-1]];
+ commInterface.allToAllV(bigArr,nbsend2,nbsend3,MPI_INT,
+ bigArrRecv,nbrecv1,nbrecv2,MPI_INT,
+ *comm);// sending ids of sparse matrix (n+1 elems)
+ //second phase echange target ids
+ std::fill<int *>(nbsend2,nbsend2+grpSize,0);
+ INTERP_KERNEL::AutoPtr<int> nbrecv3=new int[grpSize];
+ INTERP_KERNEL::AutoPtr<int> nbrecv4=new int[grpSize];
+ double *tmp2=0;
+ int lgthOfArr=serializeMatrixStep1ST(nbrecv,bigArrRecv,nbrecv1,nbrecv2,
+ tmp,tmp2,
+ nbsend2,nbsend3,nbrecv3,nbrecv4);
+ INTERP_KERNEL::AutoPtr<int> bigArr2=tmp;
+ INTERP_KERNEL::AutoPtr<double> bigArrD2=tmp2;
+ INTERP_KERNEL::AutoPtr<int> bigArrRecv2=new int[lgthOfArr];
+ INTERP_KERNEL::AutoPtr<double> bigArrDRecv2=new double[lgthOfArr];
+ commInterface.allToAllV(bigArr2,nbsend2,nbsend3,MPI_INT,
+ bigArrRecv2,nbrecv3,nbrecv4,MPI_INT,
+ *comm);
+ commInterface.allToAllV(bigArrD2,nbsend2,nbsend3,MPI_DOUBLE,
+ bigArrDRecv2,nbrecv3,nbrecv4,MPI_DOUBLE,
+ *comm);
+ //finishing
+ unserializationST(nbOfTrgElems,nbrecv,bigArrRecv,nbrecv1,nbrecv2,
+ bigArrRecv2,bigArrDRecv2,nbrecv3,nbrecv4);
+ //updating _src_ids_zip_st2 and _src_ids_zip_st2 with received matrix.
+ updateZipSourceIdsForFuture();
+ //finish to fill _the_matrix_st with already in place matrix in _matrixes_st
+ finishToFillFinalMatrixST();
+ //printTheMatrix();
+}
+
+/*!
+ * Compute denominators.
+ */
+void OverlapMapping::computeDenoGlobConstraint()
+{
+ _the_deno_st.clear();
+ std::size_t sz1=_the_matrix_st.size();
+ _the_deno_st.resize(sz1);
+ for(std::size_t i=0;i<sz1;i++)
+ {
+ std::size_t sz2=_the_matrix_st[i].size();
+ _the_deno_st[i].resize(sz2);
+ for(std::size_t j=0;j<sz2;j++)
+ {
+ double sum=0;
+ std::map<int,double>& mToFill=_the_deno_st[i][j];
+ const std::map<int,double>& m=_the_matrix_st[i][j];
+ for(std::map<int,double>::const_iterator it=m.begin();it!=m.end();it++)
+ sum+=(*it).second;
+ for(std::map<int,double>::const_iterator it=m.begin();it!=m.end();it++)
+ mToFill[(*it).first]=sum;
+ }
+ }
+}
+
+/*!
+ * Compute denominators.
+ */
+void OverlapMapping::computeDenoConservativeVolumic(int nbOfTuplesTrg)
+{
+ CommInterface commInterface=_group.getCommInterface();
+ int myProcId=_group.myRank();
+ //
+ _the_deno_st.clear();
+ std::size_t sz1=_the_matrix_st.size();
+ _the_deno_st.resize(sz1);
+ std::vector<double> deno(nbOfTuplesTrg);
+ for(std::size_t i=0;i<sz1;i++)
+ {
+ const std::vector< std::map<int,double> >& mat=_the_matrix_st[i];
+ int curSrcId=_the_matrix_st_source_proc_id[i];
+ std::vector<int>::iterator isItem1=std::find(_trg_proc_st2.begin(),_trg_proc_st2.end(),curSrcId);
+ int rowId=0;
+ if(isItem1==_trg_proc_st2.end() || curSrcId==myProcId)//item1 of step2 main algo. Simple, because rowId of mat are directly target ids.
+ {
+ for(std::vector< std::map<int,double> >::const_iterator it1=mat.begin();it1!=mat.end();it1++,rowId++)
+ for(std::map<int,double>::const_iterator it2=(*it1).begin();it2!=(*it1).end();it2++)
+ deno[rowId]+=(*it2).second;
+ }
+ else
+ {//item0 of step2 main algo. More complicated.
+ std::vector<int>::iterator fnd=isItem1;//std::find(_trg_proc_st2.begin(),_trg_proc_st2.end(),curSrcId);
+ int locId=std::distance(_trg_proc_st2.begin(),fnd);
+ const DataArrayInt *trgIds=_trg_ids_st2[locId];
+ const int *trgIds2=trgIds->getConstPointer();
+ for(std::vector< std::map<int,double> >::const_iterator it1=mat.begin();it1!=mat.end();it1++,rowId++)
+ for(std::map<int,double>::const_iterator it2=(*it1).begin();it2!=(*it1).end();it2++)
+ deno[trgIds2[rowId]]+=(*it2).second;
+ }
+ }
+ //
+ for(std::size_t i=0;i<sz1;i++)
+ {
+ int rowId=0;
+ const std::vector< std::map<int,double> >& mat=_the_matrix_st[i];
+ int curSrcId=_the_matrix_st_source_proc_id[i];
+ std::vector<int>::iterator isItem1=std::find(_trg_proc_st2.begin(),_trg_proc_st2.end(),curSrcId);
+ std::vector< std::map<int,double> >& denoM=_the_deno_st[i];
+ denoM.resize(mat.size());
+ if(isItem1==_trg_proc_st2.end() || curSrcId==myProcId)//item1 of step2 main algo. Simple, because rowId of mat are directly target ids.
+ {
+ int rowId=0;
+ for(std::vector< std::map<int,double> >::const_iterator it1=mat.begin();it1!=mat.end();it1++,rowId++)
+ for(std::map<int,double>::const_iterator it2=(*it1).begin();it2!=(*it1).end();it2++)
+ denoM[rowId][(*it2).first]=deno[rowId];
+ }
+ else
+ {
+ std::vector<int>::iterator fnd=isItem1;
+ int locId=std::distance(_trg_proc_st2.begin(),fnd);
+ const DataArrayInt *trgIds=_trg_ids_st2[locId];
+ const int *trgIds2=trgIds->getConstPointer();
+ for(std::vector< std::map<int,double> >::const_iterator it1=mat.begin();it1!=mat.end();it1++,rowId++)
+ for(std::map<int,double>::const_iterator it2=(*it1).begin();it2!=(*it1).end();it2++)
+ denoM[rowId][(*it2).first]=deno[trgIds2[rowId]];
+ }
+ }
+}
+
+/*!
+ * This method performs step #0/3 in serialization process.
+ * \param count tells specifies nb of elems to send to corresponding proc id. size equal to _group.size().
+ * \param offsets tells for a proc i where to start serialize#0 matrix. size equal to _group.size().
+ * \param nbOfElemsSrc of size _group.size(). Comes from previous all2all call. tells how many srcIds per proc contains matrix for current proc.
+ */
+void OverlapMapping::serializeMatrixStep0ST(const int *nbOfElemsSrc, int *&bigArr, int *count, int *offsets,
+ int *countForRecv, int *offsetsForRecv) const
+{
+ int grpSize=_group.size();
+ std::fill<int *>(count,count+grpSize,0);
+ int szz=0;
+ int myProcId=_group.myRank();
+ for(std::size_t i=0;i<_matrixes_st.size();i++)
+ {
+ if(_source_proc_id_st[i]==myProcId)// && _target_proc_id_st[i]!=myProcId
+ {
+ count[_target_proc_id_st[i]]=_matrixes_st[i].size()+1;
+ szz+=_matrixes_st[i].size()+1;
+ }
+ }
+ bigArr=new int[szz];
+ offsets[0]=0;
+ for(int i=1;i<grpSize;i++)
+ offsets[i]=offsets[i-1]+count[i-1];
+ for(std::size_t i=0;i<_matrixes_st.size();i++)
+ {
+ if(_source_proc_id_st[i]==myProcId)
+ {
+ int start=offsets[_target_proc_id_st[i]];
+ int *work=bigArr+start;
+ *work=0;
+ const std::vector< std::map<int,double> >& mat=_matrixes_st[i];
+ for(std::vector< std::map<int,double> >::const_iterator it=mat.begin();it!=mat.end();it++,work++)
+ work[1]=work[0]+(*it).size();
+ }
+ }
+ //
+ offsetsForRecv[0]=0;
+ for(int i=0;i<grpSize;i++)
+ {
+ if(nbOfElemsSrc[i]>0)
+ countForRecv[i]=nbOfElemsSrc[i]+1;
+ else
+ countForRecv[i]=0;
+ if(i>0)
+ offsetsForRecv[i]=offsetsForRecv[i-1]+countForRecv[i-1];
+ }
+}
+
+/*!
+ * This method performs step#1 and step#2/3. It returns the size of expected array to get allToAllV.
+ */
+int OverlapMapping::serializeMatrixStep1ST(const int *nbOfElemsSrc, const int *recvStep0, const int *countStep0, const int *offsStep0,
+ int *&bigArrI, double *&bigArrD, int *count, int *offsets,
+ int *countForRecv, int *offsForRecv) const
+{
+ int grpSize=_group.size();
+ int myProcId=_group.myRank();
+ offsForRecv[0]=0;
+ int szz=0;
+ for(int i=0;i<grpSize;i++)
+ {
+ if(nbOfElemsSrc[i]!=0)
+ countForRecv[i]=recvStep0[offsStep0[i]+nbOfElemsSrc[i]];
+ else
+ countForRecv[i]=0;
+ szz+=countForRecv[i];
+ if(i>0)
+ offsForRecv[i]=offsForRecv[i-1]+countForRecv[i-1];
+ }
+ //
+ std::fill(count,count+grpSize,0);
+ offsets[0]=0;
+ int fullLgth=0;
+ for(std::size_t i=0;i<_matrixes_st.size();i++)
+ {
+ if(_source_proc_id_st[i]==myProcId)
+ {
+ const std::vector< std::map<int,double> >& mat=_matrixes_st[i];
+ int lgthToSend=0;
+ for(std::vector< std::map<int,double> >::const_iterator it=mat.begin();it!=mat.end();it++)
+ lgthToSend+=(*it).size();
+ count[_target_proc_id_st[i]]=lgthToSend;
+ fullLgth+=lgthToSend;
+ }
+ }
+ for(int i=1;i<grpSize;i++)
+ offsets[i]=offsets[i-1]+count[i-1];
+ //
+ bigArrI=new int[fullLgth];
+ bigArrD=new double[fullLgth];
+ // feeding arrays
+ fullLgth=0;
+ for(std::size_t i=0;i<_matrixes_st.size();i++)
+ {
+ if(_source_proc_id_st[i]==myProcId)
+ {
+ const std::vector< std::map<int,double> >& mat=_matrixes_st[i];
+ for(std::vector< std::map<int,double> >::const_iterator it1=mat.begin();it1!=mat.end();it1++)
+ {
+ int j=0;
+ for(std::map<int,double>::const_iterator it2=(*it1).begin();it2!=(*it1).end();it2++,j++)
+ {
+ bigArrI[fullLgth+j]=(*it2).first;
+ bigArrD[fullLgth+j]=(*it2).second;
+ }
+ fullLgth+=(*it1).size();
+ }
+ }
+ }
+ return szz;
+}
+
+/*!
+ * This is the last step after all2Alls for matrix exchange.
+ * _the_matrix_st is the final matrix :
+ * - The first entry is srcId in current proc.
+ * - The second is the pseudo id of source proc (correspondance with true id is in attribute _the_matrix_st_source_proc_id and _the_matrix_st_source_ids)
+ * - the third is the srcId in the pseudo source proc
+ */
+void OverlapMapping::unserializationST(int nbOfTrgElems,
+ const int *nbOfElemsSrcPerProc,//first all2all
+ const int *bigArrRecv, const int *bigArrRecvCounts, const int *bigArrRecvOffs,//2nd all2all
+ const int *bigArrRecv2, const double *bigArrDRecv2, const int *bigArrRecv2Count, const int *bigArrRecv2Offs)//3rd and 4th all2alls
+{
+ _the_matrix_st.clear();
+ _the_matrix_st_source_proc_id.clear();
+ //
+ int grpSize=_group.size();
+ for(int i=0;i<grpSize;i++)
+ if(nbOfElemsSrcPerProc[i]!=0)
+ _the_matrix_st_source_proc_id.push_back(i);
+ int nbOfPseudoProcs=_the_matrix_st_source_proc_id.size();//_the_matrix_st_target_proc_id.size() contains number of matrix fetched remotely whose sourceProcId==myProcId
+ _the_matrix_st.resize(nbOfPseudoProcs);
+ //
+ int j=0;
+ for(int i=0;i<grpSize;i++)
+ if(nbOfElemsSrcPerProc[i]!=0)
+ {
+ _the_matrix_st[j].resize(nbOfElemsSrcPerProc[i]);
+ for(int k=0;k<nbOfElemsSrcPerProc[i];k++)
+ {
+ int offs=bigArrRecv[bigArrRecvOffs[i]+k];
+ int lgthOfMap=bigArrRecv[bigArrRecvOffs[i]+k+1]-offs;
+ for(int l=0;l<lgthOfMap;l++)
+ _the_matrix_st[j][k][bigArrRecv2[bigArrRecv2Offs[i]+offs+l]]=bigArrDRecv2[bigArrRecv2Offs[i]+offs+l];
+ }
+ j++;
+ }
+}
+
+/*!
+ * This method should be called when all remote matrix with sourceProcId==thisProcId have been retrieved and are in 'this->_the_matrix_st' and 'this->_the_matrix_st_target_proc_id'
+ * and 'this->_the_matrix_st_target_ids'.
+ * This method finish the job of filling 'this->_the_matrix_st' and 'this->_the_matrix_st_target_proc_id' by putting candidates in 'this->_matrixes_st' into them.
+ */
+void OverlapMapping::finishToFillFinalMatrixST()
+{
+ int myProcId=_group.myRank();
+ int sz=_matrixes_st.size();
+ int nbOfEntryToAdd=0;
+ for(int i=0;i<sz;i++)
+ if(_source_proc_id_st[i]!=myProcId)
+ nbOfEntryToAdd++;
+ if(nbOfEntryToAdd==0)
+ return ;
+ int oldNbOfEntry=_the_matrix_st.size();
+ int newNbOfEntry=oldNbOfEntry+nbOfEntryToAdd;
+ _the_matrix_st.resize(newNbOfEntry);
+ int j=oldNbOfEntry;
+ for(int i=0;i<sz;i++)
+ if(_source_proc_id_st[i]!=myProcId)
+ {
+ const std::vector<std::map<int,double> >& mat=_matrixes_st[i];
+ _the_matrix_st[j]=mat;
+ _the_matrix_st_source_proc_id.push_back(_source_proc_id_st[i]);
+ j++;
+ }
+ _matrixes_st.clear();
+}
+
+/*!
+ * This method performs the operation of target ids broadcasting.
+ */
+void OverlapMapping::prepareIdsToSendST()
+{
+ CommInterface commInterface=_group.getCommInterface();
+ const MPIProcessorGroup *group=static_cast<const MPIProcessorGroup*>(&_group);
+ const MPI_Comm *comm=group->getComm();
+ int grpSize=_group.size();
+ _source_ids_to_send_st.clear();
+ _source_ids_to_send_st.resize(grpSize);
+ INTERP_KERNEL::AutoPtr<int> nbsend=new int[grpSize];
+ std::fill<int *>(nbsend,nbsend+grpSize,0);
+ for(std::size_t i=0;i<_the_matrix_st_source_proc_id.size();i++)
+ nbsend[_the_matrix_st_source_proc_id[i]]=_the_matrix_st_source_ids[i].size();
+ INTERP_KERNEL::AutoPtr<int> nbrecv=new int[grpSize];
+ commInterface.allToAll(nbsend,1,MPI_INT,nbrecv,1,MPI_INT,*comm);
+ //
+ INTERP_KERNEL::AutoPtr<int> nbsend2=new int[grpSize];
+ std::copy((int *)nbsend,((int *)nbsend)+grpSize,(int *)nbsend2);
+ INTERP_KERNEL::AutoPtr<int> nbsend3=new int[grpSize];
+ nbsend3[0]=0;
+ for(int i=1;i<grpSize;i++)
+ nbsend3[i]=nbsend3[i-1]+nbsend2[i-1];
+ int sendSz=nbsend3[grpSize-1]+nbsend2[grpSize-1];
+ INTERP_KERNEL::AutoPtr<int> bigDataSend=new int[sendSz];
+ for(std::size_t i=0;i<_the_matrix_st_source_proc_id.size();i++)
+ {
+ int offset=nbsend3[_the_matrix_st_source_proc_id[i]];
+ std::copy(_the_matrix_st_source_ids[i].begin(),_the_matrix_st_source_ids[i].end(),((int *)nbsend3)+offset);
+ }
+ INTERP_KERNEL::AutoPtr<int> nbrecv2=new int[grpSize];
+ INTERP_KERNEL::AutoPtr<int> nbrecv3=new int[grpSize];
+ std::copy((int *)nbrecv,((int *)nbrecv)+grpSize,(int *)nbrecv2);
+ nbrecv3[0]=0;
+ for(int i=1;i<grpSize;i++)
+ nbrecv3[i]=nbrecv3[i-1]+nbrecv2[i-1];
+ int recvSz=nbrecv3[grpSize-1]+nbrecv2[grpSize-1];
+ INTERP_KERNEL::AutoPtr<int> bigDataRecv=new int[recvSz];
+ //
+ commInterface.allToAllV(bigDataSend,nbsend2,nbsend3,MPI_INT,
+ bigDataRecv,nbrecv2,nbrecv3,MPI_INT,
+ *comm);
+ for(int i=0;i<grpSize;i++)
+ {
+ if(nbrecv2[i]>0)
+ {
+ _source_ids_to_send_st[i].insert(_source_ids_to_send_st[i].end(),((int *)bigDataRecv)+nbrecv3[i],((int *)bigDataRecv)+nbrecv3[i]+nbrecv2[i]);
+ }
+ }
+}
+
+/*!
+ * This method performs a transpose multiply of 'fieldInput' and put the result into 'fieldOutput'.
+ * 'fieldInput' is expected to be the sourcefield and 'fieldOutput' the targetfield.
+ */
+void OverlapMapping::multiply(const MEDCouplingFieldDouble *fieldInput, MEDCouplingFieldDouble *fieldOutput) const
+{
+ int nbOfCompo=fieldInput->getNumberOfComponents();//to improve same number of components to test
+ CommInterface commInterface=_group.getCommInterface();
+ const MPIProcessorGroup *group=static_cast<const MPIProcessorGroup*>(&_group);
+ const MPI_Comm *comm=group->getComm();
+ int grpSize=_group.size();
+ int myProcId=_group.myRank();
+ //
+ INTERP_KERNEL::AutoPtr<int> nbsend=new int[grpSize];
+ INTERP_KERNEL::AutoPtr<int> nbsend2=new int[grpSize];
+ INTERP_KERNEL::AutoPtr<int> nbrecv=new int[grpSize];
+ INTERP_KERNEL::AutoPtr<int> nbrecv2=new int[grpSize];
+ std::fill<int *>(nbsend,nbsend+grpSize,0);
+ std::fill<int *>(nbrecv,nbrecv+grpSize,0);
+ nbsend2[0]=0;
+ nbrecv2[0]=0;
+ std::vector<double> valsToSend;
+ for(int i=0;i<grpSize;i++)
+ {
+ if(std::find(_proc_ids_to_send_vector_st.begin(),_proc_ids_to_send_vector_st.end(),i)!=_proc_ids_to_send_vector_st.end())
+ {
+ std::vector<int>::const_iterator isItem1=std::find(_src_proc_st2.begin(),_src_proc_st2.end(),i);
+ MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> vals;
+ if(isItem1!=_src_proc_st2.end())//item1 of step2 main algo
+ {
+ int id=std::distance(_src_proc_st2.begin(),isItem1);
+ vals=fieldInput->getArray()->selectByTupleId(_src_ids_st2[id]->getConstPointer(),_src_ids_st2[id]->getConstPointer()+_src_ids_st2[id]->getNumberOfTuples());
+ }
+ else
+ {//item0 of step2 main algo
+ int id=std::distance(_src_ids_zip_proc_st2.begin(),std::find(_src_ids_zip_proc_st2.begin(),_src_ids_zip_proc_st2.end(),i));
+ vals=fieldInput->getArray()->selectByTupleId(&(_src_ids_zip_st2[id])[0],&(_src_ids_zip_st2[id])[0]+_src_ids_zip_st2[id].size());
+ }
+ nbsend[i]=vals->getNbOfElems();
+ valsToSend.insert(valsToSend.end(),vals->getConstPointer(),vals->getConstPointer()+nbsend[i]);
+ }
+ if(std::find(_proc_ids_to_recv_vector_st.begin(),_proc_ids_to_recv_vector_st.end(),i)!=_proc_ids_to_recv_vector_st.end())
+ {
+ std::vector<int>::const_iterator isItem0=std::find(_trg_proc_st2.begin(),_trg_proc_st2.end(),i);
+ if(isItem0==_trg_proc_st2.end())//item1 of step2 main algo [ (0,1) computed on proc1 and Matrix-Vector on proc1 ]
+ {
+ std::vector<int>::const_iterator it1=std::find(_src_ids_proc_st2.begin(),_src_ids_proc_st2.end(),i);
+ if(it1!=_src_ids_proc_st2.end())
+ {
+ int id=std::distance(_src_ids_proc_st2.begin(),it1);
+ nbrecv[i]=_nb_of_src_ids_proc_st2[id]*nbOfCompo;
+ }
+ else if(i==myProcId)
+ {
+ nbrecv[i]=fieldInput->getNumberOfTuplesExpected()*nbOfCompo;
+ }
+ else
+ throw INTERP_KERNEL::Exception("Plouff ! send email to anthony.geay@cea.fr ! ");
+ }
+ else
+ {//item0 of step2 main algo [ (2,1) computed on proc2 but Matrix-Vector on proc1 ] [(1,0) computed on proc1 but Matrix-Vector on proc0]
+ int id=std::distance(_src_ids_zip_proc_st2.begin(),std::find(_src_ids_zip_proc_st2.begin(),_src_ids_zip_proc_st2.end(),i));
+ nbrecv[i]=_src_ids_zip_st2[id].size()*nbOfCompo;
+ }
+ }
+ }
+ for(int i=1;i<grpSize;i++)
+ {
+ nbsend2[i]=nbsend2[i-1]+nbsend[i-1];
+ nbrecv2[i]=nbrecv2[i-1]+nbrecv[i-1];
+ }
+ INTERP_KERNEL::AutoPtr<double> bigArr=new double[nbrecv2[grpSize-1]+nbrecv[grpSize-1]];
+ commInterface.allToAllV(&valsToSend[0],nbsend,nbsend2,MPI_DOUBLE,
+ bigArr,nbrecv,nbrecv2,MPI_DOUBLE,*comm);
+ fieldOutput->getArray()->fillWithZero();
+ INTERP_KERNEL::AutoPtr<double> tmp=new double[nbOfCompo];
+ for(int i=0;i<grpSize;i++)
+ {
+ if(nbrecv[i]>0)
+ {
+ double *pt=fieldOutput->getArray()->getPointer();
+ std::vector<int>::const_iterator it=std::find(_the_matrix_st_source_proc_id.begin(),_the_matrix_st_source_proc_id.end(),i);
+ if(it==_the_matrix_st_source_proc_id.end())
+ throw INTERP_KERNEL::Exception("Big problem !");
+ int id=std::distance(_the_matrix_st_source_proc_id.begin(),it);
+ const std::vector< std::map<int,double> >& mat=_the_matrix_st[id];
+ const std::vector< std::map<int,double> >& deno=_the_deno_st[id];
+ std::vector<int>::const_iterator isItem0=std::find(_trg_proc_st2.begin(),_trg_proc_st2.end(),i);
+ if(isItem0==_trg_proc_st2.end())//item1 of step2 main algo [ (0,1) computed on proc1 and Matrix-Vector on proc1 ]
+ {
+ int nbOfTrgTuples=mat.size();
+ for(int j=0;j<nbOfTrgTuples;j++,pt+=nbOfCompo)
+ {
+ const std::map<int,double>& mat1=mat[j];
+ const std::map<int,double>& deno1=deno[j];
+ std::map<int,double>::const_iterator it4=deno1.begin();
+ for(std::map<int,double>::const_iterator it3=mat1.begin();it3!=mat1.end();it3++,it4++)
+ {
+ std::transform(bigArr+nbrecv2[i]+((*it3).first)*nbOfCompo,bigArr+nbrecv2[i]+((*it3).first+1)*(nbOfCompo),(double *)tmp,std::bind2nd(std::multiplies<double>(),(*it3).second/(*it4).second));
+ std::transform((double *)tmp,(double *)tmp+nbOfCompo,pt,pt,std::plus<double>());
+ }
+ }
+ }
+ else
+ {//item0 of step2 main algo [ (2,1) computed on proc2 but Matrix-Vector on proc1 ]
+ double *pt=fieldOutput->getArray()->getPointer();
+ std::map<int,int> zipCor;
+ int id=std::distance(_src_ids_zip_proc_st2.begin(),std::find(_src_ids_zip_proc_st2.begin(),_src_ids_zip_proc_st2.end(),i));
+ const std::vector<int> zipIds=_src_ids_zip_st2[id];
+ int newId=0;
+ for(std::vector<int>::const_iterator it=zipIds.begin();it!=zipIds.end();it++,newId++)
+ zipCor[*it]=newId;
+ int id2=std::distance(_trg_proc_st2.begin(),std::find(_trg_proc_st2.begin(),_trg_proc_st2.end(),i));
+ const DataArrayInt *tgrIds=_trg_ids_st2[id2];
+ const int *tgrIds2=tgrIds->getConstPointer();
+ int nbOfTrgTuples=mat.size();
+ for(int j=0;j<nbOfTrgTuples;j++)
+ {
+ const std::map<int,double>& mat1=mat[j];
+ const std::map<int,double>& deno1=deno[j];
+ std::map<int,double>::const_iterator it5=deno1.begin();
+ for(std::map<int,double>::const_iterator it3=mat1.begin();it3!=mat1.end();it3++,it5++)
+ {
+ std::map<int,int>::const_iterator it4=zipCor.find((*it3).first);
+ if(it4==zipCor.end())
+ throw INTERP_KERNEL::Exception("Hmmmmm send e mail to anthony.geay@cea.fr !");
+ std::transform(bigArr+nbrecv2[i]+((*it4).second)*nbOfCompo,bigArr+nbrecv2[i]+((*it4).second+1)*(nbOfCompo),(double *)tmp,std::bind2nd(std::multiplies<double>(),(*it3).second/(*it5).second));
+ std::transform((double *)tmp,(double *)tmp+nbOfCompo,pt+tgrIds2[j]*nbOfCompo,pt+tgrIds2[j]*nbOfCompo,std::plus<double>());
+ }
+ }
+ }
+ }
+ }
+}
+
+/*!
+ * This method performs a transpose multiply of 'fieldInput' and put the result into 'fieldOutput'.
+ * 'fieldInput' is expected to be the targetfield and 'fieldOutput' the sourcefield.
+ */
+void OverlapMapping::transposeMultiply(const MEDCouplingFieldDouble *fieldInput, MEDCouplingFieldDouble *fieldOutput)
+{
+}
+
+/*!
+ * This method should be called immediately after _the_matrix_st has been filled with remote computed matrix put in this proc for Matrix-Vector.
+ * This method computes for these matrix the minimal set of source ids corresponding to the source proc id.
+ */
+void OverlapMapping::updateZipSourceIdsForFuture()
+{
+ CommInterface commInterface=_group.getCommInterface();
+ int myProcId=_group.myRank();
+ int nbOfMatrixRecveived=_the_matrix_st_source_proc_id.size();
+ for(int i=0;i<nbOfMatrixRecveived;i++)
+ {
+ int curSrcProcId=_the_matrix_st_source_proc_id[i];
+ if(curSrcProcId!=myProcId)
+ {
+ const std::vector< std::map<int,double> >& mat=_the_matrix_st[i];
+ _src_ids_zip_proc_st2.push_back(curSrcProcId);
+ _src_ids_zip_st2.resize(_src_ids_zip_st2.size()+1);
+ std::set<int> s;
+ for(std::vector< std::map<int,double> >::const_iterator it1=mat.begin();it1!=mat.end();it1++)
+ for(std::map<int,double>::const_iterator it2=(*it1).begin();it2!=(*it1).end();it2++)
+ s.insert((*it2).first);
+ _src_ids_zip_st2.back().insert(_src_ids_zip_st2.back().end(),s.begin(),s.end());
+ }
+ }
+}
+
+// #include <iostream>
+
+// void OverlapMapping::printTheMatrix() const
+// {
+// CommInterface commInterface=_group.getCommInterface();
+// const MPIProcessorGroup *group=static_cast<const MPIProcessorGroup*>(&_group);
+// const MPI_Comm *comm=group->getComm();
+// int grpSize=_group.size();
+// int myProcId=_group.myRank();
+// std::cerr << "I am proc #" << myProcId << std::endl;
+// int nbOfMat=_the_matrix_st.size();
+// std::cerr << "I do manage " << nbOfMat << "matrix : "<< std::endl;
+// for(int i=0;i<nbOfMat;i++)
+// {
+// std::cerr << " - Matrix #" << i << " on source proc #" << _the_matrix_st_source_proc_id[i];
+// const std::vector< std::map<int,double> >& locMat=_the_matrix_st[i];
+// for(std::vector< std::map<int,double> >::const_iterator it1=locMat.begin();it1!=locMat.end();it1++)
+// {
+// for(std::map<int,double>::const_iterator it2=(*it1).begin();it2!=(*it1).end();it2++)
+// std::cerr << "(" << (*it2).first << "," << (*it2).second << "), ";
+// std::cerr << std::endl;
+// }
+// }
+// std::cerr << "*********" << std::endl;
+// }
--- /dev/null
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+//
+// 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
+//
+
+#ifndef __OVERLAPMAPPING_HXX__
+#define __OVERLAPMAPPING_HXX__
+
+#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+
+#include <vector>
+#include <map>
+
+namespace ParaMEDMEM
+{
+ class ProcessorGroup;
+ class DataArrayInt;
+ class MEDCouplingFieldDouble;
+
+ class OverlapMapping
+ {
+ public:
+ OverlapMapping(const ProcessorGroup& group);
+ void keepTracksOfSourceIds(int procId, DataArrayInt *ids);
+ void keepTracksOfTargetIds(int procId, DataArrayInt *ids);
+ void addContributionST(const std::vector< std::map<int,double> >& matrixST, const DataArrayInt *srcIds, int srcProcId, const DataArrayInt *trgIds, int trgProcId);
+ void prepare(const std::vector< std::vector<int> >& procsInInteraction, int nbOfTrgElems);
+ void computeDenoConservativeVolumic(int nbOfTuplesTrg);
+ void computeDenoGlobConstraint();
+ //
+ void multiply(const MEDCouplingFieldDouble *fieldInput, MEDCouplingFieldDouble *fieldOutput) const;
+ void transposeMultiply(const MEDCouplingFieldDouble *fieldInput, MEDCouplingFieldDouble *fieldOutput);
+ private:
+ void serializeMatrixStep0ST(const int *nbOfElemsSrc, int *&bigArr, int *count, int *offsets,
+ int *countForRecv, int *offsetsForRecv) const;
+ int serializeMatrixStep1ST(const int *nbOfElemsSrc, const int *recvStep0, const int *countStep0, const int *offsStep0,
+ int *&bigArrI, double *&bigArrD, int *count, int *offsets,
+ int *countForRecv, int *offsForRecv) const;
+ void unserializationST(int nbOfTrgElems, const int *nbOfElemsSrcPerProc, const int *bigArrRecv, const int *bigArrRecvCounts, const int *bigArrRecvOffs,
+ const int *bigArrRecv2, const double *bigArrDRecv2, const int *bigArrRecv2Count, const int *bigArrRecv2Offs);
+ void finishToFillFinalMatrixST();
+ void prepareIdsToSendST();
+ void updateZipSourceIdsForFuture();
+ //void printTheMatrix() const;
+ private:
+ const ProcessorGroup &_group;
+ //! vector of ids
+ std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > _src_ids_st2;//item #1
+ std::vector< int > _src_proc_st2;//item #1
+ std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > _trg_ids_st2;//item #0
+ std::vector< int > _trg_proc_st2;//item #0
+ std::vector< int > _nb_of_src_ids_proc_st2;//item #1
+ std::vector< int > _src_ids_proc_st2;//item #1
+ std::vector< std::vector<int> > _src_ids_zip_st2;//same size as _src_ids_zip_proc_st2. Sorted. specifies for each id the corresponding ids to send. This is for item0 of Step2 of main algorithm
+ std::vector< int > _src_ids_zip_proc_st2;
+ //! vector of matrixes the first entry correspond to source proc id in _source_ids_st
+ std::vector< std::vector< std::map<int,double> > > _matrixes_st;
+ std::vector< std::vector<int> > _source_ids_st;
+ std::vector< int > _source_proc_id_st;
+ std::vector< std::vector<int> > _target_ids_st;
+ std::vector< int > _target_proc_id_st;
+ //! the matrix for matrix-vector product. The first dimension the set of target procs that interacts with local source mesh. The second dimension correspond to nb of local source ids.
+ std::vector< std::vector< std::map<int,double> > > _the_matrix_st;
+ std::vector< int > _the_matrix_st_source_proc_id;
+ std::vector< std::vector<int> > _the_matrix_st_source_ids;
+ std::vector< std::vector< std::map<int,double> > > _the_deno_st;
+ //! this attribute stores the proc ids that wait for data from this proc ids for matrix-vector computation
+ std::vector< int > _proc_ids_to_send_vector_st;
+ std::vector< int > _proc_ids_to_recv_vector_st;
+ //! this attribute is of size _group.size(); for each procId in _group _source_ids_to_send_st[procId] contains tupleId to send abroad
+ std::vector< std::vector<int> > _source_ids_to_send_st;
+ };
+}
+
+#endif
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "Topology.hxx"
void ParaFIELD::synchronizeTarget(ParaFIELD* source_field)
{
- DEC* data_channel;
+ DisjointDEC* data_channel;
if (dynamic_cast<BlockTopology*>(_topology)!=0)
{
data_channel=new StructuredCoincidentDEC;
void ParaFIELD::synchronizeSource(ParaFIELD* target_field)
{
- DEC* data_channel;
+ DisjointDEC* data_channel;
if (dynamic_cast<BlockTopology*>(_topology)!=0)
{
data_channel=new StructuredCoincidentDEC;
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef __PARAFIELD_HXX__
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "ParaGRID.hxx"
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef __PARAGRID_HXX__
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "ParaMESH.hxx"
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef __PARAMESH_HXX__
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "ProcessorGroup.hxx"
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef __PROCESSORGROUP_HXX__
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <mpi.h>
the computation is much faster than the other. It can also be used
to couple together codes that share an interface that was generated
in the same manner (with identical global ids).
- Also, this DEC can be used for fields that have component topologies,
+ Also, this \ref dec can be used for fields that have component topologies,
i.e., components that are scattered over several processors.
The remapping between the two supports is based on identity of global
ids, instead of geometrical considerations as it is the case for
- NonCoincidentDEC and InterpKernelDEC. Therefore, this DEC must not be used
+ \ref NonCoincidentDEC and \ref InterpKernelDEC. Therefore, this \ref dec must not be used
for coincident meshes that do not have the same numbering.
As all the other DECs, its use is made of two phases :
- a send/recv phase during which the field data is actually transferred.
This example illustrates the sending of a field with
- the DEC :
+ the \c StructuredCoincidentDEC :
\code
...
StructuredCoincidentDEC dec(groupA, groupB);
\addtogroup structuredcoincidentdec
@{
*/
- StructuredCoincidentDEC::StructuredCoincidentDEC(ProcessorGroup& local_group, ProcessorGroup& distant_group):DEC(local_group,distant_group),
+ StructuredCoincidentDEC::StructuredCoincidentDEC(ProcessorGroup& local_group, ProcessorGroup& distant_group):DisjointDEC(local_group,distant_group),
_topo_source(0),_topo_target(0),
_send_counts(0),_recv_counts(0),
_send_displs(0),_recv_displs(0),
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef __STRUCTUREDCOINCIDENTDEC_HXX__
#define __STRUCTUREDCOINCIDENTDEC_HXX__
-#include "DEC.hxx"
+#include "DisjointDEC.hxx"
#include "BlockTopology.hxx"
{
class DEC;
class BlockTopology;
- class StructuredCoincidentDEC : public DEC
+ class StructuredCoincidentDEC : public DisjointDEC
{
public:
StructuredCoincidentDEC();
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "TimeInterpolator.hxx"
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef __TIMEINTERPOLATOR_HXX__
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "Topology.hxx"
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef __TOPOLOGY_HXX__
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "MPI2Connector.hxx"
#include <iostream>
+#include <cstring>
MPI2Connector::MPI2Connector()
{
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef __MPI2CONNECTOR_HXX__
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "MPIAccessDECTest.hxx"
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef _MPIACCESSDECTEST_HXX_
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "MPIAccessTest.hxx"
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef _MPIACCESSTEST_HXX_
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef _MPIMAINTEST_HXX_
-# Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+# 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
ParaMEDMEMTest_Gauthier1.cxx \
ParaMEDMEMTest_FabienAPI.cxx \
ParaMEDMEMTest_NonCoincidentDEC.cxx \
+ ParaMEDMEMTest_OverlapDEC.cxx \
MPIAccessDECTest.cxx \
test_AllToAllDEC.cxx \
test_AllToAllvDEC.cxx \
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "ParaMEDMEMTest.hxx"
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef _ParaMEDMEMTEST_HXX_
CPPUNIT_TEST(testInterpKernelDEC2DM1D_P0P0);
CPPUNIT_TEST(testInterpKernelDECPartialProcs);
CPPUNIT_TEST(testInterpKernelDEC3DSurfEmptyBBox);
+ CPPUNIT_TEST(testOverlapDEC1);
CPPUNIT_TEST(testSynchronousEqualInterpKernelWithoutInterpNativeDEC_2D);
CPPUNIT_TEST(testSynchronousEqualInterpKernelWithoutInterpDEC_2D);
void testInterpKernelDEC2DM1D_P0P0();
void testInterpKernelDECPartialProcs();
void testInterpKernelDEC3DSurfEmptyBBox();
+ void testOverlapDEC1();
#ifdef MED_ENABLE_FVM
void testNonCoincidentDEC_2D();
void testNonCoincidentDEC_3D();
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <cppunit/extensions/HelperMacros.h>
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <cppunit/extensions/HelperMacros.h>
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "ParaMEDMEMTest.hxx"
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "ParaMEDMEMTest.hxx"
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "ParaMEDMEMTest.hxx"
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "ParaMEDMEMTest.hxx"
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "ParaMEDMEMTest.hxx"
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "ParaMEDMEMTest.hxx"
void ParaMEDMEMTest::testMEDLoaderRead1()
{
- string fileName=getResourceFile("pointe_import22.med");
+ string fileName=getResourceFile("pointe.med");
vector<string> meshNames=MEDLoader::GetMeshNames(fileName.c_str());
CPPUNIT_ASSERT_EQUAL(1,(int)meshNames.size());
MEDCouplingUMesh *mesh=MEDLoader::ReadUMeshFromFile(fileName.c_str(),meshNames[0].c_str(),0);
CPPUNIT_ASSERT(fieldsNameNode[1]=="fieldnodeint");
std::vector<std::pair<int,int> > its0Node=MEDLoader::GetNodeFieldIterations(fileName.c_str(),meshNames[0].c_str(),fieldsNameNode[0].c_str());
CPPUNIT_ASSERT_EQUAL(3,(int)its0Node.size());
- CPPUNIT_ASSERT_EQUAL(1,its0Node[0].first);
+ CPPUNIT_ASSERT_EQUAL(-1,its0Node[0].first);
CPPUNIT_ASSERT_EQUAL(-1,its0Node[0].second);
- CPPUNIT_ASSERT_EQUAL(2,its0Node[1].first);
+ CPPUNIT_ASSERT_EQUAL(1,its0Node[1].first);
CPPUNIT_ASSERT_EQUAL(-1,its0Node[1].second);
- CPPUNIT_ASSERT_EQUAL(-1,its0Node[2].first);//strange but like that
+ CPPUNIT_ASSERT_EQUAL(2,its0Node[2].first);
CPPUNIT_ASSERT_EQUAL(-1,its0Node[2].second);
MEDCouplingFieldDouble *field0Nodes=MEDLoader::ReadFieldNode(fileName.c_str(),meshNames[0].c_str(),0,fieldsNameNode[0].c_str(),its0Node[0].first,its0Node[0].second);
field0Nodes->checkCoherency();
CPPUNIT_ASSERT(constMesh);
field0Nodes->decrRef();
//
- field0Nodes=MEDLoader::ReadFieldNode(fileName.c_str(),meshNames[0].c_str(),0,fieldsNameNode[0].c_str(),its0Node[1].first,its0Node[1].second);
+ field0Nodes=MEDLoader::ReadFieldNode(fileName.c_str(),meshNames[0].c_str(),0,fieldsNameNode[0].c_str(),its0Node[2].first,its0Node[2].second);
field0Nodes->checkCoherency();
CPPUNIT_ASSERT(field0Nodes->getName()==fieldsNameNode[0]);
CPPUNIT_ASSERT_EQUAL(1,field0Nodes->getNumberOfComponents());
CPPUNIT_ASSERT_DOUBLES_EQUAL(46.,std::accumulate(constMesh->getCoords()->getPointer(),constMesh->getCoords()->getPointer()+57,0),1e-12);
field0Nodes->decrRef();
//
- field0Nodes=MEDLoader::ReadFieldNode(fileName.c_str(),meshNames[0].c_str(),0,fieldsNameNode[0].c_str(),its0Node[2].first,its0Node[2].second);
+ field0Nodes=MEDLoader::ReadFieldNode(fileName.c_str(),meshNames[0].c_str(),0,fieldsNameNode[0].c_str(),its0Node[0].first,its0Node[0].second);
field0Nodes->checkCoherency();
CPPUNIT_ASSERT(field0Nodes->getName()==fieldsNameNode[0]);
CPPUNIT_ASSERT_EQUAL(1,field0Nodes->getNumberOfComponents());
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "ParaMEDMEMTest.hxx"
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifdef MED_ENABLE_FVM
--- /dev/null
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+//
+// 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
+//
+
+#include "ParaMEDMEMTest.hxx"
+#include <cppunit/TestAssert.h>
+
+#include "CommInterface.hxx"
+#include "ProcessorGroup.hxx"
+#include "MPIProcessorGroup.hxx"
+#include "Topology.hxx"
+#include "OverlapDEC.hxx"
+#include "ParaMESH.hxx"
+#include "ParaFIELD.hxx"
+#include "ComponentTopology.hxx"
+
+#include "MEDCouplingUMesh.hxx"
+
+#include <set>
+
+void ParaMEDMEMTest::testOverlapDEC1()
+{
+ std::string srcM("P0");
+ std::string targetM("P0");
+ int size;
+ int rank;
+ MPI_Comm_size(MPI_COMM_WORLD,&size);
+ MPI_Comm_rank(MPI_COMM_WORLD,&rank);
+
+ if (size != 3) return ;
+
+ int nproc = 3;
+ std::set<int> procs;
+
+ for (int i=0; i<nproc; i++)
+ procs.insert(i);
+
+ ParaMEDMEM::CommInterface interface;
+
+ ParaMEDMEM::OverlapDEC dec(procs);
+
+ ParaMEDMEM::MEDCouplingUMesh* meshS=0;
+ ParaMEDMEM::MEDCouplingUMesh* meshT=0;
+ ParaMEDMEM::ParaMESH* parameshS=0;
+ ParaMEDMEM::ParaMESH* parameshT=0;
+ ParaMEDMEM::ParaFIELD* parafieldS=0;
+ ParaMEDMEM::ParaFIELD* parafieldT=0;
+
+ MPI_Barrier(MPI_COMM_WORLD);
+ if(rank==0)
+ {
+ const double coordsS[10]={0.,0.,0.5,0.,1.,0.,0.,0.5,0.5,0.5};
+ const double coordsT[6]={0.,0.,1.,0.,1.,1.};
+ meshS=ParaMEDMEM::MEDCouplingUMesh::New();
+ meshS->setMeshDimension(2);
+ ParaMEDMEM::DataArrayDouble *myCoords=ParaMEDMEM::DataArrayDouble::New();
+ myCoords->alloc(5,2);
+ std::copy(coordsS,coordsS+10,myCoords->getPointer());
+ meshS->setCoords(myCoords);
+ myCoords->decrRef();
+ int connS[7]={0,3,4,1, 1,4,2};
+ meshS->allocateCells(2);
+ meshS->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,connS);
+ meshS->insertNextCell(INTERP_KERNEL::NORM_TRI3,3,connS+4);
+ meshS->finishInsertingCells();
+ ParaMEDMEM::ComponentTopology comptopo;
+ parameshS=new ParaMEDMEM::ParaMESH(meshS,*dec.getGrp(),"source mesh");
+ parafieldS=new ParaMEDMEM::ParaFIELD(ParaMEDMEM::ON_CELLS,ParaMEDMEM::NO_TIME,parameshS,comptopo);
+ parafieldS->getField()->setNature(ParaMEDMEM::ConservativeVolumic);//IntegralGlobConstraint
+ double *valsS=parafieldS->getField()->getArray()->getPointer();
+ valsS[0]=7.; valsS[1]=8.;
+ //
+ meshT=ParaMEDMEM::MEDCouplingUMesh::New();
+ meshT->setMeshDimension(2);
+ myCoords=ParaMEDMEM::DataArrayDouble::New();
+ myCoords->alloc(3,2);
+ std::copy(coordsT,coordsT+6,myCoords->getPointer());
+ meshT->setCoords(myCoords);
+ myCoords->decrRef();
+ int connT[3]={0,2,1};
+ meshT->allocateCells(1);
+ meshT->insertNextCell(INTERP_KERNEL::NORM_TRI3,3,connT);
+ meshT->finishInsertingCells();
+ parameshT=new ParaMEDMEM::ParaMESH(meshT,*dec.getGrp(),"target mesh");
+ parafieldT=new ParaMEDMEM::ParaFIELD(ParaMEDMEM::ON_CELLS,ParaMEDMEM::NO_TIME,parameshT,comptopo);
+ parafieldT->getField()->setNature(ParaMEDMEM::ConservativeVolumic);//IntegralGlobConstraint
+ double *valsT=parafieldT->getField()->getArray()->getPointer();
+ valsT[0]=7.;
+ }
+ //
+ if(rank==1)
+ {
+ const double coordsS[10]={1.,0.,0.5,0.5,1.,0.5,0.5,1.,1.,1.};
+ const double coordsT[6]={0.,0.,0.5,0.5,0.,1.};
+ meshS=ParaMEDMEM::MEDCouplingUMesh::New();
+ meshS->setMeshDimension(2);
+ ParaMEDMEM::DataArrayDouble *myCoords=ParaMEDMEM::DataArrayDouble::New();
+ myCoords->alloc(5,2);
+ std::copy(coordsS,coordsS+10,myCoords->getPointer());
+ meshS->setCoords(myCoords);
+ myCoords->decrRef();
+ int connS[7]={0,1,2, 1,3,4,2};
+ meshS->allocateCells(2);
+ meshS->insertNextCell(INTERP_KERNEL::NORM_TRI3,3,connS);
+ meshS->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,connS+3);
+ meshS->finishInsertingCells();
+ ParaMEDMEM::ComponentTopology comptopo;
+ parameshS=new ParaMEDMEM::ParaMESH(meshS,*dec.getGrp(),"source mesh");
+ parafieldS=new ParaMEDMEM::ParaFIELD(ParaMEDMEM::ON_CELLS,ParaMEDMEM::NO_TIME,parameshS,comptopo);
+ parafieldS->getField()->setNature(ParaMEDMEM::ConservativeVolumic);//IntegralGlobConstraint
+ double *valsS=parafieldS->getField()->getArray()->getPointer();
+ valsS[0]=9.; valsS[1]=11.;
+ //
+ meshT=ParaMEDMEM::MEDCouplingUMesh::New();
+ meshT->setMeshDimension(2);
+ myCoords=ParaMEDMEM::DataArrayDouble::New();
+ myCoords->alloc(3,2);
+ std::copy(coordsT,coordsT+6,myCoords->getPointer());
+ meshT->setCoords(myCoords);
+ myCoords->decrRef();
+ int connT[3]={0,2,1};
+ meshT->allocateCells(1);
+ meshT->insertNextCell(INTERP_KERNEL::NORM_TRI3,3,connT);
+ meshT->finishInsertingCells();
+ parameshT=new ParaMEDMEM::ParaMESH(meshT,*dec.getGrp(),"target mesh");
+ parafieldT=new ParaMEDMEM::ParaFIELD(ParaMEDMEM::ON_CELLS,ParaMEDMEM::NO_TIME,parameshT,comptopo);
+ parafieldT->getField()->setNature(ParaMEDMEM::ConservativeVolumic);//IntegralGlobConstraint
+ double *valsT=parafieldT->getField()->getArray()->getPointer();
+ valsT[0]=8.;
+ }
+ //
+ if(rank==2)
+ {
+ const double coordsS[8]={0.,0.5, 0.5,0.5, 0.,1., 0.5,1.};
+ const double coordsT[6]={0.5,0.5,0.,1.,1.,1.};
+ meshS=ParaMEDMEM::MEDCouplingUMesh::New();
+ meshS->setMeshDimension(2);
+ ParaMEDMEM::DataArrayDouble *myCoords=ParaMEDMEM::DataArrayDouble::New();
+ myCoords->alloc(4,2);
+ std::copy(coordsS,coordsS+8,myCoords->getPointer());
+ meshS->setCoords(myCoords);
+ myCoords->decrRef();
+ int connS[4]={0,2,3,1};
+ meshS->allocateCells(1);
+ meshS->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,connS);
+ meshS->finishInsertingCells();
+ ParaMEDMEM::ComponentTopology comptopo;
+ parameshS=new ParaMEDMEM::ParaMESH(meshS,*dec.getGrp(),"source mesh");
+ parafieldS=new ParaMEDMEM::ParaFIELD(ParaMEDMEM::ON_CELLS,ParaMEDMEM::NO_TIME,parameshS,comptopo);
+ parafieldS->getField()->setNature(ParaMEDMEM::ConservativeVolumic);//IntegralGlobConstraint
+ double *valsS=parafieldS->getField()->getArray()->getPointer();
+ valsS[0]=10.;
+ //
+ meshT=ParaMEDMEM::MEDCouplingUMesh::New();
+ meshT->setMeshDimension(2);
+ myCoords=ParaMEDMEM::DataArrayDouble::New();
+ myCoords->alloc(3,2);
+ std::copy(coordsT,coordsT+6,myCoords->getPointer());
+ meshT->setCoords(myCoords);
+ myCoords->decrRef();
+ int connT[3]={0,1,2};
+ meshT->allocateCells(1);
+ meshT->insertNextCell(INTERP_KERNEL::NORM_TRI3,3,connT);
+ meshT->finishInsertingCells();
+ parameshT=new ParaMEDMEM::ParaMESH(meshT,*dec.getGrp(),"target mesh");
+ parafieldT=new ParaMEDMEM::ParaFIELD(ParaMEDMEM::ON_CELLS,ParaMEDMEM::NO_TIME,parameshT,comptopo);
+ parafieldT->getField()->setNature(ParaMEDMEM::ConservativeVolumic);//IntegralGlobConstraint
+ double *valsT=parafieldT->getField()->getArray()->getPointer();
+ valsT[0]=9.;
+ }
+ dec.attachSourceLocalField(parafieldS);
+ dec.attachTargetLocalField(parafieldT);
+ dec.synchronize();
+ dec.sendRecvData(true);
+ //
+ if(rank==0)
+ {
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(8.75,parafieldT->getField()->getArray()->getIJ(0,0),1e-12);
+ }
+ if(rank==1)
+ {
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(8.5,parafieldT->getField()->getArray()->getIJ(0,0),1e-12);
+ }
+ if(rank==2)
+ {
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(10.5,parafieldT->getField()->getArray()->getIJ(0,0),1e-12);
+ }
+ delete parafieldS;
+ delete parafieldT;
+ delete parameshS;
+ delete parameshT;
+ meshS->decrRef();
+ meshT->decrRef();
+
+ MPI_Barrier(MPI_COMM_WORLD);
+}
+
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "ParaMEDMEMTest.hxx"
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// --- include all MPIAccess Test
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// --- include all MPIAccessDEC Test
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// --- include all MEDMEM Test
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <string>
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <string>
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <string>
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <string>
#include <map>
#include <iostream>
#include <mpi.h>
-#include <time.h>
+#include <ctime>
#include "MPIAccessDECTest.hxx"
#include <cppunit/TestAssert.h>
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <math.h>
#include <map>
#include <iostream>
#include <mpi.h>
-#include <time.h>
+#include <ctime>
#include "MPIAccessDECTest.hxx"
#include <cppunit/TestAssert.h>
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <time.h>
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <string>
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <string>
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <time.h>
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <string>
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <string>
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <time.h>
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <string>
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <string>
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <string>
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <string>
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <string>
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <string>
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <string>
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <string>
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <time.h>
-# Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+# 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
# MED MEDMEM_SWIG : binding of C++ implementation and Python
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
-lib_LTLIBRARIES = _ParaMEDMEM.la
+salomepython_PYTHON = ParaMEDMEM.py
+salomepyexec_LTLIBRARIES = _ParaMEDMEM.la
salomeinclude_HEADERS = \
ParaMEDMEM.i
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+# 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
from ParaMEDMEM import *
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+# 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
from ParaMEDMEM import *
-# Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+# 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
# MED MEDMEM : MED files in memory
librenumber_la_CPPFLAGS= $(MED2_INCLUDES) $(HDF5_INCLUDES) @CXXTMPDPTHFLAGS@ \
$(BOOST_CPPFLAGS) \
-I$(srcdir)/../MEDMEM -I$(srcdir)/../MEDWrapper/V2_1/Core -I$(srcdir)/../INTERP_KERNEL/Bases \
- -I$(srcdir)/../INTERP_KERNEL/GaussPoints
+ -I$(srcdir)/../INTERP_KERNEL/GaussPoints \
+ -I$(srcdir)/../INTERP_KERNEL
librenumber_la_LDFLAGS=
#libmedsplitter_la_LDFLAGS= $(MED2_LIBS) $(HDF5_LIBS) $(STDLIB) \
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <boost/config.hpp>
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef BOOSTRENUMBERING_HXX_
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifdef ENABLE_PARMETIS
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef METISRENUMBERING_HXX_
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef RENUMBERING_HXX_
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "RenumberingFactory.hxx"
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef RENUMBERINGFACTORY_HXX_
-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <string>
#include "MEDMEM_Connectivity.hxx"
#include "MEDMEM_Field.hxx"
#include "MEDMEM_DriversDef.hxx"
-#include "MEDMEM_Med.hxx"
-#include "MEDMEM_MedMeshDriver22.hxx"
+#include "MEDMEM_MedFileBrowser.hxx"
+#include "MEDMEM_MedMeshDriver.hxx"
#include "RenumberingFactory.hxx"
conn->calculateFullDescendingConnectivity(MED_CELL);
const int* rev_conn=mesh->getReverseConnectivity(MED_EN::MED_DESCENDING, MED_EN::MED_CELL);
const int* rev_conn_index=mesh->getReverseConnectivityIndex(MED_EN::MED_DESCENDING, MED_EN::MED_CELL);
- int nb_face= mesh->getNumberOfElementsWithPoly(MED_FACE,MED_ALL_ELEMENTS);
- int nb_edge = mesh->getNumberOfElementsWithPoly(MED_EDGE,MED_ALL_ELEMENTS);
- nb_cell= mesh->getNumberOfElementsWithPoly(MED_CELL,Type);
+ int nb_face= mesh->getNumberOfElements(MED_FACE,MED_ALL_ELEMENTS);
+ int nb_edge = mesh->getNumberOfElements(MED_EDGE,MED_ALL_ELEMENTS);
+ nb_cell= mesh->getNumberOfElements(MED_CELL,Type);
int nb_constituent;
if(mesh->getMeshDimension()==2)
void changeConnectivity(MESH& mesh, const medGeometryElement& Type, const int& nb_cell, const vector<int>& iperm)
{
- if(Type==MED_POLYHEDRA)
+ /*if(Type==MED_POLYHEDRA)
{
int *conn_face_index_init=(int*)mesh.getPolyhedronFacesIndex();
int *conn_index_init=(int*)mesh.getPolyhedronIndex(MED_FULL_INTERLACE);
delete[] conn_renum;
delete[] conn_index_renum;
}
- else
+ else*/
{
- const int *conn_init=mesh.getConnectivity(MED_FULL_INTERLACE,MED_NODAL,MED_CELL,Type);
+ const int *conn_init=mesh.getConnectivity(MED_NODAL,MED_CELL,Type);
const int *conn_index_init=mesh.getConnectivityIndex(MED_NODAL,MED_CELL);
int *conn_renum=new int[conn_index_init[nb_cell]-1];
int *conn_index_renum=new int[nb_cell+1];
}
CONNECTIVITY* myConnectivity=(CONNECTIVITY*)mesh.getConnectivityptr();
- myConnectivity->setNodal(conn_renum,MED_CELL,Type);
+ myConnectivity->setNodal(conn_renum,MED_CELL,Type,conn_index_renum);
delete[] conn_renum;
delete[] conn_index_renum;
}
system(s.c_str());
// Reading file structure
- const MED med_struct (MED_DRIVER,filename_in);
+ const MEDFILEBROWSER med_struct(filename_in);
int nb_mesh, nb_fields;
- deque<string> mesh_names,f_names;
+ vector<string> mesh_names,f_names;
nb_mesh=med_struct.getNumberOfMeshes();
nb_fields=med_struct.getNumberOfFields();
mesh_names=med_struct.getMeshNames();
int nb_fields_tot=0;
for (int ifield = 0; ifield < nb_fields; ifield++)
{
- deque<DT_IT_> dtit=med_struct.getFieldIteration(f_names[ifield]);
- for (deque<DT_IT_>::const_iterator iter =dtit.begin(); iter!=dtit.end(); iter++)
+ vector<DT_IT_> dtit=med_struct.getFieldIteration(f_names[ifield]);
+ for (vector<DT_IT_>::const_iterator iter =dtit.begin(); iter!=dtit.end(); iter++)
{
field_names.push_back(f_names[ifield]);
iternumber.push_back(iter->dt);
ordernumber.push_back(iter->it);
++nb_fields_tot;
- FIELD_* field = med_struct.getField(f_names[ifield],iter->dt,iter->it);
- if (dynamic_cast<FIELD<double>*>(field))
+ if(med_struct.getFieldType(f_names[ifield])==MED_EN::MED_REEL64)
types.push_back(1);
else
types.push_back(0);
// Reading mesh
MESH myMesh;
myMesh.setName(meshname);
- MED_MESH_RDONLY_DRIVER22 *drv22=new MED_MESH_RDONLY_DRIVER22(filename_in,&myMesh);
+ MED_MESH_RDONLY_DRIVER *drv22=new MED_MESH_RDONLY_DRIVER(filename_in,&myMesh);
drv22->desactivateFacesComputation();
int newDrv=myMesh.addDriver(*drv22);
delete drv22;
myMesh.read(newDrv);
- int nb_type=myMesh.getNumberOfTypesWithPoly(MED_CELL);
+ int nb_type=myMesh.getNumberOfTypes(MED_CELL);
if (nb_type!=1)
{
cout << "Mesh must have only one type of cell" << endl;
return -1;
}
- medGeometryElement *Types = myMesh.getTypesWithPoly(MED_CELL);
+ const medGeometryElement *Types = myMesh.getTypes(MED_CELL);
medGeometryElement Type=Types[0];
- delete[] Types;
t_read_mesh=clock();
MESH* workMesh=new MESH(myMesh);
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2010 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2011 CEA/DEN, EDF 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.
+# 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
from libMEDMEM_Swig import *
m = MESH(MED_DRIVER,dir_mesh+"/out_"+filename,meshname)
field_ini=[2,3,12,13,14,15,4,5,6,7,8,9,16,17,0,1,10,11]
-s = SUPPORT(m,"Support on all",MED_CELL)
+s = m.getSupportOnAll(MED_CELL)
f = FIELDDOUBLE(s,2)
id=f.addDriver(MED_DRIVER,dir_mesh+"/out_"+filename,"Test field")
f.read(id);
field=field&(f.getValueIJ(i+1,2)==field_ini[i*2+1])
f.rmDriver(id)
-nbcell2dboost=m.getNumberOfElementsWithPoly(MED_CELL,MED_ALL_ELEMENTS)
+nbcell2dboost=m.getNumberOfElements(MED_CELL,MED_ALL_ELEMENTS)
connectivite=[2,6,13,11,11,13,14,12,6,5,15,13,12,14,10,4,13,15,16,14,5,1,7,15,14,16,9,10,15,7,8,16,16,8,3,9]
connectivite_index=[1,5,9,13,17,21,25,29,33,37]
-conn=m.getConnectivity(MED_FULL_INTERLACE,MED_NODAL,MED_CELL,MED_QUAD4)
+conn=m.getConnectivity(MED_NODAL,MED_CELL,MED_QUAD4)
conn_index=m.getConnectivityIndex(MED_NODAL,MED_CELL);
-conn2dboost=(len(conn)==len(connectivite))
-if conn2dboost:
- for i in range(0,len(connectivite)):
- conn2dboost=conn2dboost&(conn[i]==connectivite[i])
-conn_index2dboost=(len(conn_index)==len(connectivite_index))
-if conn_index2dboost:
- for i in range(0,len(connectivite_index)):
- conn_index2dboost=conn_index2dboost&(conn_index[i]==connectivite_index[i])
-Boost2D=conn2dboost&conn_index2dboost&(nbcell2dboost==9)&field
+conn2dboost=(list(conn)==connectivite) # convert numpy.ndarray to list
+conn_index2dboost=(list(conn_index)==connectivite_index)
+Boost2D=conn2dboost and conn_index2dboost and (nbcell2dboost==9) and field
os.remove(dir_mesh+"/out_"+filename)
string_to_execute="'"+dir_renumber+" "+dir_mesh+"/"+filename+" "+meshname+" "+method+" "+dir_mesh+"/out_"+filename+"'"
eval("os.system("+string_to_execute+")")
m = MESH(MED_DRIVER,dir_mesh+"/out_"+filename,meshname)
-nbcell2dmetis=m.getNumberOfElementsWithPoly(MED_CELL,MED_ALL_ELEMENTS)
+nbcell2dmetis=m.getNumberOfElements(MED_CELL,MED_ALL_ELEMENTS)
connectivite=[12,14,10,4,2,6,13,11,11,13,14,12,16,8,3,9,5,1,7,15,15,7,8,16,14,16,9,10,6,5,15,13,13,15,16,14]
connectivite_index=[1,5,9,13,17,21,25,29,33,37]
-conn=m.getConnectivity(MED_FULL_INTERLACE,MED_NODAL,MED_CELL,MED_QUAD4)
+conn=m.getConnectivity(MED_NODAL,MED_CELL,MED_QUAD4)
conn_index=m.getConnectivityIndex(MED_NODAL,MED_CELL);
-conn2dmetis=(len(conn)==len(connectivite))
-if conn2dmetis:
- for i in range(0,len(connectivite)):
- conn2dmetis=conn2dmetis&(conn[i]==connectivite[i])
-conn_index2dmetis=(len(conn_index)==len(connectivite_index))
-if conn_index2dmetis:
- for i in range(0,len(connectivite_index)):
- conn_index2dmetis=conn_index2dmetis&(conn_index[i]==connectivite_index[i])
-Metis2D=conn2dmetis&conn_index2dmetis&(nbcell2dmetis==9)
+conn2dmetis=(list(conn)==connectivite)
+conn_index2dmetis=(list(conn_index)==connectivite_index)
+Metis2D=conn2dmetis and conn_index2dmetis and (nbcell2dmetis==9)
os.remove(dir_mesh+"/out_"+filename)
## *** Avec polygone ***
string_to_execute="'"+dir_renumber+" "+dir_mesh+"/"+filename+" "+meshname+" "+method+" "+dir_mesh+"/out_"+filename+"'"
eval("os.system("+string_to_execute+")")
m = MESH(MED_DRIVER,dir_mesh+"/out_"+filename,meshname)
-nbcell2dpolyboost=m.getNumberOfElementsWithPoly(MED_CELL,MED_ALL_ELEMENTS)
+nbcell2dpolyboost=m.getNumberOfElements(MED_CELL,MED_ALL_ELEMENTS)
connectivite=[2,5,9,10,11,10,9,12,5,6,8,9,4,11,12,16,12,9,8,13,6,1,7,8,16,12,13,15,13,8,7,14,15,13,14,3]
connectivite_index=[1,5,9,13,17,21,25,29,33,37]
-conn=m.getPolygonsConnectivity(MED_FULL_INTERLACE,MED_CELL)
-conn_index=m.getPolygonsConnectivityIndex(MED_FULL_INTERLACE,MED_CELL);
-conn2dpolyboost=(len(conn)==len(connectivite))
-if conn2dpolyboost:
- for i in range(0,len(connectivite)):
- conn2dpolyboost=conn2dpolyboost&(conn[i]==connectivite[i])
-conn_index2dpolyboost=(len(conn_index)==len(connectivite_index))
-if conn_index2dpolyboost:
- for i in range(0,len(connectivite_index)):
- conn_index2dpolyboost=conn_index2dpolyboost&(conn_index[i]==connectivite_index[i])
-PolyBoost2D=conn2dpolyboost&conn_index2dpolyboost&(nbcell2dpolyboost==9)
+conn=m.getConnectivity(MED_NODAL,MED_CELL,MED_POLYGON)
+conn_index=m.getConnectivityIndex(MED_NODAL,MED_CELL)
+conn2dpolyboost=(list(conn)==connectivite)
+conn_index2dpolyboost=(list(conn_index)==connectivite_index)
+PolyBoost2D=conn2dpolyboost and conn_index2dpolyboost and (nbcell2dpolyboost==9)
os.remove(dir_mesh+"/out_"+filename)
print "TEST 2D Metis with polygons"
string_to_execute="'"+dir_renumber+" "+dir_mesh+"/"+filename+" "+meshname+" "+method+" "+dir_mesh+"/out_"+filename+"'"
eval("os.system("+string_to_execute+")")
m = MESH(MED_DRIVER,dir_mesh+"/out_"+filename,meshname)
-nbcell2dpolymetis=m.getNumberOfElementsWithPoly(MED_CELL,MED_ALL_ELEMENTS)
+nbcell2dpolymetis=m.getNumberOfElements(MED_CELL,MED_ALL_ELEMENTS)
connectivite=[6,1,7,8,2,5,9,10,5,6,8,9,15,13,14,3,4,11,12,16,16,12,13,15,11,10,9,12,12,9,8,13,13,8,7,14]
connectivite_index=[1,5,9,13,17,21,25,29,33,37]
-conn=m.getPolygonsConnectivity(MED_FULL_INTERLACE,MED_CELL)
-conn_index=m.getPolygonsConnectivityIndex(MED_FULL_INTERLACE,MED_CELL);
-conn2dpolymetis=(len(conn)==len(connectivite))
-if conn2dpolymetis:
- for i in range(0,len(connectivite)):
- conn2dpolymetis=conn2dpolymetis&(conn[i]==connectivite[i])
-conn_index2dpolymetis=(len(conn_index)==len(connectivite_index))
-if conn_index2dpolymetis:
- for i in range(0,len(connectivite_index)):
- conn_index2dpolymetis=conn_index2dpolymetis&(conn_index[i]==connectivite_index[i])
-PolyMetis2D=conn2dpolymetis&conn_index2dpolymetis&(nbcell2dpolymetis==9)
+conn=m.getConnectivity(MED_NODAL,MED_CELL,MED_POLYGON)
+conn_index=m.getConnectivityIndex(MED_NODAL,MED_CELL)
+conn2dpolymetis=(list(conn)==connectivite)
+conn_index2dpolymetis=(list(conn_index)==connectivite_index)
+PolyMetis2D=conn2dpolymetis and conn_index2dpolymetis and (nbcell2dpolymetis==9)
os.remove(dir_mesh+"/out_"+filename)
string_to_execute="'"+dir_renumber+" "+dir_mesh+"/"+filename+" "+meshname+" "+method+" "+dir_mesh+"/out_"+filename+"'"
eval("os.system("+string_to_execute+")")
m = MESH(MED_DRIVER,dir_mesh+"/out_"+filename,meshname)
-nbcell3dboost=m.getNumberOfElementsWithPoly(MED_CELL,MED_ALL_ELEMENTS)
+nbcell3dboost=m.getNumberOfElements(MED_CELL,MED_ALL_ELEMENTS)
connectivite=[23,13,5,18,27,22,14,26,17,6,13,23,25,16,22,27,27,22,14,26,24,15,7,20,9,23,18,1,21,27,26,10,25,16,22,27,19,8,15,24,2,17,23,9,12,25,27,21,21,27,26,10,11,24,20,3,12,25,27,21,4,19,24,11]
connectivite_index=[1,9,17,25,33,41,49,57,65]
-conn=m.getConnectivity(MED_FULL_INTERLACE,MED_NODAL,MED_CELL,MED_HEXA8)
+conn=m.getConnectivity(MED_NODAL,MED_CELL,MED_HEXA8)
conn_index=m.getConnectivityIndex(MED_NODAL,MED_CELL);
-conn3dboost=(len(conn)==len(connectivite))
-if conn3dboost:
- for i in range(0,len(connectivite)):
- conn3dboost=conn3dboost&(conn[i]==connectivite[i])
-conn_index3dboost=(len(conn_index)==len(connectivite_index))
-if conn_index3dboost:
- for i in range(0,len(connectivite_index)):
- conn_index3dboost=conn_index3dboost&(conn_index[i]==connectivite_index[i])
-Boost3D=conn3dboost&conn_index3dboost&(nbcell3dboost==8)
+conn3dboost=(list(conn)==connectivite)
+conn_index3dboost=(list(conn_index)==connectivite_index)
+Boost3D=conn3dboost and conn_index3dboost and (nbcell3dboost==8)
os.remove(dir_mesh+"/out_"+filename)
string_to_execute="'"+dir_renumber+" "+dir_mesh+"/"+filename+" "+meshname+" "+method+" "+dir_mesh+"/out_"+filename+"'"
eval("os.system("+string_to_execute+")")
m = MESH(MED_DRIVER,dir_mesh+"/out_"+filename,meshname)
-nbcell3dmetis=m.getNumberOfElementsWithPoly(MED_CELL,MED_ALL_ELEMENTS)
+nbcell3dmetis=m.getNumberOfElements(MED_CELL,MED_ALL_ELEMENTS)
connectivite=[12,25,27,21,4,19,24,11,27,22,14,26,24,15,7,20,17,6,13,23,25,16,22,27,9,23,18,1,21,27,26,10,23,13,5,18,27,22,14,26,25,16,22,27,19,8,15,24,2,17,23,9,12,25,27,21,21,27,26,10,11,24,20,3]
connectivite_index=[1,9,17,25,33,41,49,57,65]
-conn=m.getConnectivity(MED_FULL_INTERLACE,MED_NODAL,MED_CELL,MED_HEXA8)
+conn=m.getConnectivity(MED_NODAL,MED_CELL,MED_HEXA8)
conn_index=m.getConnectivityIndex(MED_NODAL,MED_CELL);
-conn3dmetis=(len(conn)==len(connectivite))
-if conn3dmetis:
- for i in range(0,len(connectivite)):
- conn3dmetis=conn3dmetis&(conn[i]==connectivite[i])
-conn_index3dmetis=(len(conn_index)==len(connectivite_index))
-if conn_index3dmetis:
- for i in range(0,len(connectivite_index)):
- conn_index3dmetis=conn_index3dmetis&(conn_index[i]==connectivite_index[i])
+conn3dmetis=(list(conn)==connectivite)
+conn_index3dmetis=(list(conn_index)==connectivite_index)
Metis3D=conn3dmetis&conn_index3dmetis&(nbcell3dmetis==8)
os.remove(dir_mesh+"/out_"+filename)
string_to_execute="'"+dir_renumber+" "+dir_mesh+"/"+filename+" "+meshname+" "+method+" "+dir_mesh+"/out_"+filename+"'"
eval("os.system("+string_to_execute+")")
m = MESH(MED_DRIVER,dir_mesh+"/out_"+filename,meshname)
-nbcell3dpolyboost=m.getNumberOfElementsWithPoly(MED_CELL,MED_ALL_ELEMENTS)
-connectivite=[23,13,5,18,27,26,14,22,23,27,22,13,13,22,14,5,5,14,26,18,18,26,27,23,17,6,13,23,25,27,22,16,17,25,16,6,6,16,22,13,13,22,27,23,23,27,25,17,27,22,14,26,24,20,7,15,27,24,15,22,22,15,7,14,14,7,20,26,26,20,24,27,9,23,18,1,21,10,26,27,9,21,27,23,23,27,26,18,18,26,10,1,1,10,21,9,25,16,22,27,19,24,15,8,25,19,8,16,16,8,15,22,22,15,24,27,27,24,19,25,2,17,23,9,12,21,27,25,2,12,25,17,17,25,27,23,23,27,21,9,9,21,12,2,21,27,26,10,11,3,20,24,21,11,24,27,27,24,20,26,26,20,3,10,10,3,11,21,12,25,27,21,4,11,24,19,12,4,19,25,25,19,24,27,27,24,11,21,21,11,4,12]
-connectivite_face_index=[1,5,9,13,17,21,25,29,33,37,41,45,49,53,57,61,65,69,73,77,81,85,89,93,97,101,105,109,113,117,121,125,129,133,137,141,145,149,153,157,161,165,169,173,177,181,185,189,193]
-connectivite_index=[1,7,13,19,25,31,37,43,49]
-conn=m.getPolyhedronConnectivity(MED_FULL_INTERLACE)
-conn_index=m.getPolyhedronIndex(MED_FULL_INTERLACE)
-conn_face_index=m.getPolyhedronFacesIndex()
-conn3dpolyboost=(len(conn)==len(connectivite))
-if conn3dpolyboost:
- for i in range(0,len(connectivite)):
- conn3dpolyboost=conn3dpolyboost&(conn[i]==connectivite[i])
-conn_index3dpolyboost=(len(conn_index)==len(connectivite_index))
-if conn3dpolyboost:
- for i in range(0,len(connectivite_index)):
- conn_index3dpolyboost=conn_index3dpolyboost&(conn_index[i]==connectivite_index[i])
-conn_face_index3dpolyboost=(len(conn_face_index)==len(connectivite_face_index))
-if conn_face_index3dpolyboost:
- for i in range(0,len(connectivite_face_index)):
- conn_face_index3dpolyboost=conn_face_index3dpolyboost&(conn_face_index[i]==connectivite_face_index[i])
-PolyBoost3D=conn3dpolyboost&conn_index3dpolyboost&conn_face_index3dpolyboost&(nbcell3dpolyboost==8)
+nbcell3dpolyboost=m.getNumberOfElements(MED_CELL,MED_ALL_ELEMENTS)
+connectivite=[23,13,5,18,-1,27,26,14,22,-1,23,27,22,13,-1,13,22,14,5,-1,5,14,26,18,-1,18,26,27,23,
+ 17,6,13,23,-1,25,27,22,16,-1,17,25,16,6,-1,6,16,22,13,-1,13,22,27,23,-1,23,27,25,17,
+ 27,22,14,26,-1,24,20,7,15,-1,27,24,15,22,-1,22,15,7,14,-1,14,7,20,26,-1,26,20,24,27,
+ 9,23,18,1,-1,21,10,26,27,-1,9,21,27,23,-1,23,27,26,18,-1,18,26,10,1,-1,1,10,21,9,
+ 25,16,22,27,-1,19,24,15,8,-1,25,19,8,16,-1,16,8,15,22,-1,22,15,24,27,-1,27,24,19,25,
+ 2,17,23,9,-1,12,21,27,25,-1,2,12,25,17,-1,17,25,27,23,-1,23,27,21,9,-1,9,21,12,2,
+ 21,27,26,10,-1,11,3,20,24,-1,21,11,24,27,-1,27,24,20,26,-1,26,20,3,10,-1,10,3,11,21,
+ 12,25,27,21,-1,4,11,24,19,-1,12,4,19,25,-1,25,19,24,27,-1,27,24,11,21,-1,21,11,4,12]
+connectivite_index=[1, 30, 59, 88, 117, 146, 175, 204, 233]
+conn=m.getConnectivity(MED_NODAL,MED_CELL,MED_POLYHEDRA)
+conn_index=m.getConnectivityIndex(MED_NODAL,MED_CELL);
+conn3dpolyboost=(connectivite==list(conn))
+conn_index3dpolyboost=(connectivite_index==list(conn_index))
+PolyBoost3D=(conn3dpolyboost and conn_index3dpolyboost and (nbcell3dpolyboost==8))
os.remove(dir_mesh+"/out_"+filename)
string_to_execute="'"+dir_renumber+" "+dir_mesh+"/"+filename+" "+meshname+" "+method+" "+dir_mesh+"/out_"+filename+"'"
eval("os.system("+string_to_execute+")")
m = MESH(MED_DRIVER,dir_mesh+"/out_"+filename,meshname)
-nbcell3dpolymetis=m.getNumberOfElementsWithPoly(MED_CELL,MED_ALL_ELEMENTS)
-connectivite=[12,25,27,21,4,11,24,19,12,4,19,25,25,19,24,27,27,24,11,21,21,11,4,12,27,22,14,26,24,20,7,15,27,24,15,22,22,15,7,14,14,7,20,26,26,20,24,27,17,6,13,23,25,27,22,16,17,25,16,6,6,16,22,13,13,22,27,23,23,27,25,17,9,23,18,1,21,10,26,27,9,21,27,23,23,27,26,18,18,26,10,1,1,10,21,9,23,13,5,18,27,26,14,22,23,27,22,13,13,22,14,5,5,14,26,18,18,26,27,23,25,16,22,27,19,24,15,8,25,19,8,16,16,8,15,22,22,15,24,27,27,24,19,25,2,17,23,9,12,21,27,25,2,12,25,17,17,25,27,23,23,27,21,9,9,21,12,2,21,27,26,10,11,3,20,24,21,11,24,27,27,24,20,26,26,20,3,10,10,3,11,21]
-connectivite_face_index=[1,5,9,13,17,21,25,29,33,37,41,45,49,53,57,61,65,69,73,77,81,85,89,93,97,101,105,109,113,117,121,125,129,133,137,141,145,149,153,157,161,165,169,173,177,181,185,189,193]
-connectivite_index=[1,7,13,19,25,31,37,43,49]
-conn=m.getPolyhedronConnectivity(MED_FULL_INTERLACE)
-conn_index=m.getPolyhedronIndex(MED_FULL_INTERLACE)
-conn_face_index=m.getPolyhedronFacesIndex()
-conn3dpolymetis=(len(conn)==len(connectivite))
-conn_index3dpolymetis=(len(conn_index)==len(connectivite_index))
-conn_face_index3dpolymetis=(len(conn_face_index)==len(connectivite_face_index))
-if conn3dpolymetis:
- for i in range(0,len(connectivite)):
- conn3dpolymetis=conn3dpolymetis&(conn[i]==connectivite[i])
-if conn_index3dpolymetis:
- for i in range(0,len(connectivite_index)):
- conn_index3dpolymetis=conn_index3dpolymetis&(conn_index[i]==connectivite_index[i])
-if conn_face_index3dpolymetis:
- for i in range(0,len(connectivite_face_index)):
- conn_face_index3dpolymetis=conn_face_index3dpolymetis&(conn_face_index[i]==connectivite_face_index[i])
-PolyMetis3D=conn3dpolymetis&conn_index3dpolymetis&conn_face_index3dpolymetis&(nbcell3dpolymetis==8)
+nbcell3dpolymetis=m.getNumberOfElements(MED_CELL,MED_ALL_ELEMENTS)
+connectivite=[12,25,27,21,-1,4,11,24,19,-1,12,4,19,25,-1,25,19,24,27,-1,27,24,11,21,-1,21,11,4,12,
+ 27,22,14,26,-1,24,20,7,15,-1,27,24,15,22,-1,22,15,7,14,-1,14,7,20,26,-1,26,20,24,27,
+ 17,6,13,23,-1,25,27,22,16,-1,17,25,16,6,-1,6,16,22,13,-1,13,22,27,23,-1,23,27,25,17,
+ 9,23,18,1,-1,21,10,26,27,-1,9,21,27,23,-1,23,27,26,18,-1,18,26,10,1,-1,1,10,21,9,
+ 23,13,5,18,-1,27,26,14,22,-1,23,27,22,13,-1,13,22,14,5,-1,5,14,26,18,-1,18,26,27,23,
+ 25,16,22,27,-1,19,24,15,8,-1,25,19,8,16,-1,16,8,15,22,-1,22,15,24,27,-1,27,24,19,25,
+ 2,17,23,9,-1,12,21,27,25,-1,2,12,25,17,-1,17,25,27,23,-1,23,27,21,9,-1,9,21,12,2,
+ 21,27,26,10,-1,11,3,20,24,-1,21,11,24,27,-1,27,24,20,26,-1,26,20,3,10,-1,10,3,11,21]
+connectivite_index=[1, 30, 59, 88, 117, 146, 175, 204, 233]
+conn=m.getConnectivity(MED_NODAL,MED_CELL,MED_POLYHEDRA)
+conn_index=m.getConnectivityIndex(MED_NODAL,MED_CELL);
+conn3dpolymetis=(list(conn)==connectivite)
+conn_index3dpolymetis=(list(conn_index)==connectivite_index)
+PolyMetis3D=(conn3dpolymetis and conn_index3dpolymetis and (nbcell3dpolymetis==8))
os.remove(dir_mesh+"/out_"+filename)