X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FParaMEDMEM%2FInterpolationMatrix.hxx;h=8a7af393242f96f3f0aa1f4c61cd350e5a114c76;hb=f1a947b32a36d8dc8e3079b25305bb50e8cb59a0;hp=c0c6984a869a0ecd05c5fb1efd121caf5ac3e678;hpb=48782c06022ca2caa36f849cb5a29ea4fe2aaa83;p=tools%2Fmedcoupling.git diff --git a/src/ParaMEDMEM/InterpolationMatrix.hxx b/src/ParaMEDMEM/InterpolationMatrix.hxx index c0c6984a8..8a7af3932 100644 --- a/src/ParaMEDMEM/InterpolationMatrix.hxx +++ b/src/ParaMEDMEM/InterpolationMatrix.hxx @@ -1,21 +1,22 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D +// Copyright (C) 2007-2013 CEA/DEN, EDF 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__ #define __INTERPOLATIONMATRIX_HXX__ @@ -26,12 +27,14 @@ namespace ParaMEDMEM { + class ElementLocator; + class InterpolationMatrix : public INTERP_KERNEL::InterpolationOptions, public DECOptions { public: - InterpolationMatrix(ParaMEDMEM::ParaMESH *source_support, + InterpolationMatrix(const ParaMEDMEM::ParaFIELD *source_field, const ProcessorGroup& source_group, const ProcessorGroup& target_group, const DECOptions& dec_opt, @@ -39,27 +42,61 @@ namespace ParaMEDMEM virtual ~InterpolationMatrix(); - void addContribution(MEDCouplingUMesh& distant_support, int iproc_distant, - int* distant_elems, const std::string& srcMeth, const std::string& targetMeth); + 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();} - - static MEDCouplingFieldDouble *getSupportVolumes(MEDCouplingMesh *field); - static MEDCouplingFieldDouble *getSupportUnstructuredVolumes(MEDCouplingUMesh *field); + 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& res) const; + void computeLocalRowSum(const std::vector& distantProcs, std::vector >& resPerProcI, + std::vector >& resPerProcD) const; + void computeGlobalRowSum(ElementLocator& elementLocator, std::vector >& denoStrorage, std::vector >& denoStrorageInv); + void computeGlobalColSum(std::vector >& denoStrorage); + void resizeGlobalColSum(std::vector >& denoStrorage); + void fillDSFromVM(int iproc_distant, const int* distant_elems, const std::vector< std::map >& values, MEDCouplingFieldDouble *surf); + void serializeMe(std::vector< std::vector< std::map > >& data1, std::vector& data2) const; + void initialize(); + void findAdditionnalElements(ElementLocator& elementLocator, std::vector >& elementsToAdd, + const std::vector >& resPerProcI, const std::vector >& globalIdsPartial); + void addGhostElements(const std::vector& distantProcs, const std::vector >& elementsToAdd); + int mergePolicies(const std::vector& policyPartial); + void mergeRowSum(const std::vector< std::vector >& rowsPartialSumD, const std::vector< std::vector >& globalIdsPartial, + std::vector& globalIdsLazySideInteraction, std::vector& sumCorresponding); + void mergeRowSum2(const std::vector< std::vector >& globalIdsPartial, std::vector< std::vector >& rowsPartialSumD, + const std::vector& globalIdsLazySideInteraction, const std::vector& sumCorresponding); + void mergeRowSum3(const std::vector< std::vector >& globalIdsPartial, std::vector< std::vector >& rowsPartialSumD); + void mergeCoeffs(const std::vector& procsInInteraction, const std::vector< std::vector >& rowsPartialSumI, + const std::vector >& globalIdsPartial, std::vector >& denoStrorageInv); + void divideByGlobalRowSum(const std::vector& distantProcs, const std::vector >& resPerProcI, + const std::vector >& resPerProcD, std::vector >& deno); + private: + bool isSurfaceComputationNeeded(const std::string& method) const; private: + const ParaMEDMEM::ParaFIELD *_source_field; std::vector _row_offsets; - std::vector > _col_offsets; - MEDCouplingUMesh *_source_support; + std::map, int > _col_offsets; + MEDCouplingPointSet *_source_support; MxN_Mapping _mapping; const ProcessorGroup& _source_group; const ProcessorGroup& _target_group; - std::vector _target_volume; - std::vector _source_volume; + std::vector< std::vector > _target_volume; std::vector > > _coeffs; + std::vector > _deno_multiply; + std::vector > _deno_reverse_multiply; }; }