X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FParaMEDMEM%2FInterpolationMatrix.cxx;h=177a08dbbf8d1903531646e3db37be429fa26a6d;hb=a5a009e0d290b13f262ba4f251dd20d1c7acb20d;hp=352566534c85316348f8c6f4acd54871c633a357;hpb=79c404a024c4b00550400f158f89fcc64859e71d;p=tools%2Fmedcoupling.git diff --git a/src/ParaMEDMEM/InterpolationMatrix.cxx b/src/ParaMEDMEM/InterpolationMatrix.cxx index 352566534..177a08dbb 100644 --- a/src/ParaMEDMEM/InterpolationMatrix.cxx +++ b/src/ParaMEDMEM/InterpolationMatrix.cxx @@ -1,9 +1,9 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -29,7 +29,7 @@ #include "Interpolation2D.txx" #include "Interpolation3DSurf.hxx" #include "Interpolation3D.txx" -#include "Interpolation3D2D.txx" +#include "Interpolation2D3D.txx" #include "Interpolation2D1D.txx" #include "MEDCouplingUMesh.hxx" #include "MEDCouplingNormalizedUnstructuredMesh.txx" @@ -39,28 +39,21 @@ #include -// class InterpolationMatrix -// This class enables the storage of an interpolation matrix Wij mapping -// source field Sj to target field Ti via Ti=Vi^(-1).Wij.Sj. -// The matrix is built and stored on the processors belonging to the source -// group. - using namespace std; -namespace ParaMEDMEM +namespace MEDCoupling { - // ==================================================================== - // Creates an empty matrix structure linking two distributed supports. - // The method must be called by all processors belonging to source - // and target groups. - // param source_support local support - // param source_group processor group containing the local processors - // param target_group processor group containing the distant processors - // param method interpolation method - // ==================================================================== - - InterpolationMatrix::InterpolationMatrix(const ParaMEDMEM::ParaFIELD *source_field, + /**! + Creates an empty matrix structure linking two distributed supports. + The method must be called by all processors belonging to source + and target groups. + \param source_support local support + \param source_group processor group containing the local processors + \param target_group processor group containing the distant processors + \param method interpolation method + */ + InterpolationMatrix::InterpolationMatrix(const MEDCoupling::ParaFIELD *source_field, const ProcessorGroup& source_group, const ProcessorGroup& target_group, const DECOptions& dec_options, @@ -84,22 +77,21 @@ namespace ParaMEDMEM } - // ====================================================================== - // \brief Adds the contribution of a distant subdomain to the* - // interpolation matrix. - // The method adds contribution to the interpolation matrix. - // For each row of the matrix, elements are addded as - // a (column, coeff) pair in the _coeffs array. This column number refers - // to an element on the target side via the _col_offsets array. - // It is made of a series of (iproc, ielem) pairs. - // The number of elements per row is stored in the row_offsets array. - - // param distant_support local representation of the distant subdomain - // param iproc_distant id of the distant subdomain (in the distant group) - // param distant_elems mapping between the local representation of - // the subdomain and the actual elem ids on the distant subdomain - // ====================================================================== - + /*! + \brief Adds the contribution of a distant subdomain to the* + interpolation matrix. + The method adds contribution to the interpolation matrix. + For each row of the matrix, elements are addded as + a (column, coeff) pair in the _coeffs array. This column number refers + to an element on the target side via the _col_offsets array. + It is made of a series of (iproc, ielem) pairs. + The number of elements per row is stored in the row_offsets array. + + param distant_support local representation of the distant subdomain + param iproc_distant id of the distant subdomain (in the distant group) + param distant_elems mapping between the local representation of + the subdomain and the actual elem ids on the distant subdomain + */ void InterpolationMatrix::addContribution ( MEDCouplingPointSet& distant_support, int iproc_distant, const int* distant_elems, @@ -165,7 +157,7 @@ namespace ParaMEDMEM { MEDCouplingNormalizedUnstructuredMesh<3,3> target_wrapper(distant_supportC); MEDCouplingNormalizedUnstructuredMesh<3,3> source_wrapper(source_supportC); - INTERP_KERNEL::Interpolation3D2D interpolator (*this); + INTERP_KERNEL::Interpolation2D3D interpolator (*this); interpolator.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod); target_wrapper.releaseTempArrays(); source_wrapper.releaseTempArrays(); @@ -355,10 +347,10 @@ namespace ParaMEDMEM NatureOfField nature=elementLocator.getLocalNature(); switch(nature) { - case ConservativeVolumic: + case IntensiveMaximum: computeConservVolDenoW(elementLocator); break; - case Integral: + case ExtensiveMaximum: { if(!elementLocator.isM1DCorr()) computeIntegralDenoW(elementLocator); @@ -366,10 +358,10 @@ namespace ParaMEDMEM computeGlobConstraintDenoW(elementLocator); break; } - case IntegralGlobConstraint: + case ExtensiveConservation: computeGlobConstraintDenoW(elementLocator); break; - case RevIntegral: + case IntensiveConservation: { if(!elementLocator.isM1DCorr()) computeRevIntegralDenoW(elementLocator); @@ -388,10 +380,10 @@ namespace ParaMEDMEM NatureOfField nature=elementLocator.getLocalNature(); switch(nature) { - case ConservativeVolumic: + case IntensiveMaximum: computeConservVolDenoL(elementLocator); break; - case Integral: + case ExtensiveMaximum: { if(!elementLocator.isM1DCorr()) computeIntegralDenoL(elementLocator); @@ -399,11 +391,11 @@ namespace ParaMEDMEM computeConservVolDenoL(elementLocator); break; } - case IntegralGlobConstraint: - //this is not a bug doing like ConservativeVolumic + case ExtensiveConservation: + //this is not a bug doing like IntensiveMaximum computeConservVolDenoL(elementLocator); break; - case RevIntegral: + case IntensiveConservation: { if(!elementLocator.isM1DCorr()) computeRevIntegralDenoL(elementLocator); @@ -840,14 +832,13 @@ namespace ParaMEDMEM } } - // ================================================================== - // The call to this method updates the arrays on the target side - // so that they know which amount of data from which processor they - // should expect. - // That call makes actual interpolations via multiply method - // available. - // ================================================================== + /**! The call to this method updates the arrays on the target side + so that they know which amount of data from which processor they + should expect. + That call makes actual interpolations via multiply method + available. + */ void InterpolationMatrix::prepare() { int nbelems = _source_field->getField()->getNumberOfTuples(); @@ -859,18 +850,18 @@ namespace ParaMEDMEM } - // ======================================================================= - // brief performs t=Ws, where t is the target field, s is the source field - // The call to this method must be called both on the working side - // and on the idle side. On the working side, the vector T=VT^(-1).(W.S) - // is computed and sent. On the idle side, no computation is done, but the - // result from the working side is received and the field is updated. + /*! + \brief performs t=Ws, where t is the target field, s is the source field - // param field source field on processors involved on the source side, - // target field on processors on the target side - // ======================================================================= + The call to this method must be called both on the working side + and on the idle side. On the working side, the vector T=VT^(-1).(W.S) + is computed and sent. On the idle side, no computation is done, but the + result from the working side is received and the field is updated. + \param field source field on processors involved on the source side, + target field on processors on the target side + */ void InterpolationMatrix::multiply(MEDCouplingFieldDouble& field) const { int nbcomp = field.getArray()->getNumberOfComponents(); @@ -917,20 +908,19 @@ namespace ParaMEDMEM } - // ========================================================================= - // brief performs s=WTt, where t is the target field, s is the source field, - // WT is the transpose matrix from W - - // The call to this method must be called both on the working side - // and on the idle side. On the working side, the target vector T is - // received and the vector S=VS^(-1).(WT.T) is computed to update - // the field. - // On the idle side, no computation is done, but the field is sent. + /**! + \brief performs s=WTt, where t is the target field, s is the source field, + WT is the transpose matrix from W - // param field source field on processors involved on the source side, - // target field on processors on the target side - // ========================================================================= + The call to this method must be called both on the working side + and on the idle side. On the working side, the target vector T is + received and the vector S=VS^(-1).(WT.T) is computed to update + the field. + On the idle side, no computation is done, but the field is sent. + param field source field on processors involved on the source side, + target field on processors on the target side + */ void InterpolationMatrix::transposeMultiply(MEDCouplingFieldDouble& field) const { int nbcomp = field.getArray()->getNumberOfComponents();