1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #ifndef __INTERPOLATIONMATRIX_HXX__
20 #define __INTERPOLATIONMATRIX_HXX__
22 #include "MPIAccessDEC.hxx"
23 #include "MxN_Mapping.hxx"
24 #include "InterpolationOptions.hxx"
25 #include "DECOptions.hxx"
29 class InterpolationMatrix : public INTERP_KERNEL::InterpolationOptions,
34 InterpolationMatrix(ParaMEDMEM::ParaMESH *source_support,
35 const ProcessorGroup& source_group,
36 const ProcessorGroup& target_group,
37 const DECOptions& dec_opt,
38 const InterpolationOptions& i_opt);
41 virtual ~InterpolationMatrix();
42 void addContribution(MEDCouplingUMesh& distant_support, int iproc_distant,
43 int* distant_elems, const std::string& srcMeth, const std::string& targetMeth);
44 void multiply(MEDCouplingFieldDouble& field) const;
45 void transposeMultiply(MEDCouplingFieldDouble& field)const;
47 int getNbRows() const {return _row_offsets.size();}
48 MPIAccessDEC* getAccessDEC(){return _mapping.getAccessDEC();}
50 static MEDCouplingFieldDouble *getSupportVolumes(MEDCouplingMesh *field);
51 static MEDCouplingFieldDouble *getSupportUnstructuredVolumes(MEDCouplingUMesh *field);
53 std::vector<int> _row_offsets;
54 std::vector<std::pair<int,int> > _col_offsets;
55 MEDCouplingUMesh *_source_support;
58 const ProcessorGroup& _source_group;
59 const ProcessorGroup& _target_group;
60 std::vector<double> _target_volume;
61 std::vector<double> _source_volume;
62 std::vector<std::vector<std::pair<int,double> > > _coeffs;