throw INTERP_KERNEL::Exception(ostr.str().c_str());
}
+/*!
+ * This method is callable on 1Dmeshes (meshDim==1 && spaceDim==3) returned by MEDCouplingExtrudedMesh::getMesh1D typically.
+ * These 1Dmeshes (meshDim==1 && spaceDim==3) have a special semantic because these meshes do not specify a static location but a translation along a path.
+ * This method checks that 'm1' and 'm2' are compatible, if not an exception is thrown. In case these meshes ('m1' and 'm2') are compatible 2 corresponding meshes
+ * are created ('m1r' and 'm2r') that can be used for interpolation.
+ * @param m1 input mesh with meshDim==1 and spaceDim==3
+ * @param m2 input mesh with meshDim==1 and spaceDim==3
+ * @param m1r output mesh with ref count equal to 1 with meshDim==1 and spaceDim==2
+ * @param m2r output mesh with ref count equal to 1 with meshDim==1 and spaceDim==2
+ * @throw in case that m1 and m2 are not compatible each other.
+ */
+void MEDCouplingExtrudedMesh::project1DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2,
+ MEDCouplingUMesh *&m1r, MEDCouplingUMesh *&m2r) throw(INTERP_KERNEL::Exception)
+{
+ m1r=0;
+ m2r=0;
+}
+
void MEDCouplingExtrudedMesh::rotate(const double *center, const double *vector, double angle)
{
_mesh2D->rotate(center,vector,angle);
int getCellContainingPoint(const double *pos, double eps) const;
static int findCorrespCellByNodalConn(const std::vector<int>& nodalConnec,
const int *revNodalPtr, const int *revNodalIndxPtr) throw(INTERP_KERNEL::Exception);
+ static void project1DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2,
+ MEDCouplingUMesh *&m1r, MEDCouplingUMesh *&m2r) throw(INTERP_KERNEL::Exception);
void rotate(const double *center, const double *vector, double angle);
void translate(const double *vector);
MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const;
#include "MEDCouplingMemArray.hxx"
#include "MEDCouplingFieldDouble.hxx"
#include "MEDCouplingFieldDiscretization.hxx"
+#include "MEDCouplingExtrudedMesh.hxx"
#include "MEDCouplingNormalizedUnstructuredMesh.txx"
+#include "Interpolation2DCurve.txx"
#include "Interpolation2D.txx"
#include "Interpolation3D.txx"
#include "Interpolation3DSurf.txx"
int MEDCouplingRemapper::prepareEE(const char *method)
{
- return 0;
+ MEDCouplingExtrudedMesh *src_mesh=(MEDCouplingExtrudedMesh *)_src_mesh;
+ MEDCouplingExtrudedMesh *target_mesh=(MEDCouplingExtrudedMesh *)_target_mesh;
+ std::string methC(method);
+ if(methC!="P0P0")
+ throw INTERP_KERNEL::Exception("Only P0P0 method implemented for Extruded/Extruded meshes !");
+ INTERP_KERNEL::Interpolation<INTERP_KERNEL::Interpolation3D>::checkAndSplitInterpolationMethod(method,_src_method,_target_method);
+ MEDCouplingNormalizedUnstructuredMesh<2,2> source_mesh_wrapper(src_mesh->getMesh2D());
+ MEDCouplingNormalizedUnstructuredMesh<2,2> target_mesh_wrapper(target_mesh->getMesh2D());
+ INTERP_KERNEL::Interpolation2D interpolation(*this);
+ std::vector<std::map<int,double> > matrix2D;
+ int nbCols2D=interpolation.interpolateMeshes(source_mesh_wrapper,target_mesh_wrapper,matrix2D,method);
+ MEDCouplingUMesh *s1D,*t1D;
+ MEDCouplingExtrudedMesh::project1DMeshes(src_mesh->getMesh1D(),target_mesh->getMesh1D(),s1D,t1D);
+ MEDCouplingNormalizedUnstructuredMesh<2,1> s1DWrapper(s1D);
+ MEDCouplingNormalizedUnstructuredMesh<2,1> t1DWrapper(t1D);
+ std::vector<std::map<int,double> > matrix1D;
+ int nbCols1D=interpolation.interpolateMeshes(s1DWrapper,t1DWrapper,matrix1D,method);
+ INTERP_KERNEL::Interpolation2DCurve myInterpolator;
+ //
+ _matrix.resize(matrix2D.size()*matrix1D.size());
+ //
+ _deno_multiply.clear();
+ _deno_multiply.resize(_matrix.size());
+ _deno_reverse_multiply.clear();
+ _deno_reverse_multiply.resize(nbCols2D*nbCols1D);
+ declareAsNew();
+ return 1;
}
void MEDCouplingRemapper::updateTime()