delete _right;
}
- /*! returns in \a elems the list of elements potentially containing the point pointed to by \a xx
+ /*! returns in \a elem an element potentially containing the point pointed to by \a xx
Contrary to BBTreePts::getElementsAroundPoint the norm 2 is used here.
- \param [in] xx pointer to query point coords
- \param [in] threshold
- \param elems list of elements (given in 0-indexing) intersecting the bounding box
+ \param[in] xx pointer to query point coords
+ \param[in] threshold detection precision
+ \param[out] elem the element intersecting the bounding box
\sa BBTreePts::getElementsAroundPoint
*/
double getElementsAroundPoint2(const double *xx, double threshold, ConnType& elem) const
*
* @param targetMesh mesh containing the target elements
* @param srcMesh mesh containing the source elements
- * @param policy splitting policy to be used
*/
template<class MyMeshType, class MyMatrix>
Barycentric3DIntersectorP1P1<MyMeshType,MyMatrix>::Barycentric3DIntersectorP1P1(const MyMeshType& targetMesh, const MyMeshType& srcMesh, double precision):
/*!
* Should be called \b once ! non const method.
- * \param whereToFind specifies the box where final seek should be done. Essentially it is used for caracteristic reason.
- * \param colinearity returns if regarding QuadraticPlanarPrecision::getPrecision() ; e1 and e2 are colinears
- * If true 'this' is modified ! So this method be called once above all if true is returned for this parameter.
- * \param areOverlapped if colinearity if true, this parameter looks if e1 and e2 are overlapped, i.e. is they lie on the same line (= this is different from
+ * \param obviousNoIntersection set to true if it is obvious that there is no intersection
+ * \param areOverlapped if the two segs are colinears, this parameter looks if e1 and e2 are overlapped, i.e. is they lie on the same line (= this is different from
* a true intersection, two segments can be in "overlap" mode, without intersecting)
*/
void SegSegIntersector::areOverlappedOrOnlyColinears(bool& obviousNoIntersection, bool& areOverlapped)
}
/*!
- * WARNING use this method if and only if this is so that it is completely in/out/on of @param pol.
+ * WARNING use this method if and only if this is so that it is completely in/out/on of param 'pol'.
*/
TypeOfEdgeLocInPolygon ElementaryEdge::locateFullyMySelf(const ComposedEdge& pol, TypeOfEdgeLocInPolygon precEdgeLoc) const
{
/*!
* This method make the hypothesis that \a this and \a other are split at the minimum into edges that are fully IN, OUT or ON.
* This method returns newly created polygons in \a conn and \a connI and the corresponding ids ( \a idThis, \a idOther) are stored respectively into \a nbThis and \a nbOther.
- * @param [in,out] edgesThis, parameter that keep informed the caller about the edges in this not shared by the result of intersection of \a this with \a other
- * @param [in,out] edgesBoundaryOther, parameter that stores all edges in result of intersection that are not
+ * @param [in,out] edgesThis parameter that keep informed the caller about the edges in this not shared by the result of intersection of \a this with \a other
+ * @param [in,out] edgesBoundaryOther parameter that stores all edges in result of intersection that are not
*/
void QuadraticPolygon::buildPartitionsAbs(QuadraticPolygon& other, std::set<INTERP_KERNEL::Edge *>& edgesThis, std::set<INTERP_KERNEL::Edge *>& edgesBoundaryOther,
const std::map<INTERP_KERNEL::Node *,mcIdType>& mapp, mcIdType idThis, mcIdType idOther, mcIdType offset,
}
/*!
- * @param [in] pol1zip is a list of set of edges (=an opened polygon) coming from split polygon 1.
+ * @param [in] pol1Zip is a list of set of edges (=an opened polygon) coming from split polygon 1.
* @param [in] pol1 should be considered as pol1Simplified.
* @param [in] pol2 is split pol2.
* @param [out] results the resulting \b CLOSED polygons.
namespace INTERP_KERNEL
{
- /**
- * \class Interpolation1D0D
- * \brief Class used to calculate the interpolation between a 1D mesh and 0D mesh (in 3D space)
- * Can be seen as a specialization of Interpolation3D, and allows notably the adjustment of bounind boxes.
- *
- */
-
Interpolation1D0D::Interpolation1D0D()
{}
namespace INTERP_KERNEL
{
+ /**
+ * \class Interpolation1D0D
+ * \brief Class used to calculate the interpolation between a 1D mesh and 0D mesh (in 3D space)
+ * Can be seen as a specialization of Interpolation3D, and allows notably the adjustment of bounind boxes.
+ *
+ */
class INTERPKERNEL_EXPORT Interpolation1D0D : public Interpolation<Interpolation1D0D>
{
public:
namespace INTERP_KERNEL
{
- /**
- * \class Interpolation3D
- * \brief Class used to calculate the volumes of intersection between the elements of two 3D meshes.
- *
- */
/**
* Default constructor
*
#include "InterpolationOptions.hxx"\r
\r
namespace INTERP_KERNEL\r
-{\r
+{
+ /**
+ * \class Interpolation3D
+ * \brief Class used to calculate the volumes of intersection between the elements of two 3D meshes.
+ */
+
class INTERPKERNEL_EXPORT Interpolation3D : public Interpolation<Interpolation3D>\r
{\r
public:\r
namespace INTERP_KERNEL
{
- /**
- * \class Interpolation3D1D
- * \brief Class used to calculate the interpolation between a 3D mesh and 1D mesh (in 3D space)
- * Can be seen as a specialization of Interpolation3D, and allows notably the adjustment of bounind boxes.
- *
- */
-
Interpolation3D1D::Interpolation3D1D() { }
Interpolation3D1D::Interpolation3D1D(const InterpolationOptions& io):Interpolation<Interpolation3D1D>(io) { }
#include <vector>\r
\r
namespace INTERP_KERNEL\r
-{\r
+{
+ /**
+ * \class Interpolation3D1D
+ * \brief Class used to calculate the interpolation between a 3D mesh and 1D mesh (in 3D space)
+ * Can be seen as a specialization of Interpolation3D, and allows notably the adjustment of bounding boxes.
+ */
+
class INTERPKERNEL_EXPORT Interpolation3D1D : public Interpolation<Interpolation3D1D>\r
{\r
public:\r
* \brief Fills the matrix by precomputed cell interferences along axes
* \param inter_of_axis - cell/cell interferences along each axis
* \param result - matrix to fill in
- * \param src_nb_cells[] - nb of cells along each of axes in the source mesh
- * \param tgt_nb_cells[] - nb of cells along each of axes in the target mesh
+ * \param src_nb_cells - nb of cells along each of axes in the source mesh
+ * \param tgt_nb_cells - nb of cells along each of axes in the target mesh
* \param src_i_cell - source cell number accumulated by previous axes
* \param tgt_i_cell - target cell number accumulated by previous axes
* \param src_prev_area - factor by which this axis icreases cell number
* the indexing is more natural : the intersection volume of the target element i with source element j is found at matrix[i-1][j].
*
- * @param srcMesh cartesian source mesh
- * @param targetMesh unstructured target mesh
+ * @param src_mesh cartesian source mesh
+ * @param tgt_mesh unstructured target mesh
* @param result matrix in which the result is stored
* @param method interpolation method
*/
* the indexing is more natural : the intersection volume of the target element i with source element j is found at matrix[i-1][j].
*
- * @param srcMesh 2-dimesional unstructured target mesh
- * @param targetMesh 2-dimensional cartesian source mesh
+ * @param meshS 2-dimesional unstructured target mesh
+ * @param meshT 2-dimensional cartesian source mesh
* @param result matrix in which the result is stored
* @param method interpolation method
*/
#include <functional>\r
\r
namespace INTERP_KERNEL\r
-{\r
+{
+ /**
+ * \defgroup interpolationCurve InterpolationCurve
+ *
+ * \class InterpolationCurve
+ * \brief Class used to compute the coefficients of the interpolation matrix between
+ * two local meshes in two dimensions.
+ */
+
template<class RealCurve>\r
class InterpolationCurve : public Interpolation< InterpolationCurve<RealCurve> >\r
{\r
namespace INTERP_KERNEL
{
- /**
- * \defgroup interpolationCurve InterpolationCurve
- *
- * \class InterpolationCurve
- * \brief Class used to compute the coefficients of the interpolation matrix between
- * two local meshes in two dimensions.
- */
+
template<class RealCurve>
InterpolationCurve<RealCurve>::InterpolationCurve()
{
#include "InterpolationOptions.hxx"\r
\r
namespace INTERP_KERNEL\r
-{\r
+{
+ /**
+ * \defgroup interpolationPlanar InterpolationPlanar
+ *
+ * \class InterpolationPlanar
+ * \brief Class used to compute the coefficients of the interpolation matrix between
+ * two local meshes in two dimensions. Meshes can contain mixed triangular and quadrangular elements.
+ */
+
template<class RealPlanar>\r
class InterpolationPlanar : public Interpolation< InterpolationPlanar<RealPlanar> >\r
{\r
namespace INTERP_KERNEL
{
- /**
- * \defgroup interpolationPlanar InterpolationPlanar
- *
- * \class InterpolationPlanar
- * \brief Class used to compute the coefficients of the interpolation matrix between
- * two local meshes in two dimensions. Meshes can contain mixed triangular and quadrangular elements.
- */
template<class RealPlanar>
InterpolationPlanar<RealPlanar>::InterpolationPlanar():_dim_caracteristic(1)
* This method builds a potentially non-convex polygon cell built with the first point of 'triIn' the barycenter of two edges starting or ending with
* the first point of 'triIn' and the barycenter of 'triIn'.
*
- * @param triIn is a 6 doubles array in full interlace mode, that represents a triangle.
- * @param quadOut is a 8 doubles array filled after the following call.
+ * @param polygIn is a 6 doubles array in full interlace mode, that represents a triangle.
+ * @param polygOut is a 8 doubles array filled after the following call.
*/
template<int SPACEDIM>
inline void fillDualCellOfPolyg(const double *polygIn, mcIdType nPtsPolygonIn, double *polygOut)
/*!
* \brief Solve system equation in matrix form using Gaussian elimination algorithm
- * \param M - N x N+NB_OF_VARS matrix
- * \param sol - vector of N solutions
+ * \param matrix - N x N+NB_OF_VARS matrix
+ * \param solutions - vector of N solutions
+ * \param eps - precision
* \retval bool - true if succeeded
*/
template<unsigned SZ, unsigned NB_OF_RES>
}
/*!
- * @param icellT in format of MyMeshType.
+ * @param icellS in format of MyMeshType.
*/
template<class MyMeshType, class MyMatrix>
void Intersector3D<MyMeshType,MyMatrix>::getRealSourceCoordinates(ConnType icellS, std::vector<double>& coordsS) const
}
/*!
- * @param icellT in C format.
+ * @param icellS in C format.
* @return is in format of MyMeshType
*/
template<class MyMeshType, class MyMatrix>
/*!
* @param icellS in format of MyMeshType.
- * @param res ; out param in format of MyMeshType.
+ * @param[out] res out param in format of MyMeshType.
*/
template<class MyMeshType, class MyMatrix>
void Intersector3D<MyMeshType,MyMatrix>::getConnOfSourceCell(ConnType icellS, typename std::vector<ConnType>& res) const
*
* @param targetMesh mesh containing the target elements
* @param srcMesh mesh containing the source elements
- * @param policy splitting policy to be used
*/
template<class MyMeshType, class MyMatrix>
MappedBarycentric3DIntersectorP1P1<MyMeshType,MyMatrix>::MappedBarycentric3DIntersectorP1P1(const MyMeshType& targetMesh, const MyMeshType& srcMesh, double precision):
/**
* @param targetMesh mesh containing the target elements
* @param srcMesh mesh containing the source elements
- * @param policy splitting policy to be used
*/
template<class MyMeshType, class MyMatrix>
PointLocator3DIntersectorP0P0<MyMeshType,MyMatrix>::PointLocator3DIntersectorP0P0(const MyMeshType& targetMesh, const MyMeshType& srcMesh, double precision):
/**
* @param targetMesh mesh containing the target elements
* @param srcMesh mesh containing the source elements
- * @param policy splitting policy to be used
*/
template<class MyMeshType, class MyMatrix>
PointLocator3DIntersectorP0P1<MyMeshType,MyMatrix>::PointLocator3DIntersectorP0P1(const MyMeshType& targetMesh, const MyMeshType& srcMesh, double precision):
/**
* @param targetMesh mesh containing the target elements
* @param srcMesh mesh containing the source elements
- * @param policy splitting policy to be used
*
* WARNING : in _split attribute, sourceMesh and targetMesh are switched in order to fit intersectCells feature.
*/
*
* @param targetMesh mesh containing the target elements
* @param srcMesh mesh containing the source elements
- * @param policy splitting policy to be used
*/
template<class MyMeshType, class MyMatrix>
PointLocator3DIntersectorP1P1<MyMeshType,MyMatrix>::PointLocator3DIntersectorP1P1(const MyMeshType& targetMesh, const MyMeshType& srcMesh, double precision):
//================================================================================
/*!
* \brief This method computes a value per each node of source cell for each target cell.
- * \param srcCell - a source tetrahedron
- * \param tgtCells - target elements
+ * \param srcCells - source elements
+ * \param tgtCell - target element
* \param res - matrix to fill in
*/
//================================================================================
/**
* Calculates the intersection surface of two coplanar triangles.
*
- * @param palneNormal normal of the plane for the first triangle
+ * @param planeNormal normal of the plane for the first triangle
* @param planeConstant constant of the equation of the plane for the first triangle
* @param p1 coordinates of the first node of the first triangle
* @param p2 coordinates of the second node of the first triangle
* Determine if a face is coplanar with a triangle.
* The first face is characterized by the equation of her plane
*
- * @param palneNormal normal of the plane for the first triangle
+ * @param planeNormal normal of the plane for the first triangle
* @param planeConstant constant of the equation of the plane for the first triangle
* @param coordsFace coordinates of the triangle face
* @param precision precision for double float data used for comparison
*
* @param targetMesh the target mesh
* @param targetCell the global number of the cell that the object represents, in targetMesh mode.
- * @param policy the splitting policy of the object
*
*/
template<class MyMeshTypeT, class MyMeshTypeS>
public:
/*!
* Tool for cell intersection, result is always positive.
- * @param icellT id of cell in target mesh in \b C \b mode.
- * @param icellsS ids of cells in source mesh in \b C \b mode.
+ * @param targetCell id of cell in target mesh in \b C \b mode.
+ * @param srcCells ids of cells in source mesh in \b C \b mode.
* @param res is an IN/OUT parameter that represents the icellTth row in final matrix, fed with at most icellsS elements.
*/
virtual void intersectCells(ConnType targetCell, const std::vector<ConnType>& srcCells, MyMatrix& res) = 0;
CPPUNIT_ASSERT_DOUBLES_EQUAL(e1->getBounds()[0],center[0]+radius*cos(3*M_PI/4),ADMISSIBLE_ERROR);
CPPUNIT_ASSERT_DOUBLES_EQUAL(e1->getBounds()[1],center[0]+radius*cos(M_PI/3),ADMISSIBLE_ERROR);
CPPUNIT_ASSERT_DOUBLES_EQUAL(e1->getBounds()[2],center[1]+radius*sin(3*M_PI/4),ADMISSIBLE_ERROR);
- CPPUNIT_ASSERT_DOUBLES_EQUAL(e1->getBounds()[3],center[1]+radius*sin(M_PI/2),ADMISSIBLE_ERROR);//<<
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(e1->getBounds()[3],center[1]+radius*sin(M_PI/2),ADMISSIBLE_ERROR);
e1->decrRef();
//
e1=buildArcOfCircle(center,radius,3*M_PI/4,7*M_PI/8);
e1->decrRef();
//
e1=buildArcOfCircle(center,radius,7.*M_PI/8.,9.*M_PI/8.);
- CPPUNIT_ASSERT_DOUBLES_EQUAL(e1->getBounds()[0],center[0]+radius*cos(M_PI),ADMISSIBLE_ERROR);//<<
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(e1->getBounds()[0],center[0]+radius*cos(M_PI),ADMISSIBLE_ERROR);
CPPUNIT_ASSERT_DOUBLES_EQUAL(e1->getBounds()[1],center[0]+radius*cos(7*M_PI/8),ADMISSIBLE_ERROR);
CPPUNIT_ASSERT_DOUBLES_EQUAL(e1->getBounds()[2],center[1]+radius*sin(9*M_PI/8),ADMISSIBLE_ERROR);
CPPUNIT_ASSERT_DOUBLES_EQUAL(e1->getBounds()[3],center[1]+radius*sin(7*M_PI/8),ADMISSIBLE_ERROR);
e1=buildArcOfCircle(center,radius,11.*M_PI/8.,7.*M_PI/4.);
CPPUNIT_ASSERT_DOUBLES_EQUAL(e1->getBounds()[0],center[0]+radius*cos(11*M_PI/8),ADMISSIBLE_ERROR);
CPPUNIT_ASSERT_DOUBLES_EQUAL(e1->getBounds()[1],center[0]+radius*cos(7*M_PI/4),ADMISSIBLE_ERROR);
- CPPUNIT_ASSERT_DOUBLES_EQUAL(e1->getBounds()[2],center[1]+radius*sin(3*M_PI/2),ADMISSIBLE_ERROR);//<<
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(e1->getBounds()[2],center[1]+radius*sin(3*M_PI/2),ADMISSIBLE_ERROR);
CPPUNIT_ASSERT_DOUBLES_EQUAL(e1->getBounds()[3],center[1]+radius*sin(7*M_PI/4),ADMISSIBLE_ERROR);
e1->decrRef();
//
//
e1=buildArcOfCircle(center,radius,-M_PI/8.,M_PI/4.);
CPPUNIT_ASSERT_DOUBLES_EQUAL(e1->getBounds()[0],center[0]+radius*cos(M_PI/4),ADMISSIBLE_ERROR);
- CPPUNIT_ASSERT_DOUBLES_EQUAL(e1->getBounds()[1],center[0]+radius*cos(0.),ADMISSIBLE_ERROR); //<<
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(e1->getBounds()[1],center[0]+radius*cos(0.),ADMISSIBLE_ERROR);
CPPUNIT_ASSERT_DOUBLES_EQUAL(e1->getBounds()[2],center[1]+radius*sin(15*M_PI/8),ADMISSIBLE_ERROR);
CPPUNIT_ASSERT_DOUBLES_EQUAL(e1->getBounds()[3],center[1]+radius*sin(M_PI/4),ADMISSIBLE_ERROR);
e1->decrRef();
ElementaryEdge *e1=dynamic_cast<ElementaryEdge *>((*pol)[1]);
ElementaryEdge *e2=dynamic_cast<ElementaryEdge *>((*pol)[0]);
CPPUNIT_ASSERT(e0); CPPUNIT_ASSERT(e1); CPPUNIT_ASSERT(e2);
- CPPUNIT_ASSERT(dynamic_cast<EdgeLin *>(e0->getPtr()));//<- testing detection of colinearity
+ CPPUNIT_ASSERT(dynamic_cast<EdgeLin *>(e0->getPtr()));// <- testing detection of colinearity
CPPUNIT_ASSERT(dynamic_cast<EdgeArcCircle *>(e1->getPtr()));
- CPPUNIT_ASSERT(dynamic_cast<EdgeLin *>(e2->getPtr()));//<- testing detection of colinearity
+ CPPUNIT_ASSERT(dynamic_cast<EdgeLin *>(e2->getPtr()));// <- testing detection of colinearity
nodes.clear();
delete pol;
nodes.push_back(new Node(coords));
e1=dynamic_cast<ElementaryEdge *>((*pol)[1]);
e2=dynamic_cast<ElementaryEdge *>((*pol)[0]);
CPPUNIT_ASSERT(e0); CPPUNIT_ASSERT(e1); CPPUNIT_ASSERT(e2);
- CPPUNIT_ASSERT(dynamic_cast<EdgeLin *>(e0->getPtr()));//<- testing detection of colinearity
+ CPPUNIT_ASSERT(dynamic_cast<EdgeLin *>(e0->getPtr()));// <- testing detection of colinearity
CPPUNIT_ASSERT(dynamic_cast<EdgeArcCircle *>(e1->getPtr()));
- CPPUNIT_ASSERT(dynamic_cast<EdgeLin *>(e2->getPtr()));//<- testing detection of colinearity
+ CPPUNIT_ASSERT(dynamic_cast<EdgeLin *>(e2->getPtr()));// <- testing detection of colinearity
delete pol;
const double coords2[]={
0.,0.,
* Finds nodes not used in any cell and returns an array giving a new id to every node
* by excluding the unused nodes, for which the array holds -1. The result array is
* a mapping in "Old to New" mode.
- * \param [out] nbrOfNodesInUse - number of node ids present in the nodal connectivity.
* \return DataArrayIdType * - a new instance of DataArrayIdType. Its length is \a
* this->getNumberOfNodes(). It holds for each node of \a this mesh either -1
* if the node is unused or a new id else. The caller is to delete this
/*!
* Assign nature for each fields in \a this.
- * \param [in] nfs
+ * \param [in] nfs vector of field natures.
*/
void MEDCouplingAMRAttribute::spillNatures(const std::vector<NatureOfField>& nfs)
{
/*!
* Applies scaling transformation to all nodes of \a this mesh.
- * \param [in] postd::size_t - coordinates of a scaling center. This array is to be of
+ * \param [in] point - coordinates of a scaling center. This array is to be of
* size \a this->getSpaceDimension() at least.
* \param [in] factor - a scale factor.
*/
*
* \param [in] patchId - The id of the patch \a cellFieldOnThis has to be put on.
* \param [in] cellFieldOnThis - The array of the cell field on \c this->getImageMesh() to be projected to patch having id \a patchId.
- * \param [in,out] cellFieldOnPatch - The array of the cell field on the requested patch to be filled.
* \param [in] ghostLev - The size of the ghost zone (must be >=0 !)
* \param [in] arrsOnPatches - \b WARNING arrsOnPatches[patchId] is \b NOT \b const. All others are const.
*
/*!
* This method creates a multi level patches split at once.
- * This method calls as times as size of \a bso createPatchesFromCriterion. Size of \a bso and size of \a factors must be the same !
+ * This method calls as many times as size of \a bso createPatchesFromCriterion. Size of \a bso and size of \a factors must be the same !
* \b WARNING, after the call the number of levels in \a this is equal to bso.size() + 1 !
*
- * \param [in] bso
- * \param [in] criterion
- * \param [in] factors
+ * \param [in] bso vector of BoxSplittingOptions
+ * \param [in] criterion DataArrayDouble
+ * \param [in] factors vector of vector of factors
* \param [in] eps - See DataArrayDouble::toVectorOfBool for more information about the semantic of eps.
*
* \sa createPatchesFromCriterion
}
/*!
- * \param [in,out] f field fed with good values.
+ * \param [in] isAbs whether to compute signed or absolute values
+ * \param [in,out] field field fed with good values.
* \sa MEDCouplingCurveLinearMesh::getMeasureField
*/
void MEDCouplingCurveLinearMesh::getMeasureFieldMeshDim1(bool isAbs, MEDCouplingFieldDouble *field) const
}
/*!
- * \param [in,out] f field fed with good values.
+ * \param [in] isAbs whether to compute signed or absolute values
+ * \param [in,out] field field fed with good values.
* \sa MEDCouplingCurveLinearMesh::getMeasureField
*/
void MEDCouplingCurveLinearMesh::getMeasureFieldMeshDim2(bool isAbs, MEDCouplingFieldDouble *field) const
}
/*!
- * \param [in,out] f field fed with good values.
+ * \param [in] isAbs whether to compute signed or absolute values
+ * \param [in,out] field field fed with good values.
* \sa MEDCouplingCurveLinearMesh::getMeasureField
*/
void MEDCouplingCurveLinearMesh::getMeasureFieldMeshDim3(bool isAbs, MEDCouplingFieldDouble *field) const
* problem.
* \param [in] locId - the id of the Gauss localization object of interest.
* It must be in range <em> 0 <= locId < getNbOfGaussLocalization() </em>.
- * \return \ref MEDCoupling::MEDCouplingGaussLocalization "MEDCouplingGaussLocalization" & - the
+ * \return the Gauss localization object as a \ref MEDCoupling::MEDCouplingGaussLocalization "MEDCouplingGaussLocalization" &.
* Gauss localization object.
* \throw If \a this field is not on Gauss points.
* \throw If \a locId is not within the valid range.
* \ref MEDCoupling::ONE_TIME "ONE_TIME",
* \ref MEDCoupling::LINEAR_TIME "LINEAR_TIME",
* \ref MEDCoupling::CONST_ON_TIME_INTERVAL "CONST_ON_TIME_INTERVAL").
- * \param [in] deepCopy - if \c true, the copy of the underlying data arrays is
+ * \param [in] deepCpy - if \c true, the copy of the underlying data arrays is
* deep, else all data arrays of \a this field are shared by the new field.
* \return MEDCouplingFieldDouble* - a new instance of MEDCouplingFieldDouble. The
* caller is to delete this field using decrRef() as it is no more needed.
* For more info on renumbering see \ref numbering.
* \param [in] new2Old - C array of length equal to \a this->getNumberOfTuples()
* giving a previous position of i-th new value.
- * \return DataArrayDouble * - the new instance of DataArrayDouble that the caller
- * is to delete using decrRef() as it is no more needed.
*/
template<class T>
void DataArrayTemplate<T>::renumberInPlaceR(const mcIdType *new2Old)
* Changes the number of components within \a this array so that its raw data **does
* not** change, instead splitting this data into tuples changes.
* \warning This method erases all (name and unit) component info set before!
- * \param [in] newNbOfComp - number of components for \a this array to have.
+ * \param [in] newNbOfCompo - number of components for \a this array to have.
* \throw If \a this is not allocated
* \throw If getNbOfElems() % \a newNbOfCompo != 0.
* \throw If \a newNbOfCompo is lower than 1.
* from values of \a this array, which is supposed to contain a renumbering map in
* "New to Old" mode. The result array contains a renumbering map in "Old to New" mode.
* To know how to use the renumbering maps see \ref numbering.
- * \param [in] newNbOfElem - the number of tuples in the result array.
+ * \param [in] oldNbOfElem - the number of tuples in the result array.
* \return DataArrayInt * - the new instance of DataArrayInt.
* The caller is to delete this result array using decrRef() as it is no more
* needed.
* from values of \a this array, which is supposed to contain a renumbering map in
* "New to Old" mode. The result array contains a renumbering map in "Old to New" mode.
* To know how to use the renumbering maps see \ref numbering.
- * \param [in] newNbOfElem - the number of tuples in the result array.
* \return MapII - the new instance of Map.
*
* \if ENABLE_EXAMPLES
*
* \param [in] idsOfSelectStart begin of set of ids of the input extraction (included)
* \param [in] idsOfSelectStop end of set of ids of the input extraction (excluded)
- * \param [in] idsOfSelectStep
+ * \param [in] idsOfSelectStep step of set of ids of the input extraction
* \param [in] arrIn arr origin array from which the extraction will be done.
* \param [in] arrIndxIn is the input index array allowing to walk into \b arrIn
* \param [out] arrOut the resulting array
/*!
* Returns a new DataArrayChar by concatenating two given arrays, so that (1) the number
- * of tuples in the result array is <em> a1->getNumberOfTuples() + a2->getNumberOfTuples() -
- * offsetA2</em> and (2)
+ * of tuples in the result array is <em> a1->getNumberOfTuples() + a2->getNumberOfTuples() </em> and (2)
* the number of component in the result array is same as that of each of given arrays.
- * First \a offsetA2 tuples of \a a2 are skipped and thus are missing from the result array.
* Info on components is copied from the first of the given arrays. Number of components
* in the given arrays must be the same.
* \param [in] a1 - an array to include in the result array.
* \param [in] a2 - another array to include in the result array.
- * \param [in] offsetA2 - number of tuples of \a a2 to skip.
* \return DataArrayChar * - the new instance of DataArrayChar.
* The caller is to delete this result array using decrRef() as it is no more
* needed.
/*!
* @param comm in param in the same format than one returned by findCommonNodes method (\ref numbering-indirect).
- * @param commI in param in the same format than one returned by findCommonNodes method (\ref numbering-indirect).
+ * @param commIndex in param in the same format than one returned by findCommonNodes method (\ref numbering-indirect).
+ * @param newNbOfNodes new number of nodes
* @return the old to new correspondence array.
*/
DataArrayIdType *MEDCouplingPointSet::buildNewNumberingFromCommonNodesFormat(const DataArrayIdType *comm, const DataArrayIdType *commIndex,
* If meshes of \b srcField and \b targetField do not match exactly those given into \ref MEDCoupling::MEDCouplingRemapper::prepare "prepare method" an exception will be thrown.
*
* \param [in] srcField is the source field from which the interpolation will be done. The mesh into \b srcField should be the same than those specified on MEDCoupling::MEDCouplingRemapper::prepare.
- * \param [in/out] targetField the destination field with the allocated array in which all tuples will be overwritten.
+ * \param [in,out] targetField the destination field with the allocated array in which all tuples will be overwritten.
* \param [in] dftValue is the value that will be assigned in the targetField to each entity of target mesh (entity depending on the method selected on prepare invocation) that is not intercepted by any entity of source mesh.
* For example in "P0P0" case (cell-cell) if a cell in target mesh is not overlapped by any source cell the \a dftValue value will be attached on that cell in the returned \a targetField. In some cases a target
* cell not intercepted by any source cell is a bug so in this case it is advised to set a huge value (1e300 for example) to \a dftValue to quickly point to the problem. But for users doing parallelism a target cell can
* \param[in] superPackIndices the list of super-packs that should be inspected
* \param[in] packBg the pack that the function is looking for in each of the provided super-pack
* \param[in] packEnd the pack that the function is looking for in each of the provided super-pack
- * \param[out] a vector of mcIdType, having the same size as superPackIndices and containing for each inspected super-pack
+ * \param[out] out a vector of mcIdType, having the same size as superPackIndices and containing for each inspected super-pack
* the index of the first matching pack, or -1 if none found.
*/
void MEDCouplingSkyLineArray::findPackIds(const std::vector<mcIdType> & superPackIndices,
/*!
* This method returns for a cell which id is \a cellId the location (locX,locY,locZ) of this cell in \a this.
*
- * \param [in] cellId
+ * \param [in] cellId ID of the cell
* \return - A vector of size this->getMeshDimension()
* \throw if \a cellId not in [ 0, this->getNumberOfCells() )
*/
/*!
* This method returns for a node which id is \a nodeId the location (locX,locY,locZ) of this node in \a this.
*
- * \param [in] nodeId
+ * \param [in] nodeId ID of the node
* \return - A vector of size this->getSpaceDimension()
* \throw if \a cellId not in [ 0, this->getNumberOfNodes() )
*/
* \param [in] startCellId specifies the cellId starting from which the equality computation will be carried out. By default it is 0, which it means that all cells in \a this will be scanned.
* \param [out] commonCellsArr common cells ids (\ref numbering-indirect)
* \param [out] commonCellsIArr common cells ids (\ref numbering-indirect)
- * \return the correspondence array old to new in a newly allocated array.
*
*/
void MEDCouplingUMesh::findCommonCells(int compType, mcIdType startCellId, DataArrayIdType *& commonCellsArr, DataArrayIdType *& commonCellsIArr) const
* By default coordinates are kept. This method is close to MEDCouplingUMesh::buildPartOfMySelf except that here input
* cellIds is not given explicitly but by a range python like.
*
- * \param start
- * \param end
- * \param step
+ * \param start starting ID
+ * \param end end ID (excluded)
+ * \param step step size
* \param keepCoords that specifies if you want or not to keep coords as this or zip it (see MEDCoupling::MEDCouplingUMesh::zipCoords). If true zipCoords is \b NOT called, if false, zipCoords is called.
* \return a newly allocated
*
* \throw if \b otherDimM1OnSameCoords is not part of constituent of \b this, or if coordinate pointer of \b this and \b otherDimM1OnSameCoords
* are not same, or if this->getMeshDimension()-1!=otherDimM1OnSameCoords.getMeshDimension()
*
- * \param [in] otherDimM1OnSameCoords
+ * \param [in] otherDimM1OnSameCoords other mesh
* \param [out] cellIdsRk0 a newly allocated array containing the cell ids of s0 (which are cell ids of \b this) in the above algorithm.
* \param [out] cellIdsRk1 a newly allocated array containing the cell ids of s1 \b indexed into the \b cellIdsRk0 subset. To get the absolute ids of s1, simply invoke
* cellIdsRk1->transformWithIndArr(cellIdsRk0->begin(),cellIdsRk0->end());
* should be contained in[0;this->getNumberOfCells()).
*
* \param [in] old2NewBg is expected to be a dynamically allocated pointer of size at least equal to this->getNumberOfCells()
- * \param check
+ * \param check whether to check content of old2NewBg
*/
void MEDCouplingUMesh::renumberCells(const mcIdType *old2NewBg, bool check)
{
/*!
* Second step of serialization process.
* \param tinyInfo must be equal to the result given by getTinySerializationInformation method.
- * \param a1
- * \param a2
- * \param littleStrings
+ * \param a1 DataArrayDouble
+ * \param a2 DataArrayDouble
+ * \param littleStrings string vector
*/
void MEDCouplingUMesh::resizeForUnserialization(const std::vector<mcIdType>& tinyInfo, DataArrayIdType *a1, DataArrayDouble *a2, std::vector<std::string>& littleStrings) const
{
* The result is put in the array \a idsPerType. In the returned parameter \a code, foreach i \a code[3*i+2] refers (if different from -1) to a location into the \a idsPerType.
* This method has 1 input \a profile and 3 outputs \a code \a idsInPflPerType and \a idsPerType.
*
- * \param [in] profile
+ * \param [in] profile list of IDs constituing the profile
* \param [out] code is a vector of size 3*n where n is the number of different geometric type in \a this \b reduced to the profile \a profile. \a code has exactly the same semantic than in MEDCouplingUMesh::checkTypeConsistencyAndContig method.
* \param [out] idsInPflPerType is a vector of size of different geometric type in the subpart defined by \a profile of \a this ( equal to \a code.size()/3). For each i,
* \a idsInPflPerType[i] stores the tuple ids in \a profile that correspond to the geometric type code[3*i+0]
/*!
* Convert the nodal connectivity of the mesh so that all the cells are of dynamic types (polygon or quadratic
* polygon). This returns the corresponding new nodal connectivity in \ref numbering-indirect format.
- * \param nodalConn
- * \param nodalConnI
+ * \param nodalConn nodal connectivity
+ * \param nodalConnIndex nodal connectivity indices
*/
void MEDCouplingUMesh::convertNodalConnectivityToDynamicGeoTypeMesh(DataArrayIdType *&nodalConn, DataArrayIdType *&nodalConnIndex) const
{
*
* \param [in] eps is a relative precision that allows to establish if some 3D plane are coplanar or not.
* \param [in] coords the coordinates with nb of components exactly equal to 3
- * \param [in] begin begin of the nodal connectivity (geometric type included) of a single polyhedron cell
- * \param [in] end end of nodal connectivity of a single polyhedron cell (excluded)
+ * \param [in] index begin of the nodal connectivity (geometric type included) of a single polyhedron cell
* \param [out] res the result is put at the end of the vector without any alteration of the data.
*/
void MEDCouplingUMesh::SimplifyPolyhedronCell(double eps, const DataArrayDouble *coords, mcIdType index, DataArrayIdType *res, MEDCouplingUMesh *faces,
* This method allows to compute given the status of 3D curve cells and the descending connectivity 3DSurf->3DCurve to deduce the intersection of each 3D surf cells
* with a plane. The result will be put in 'cut3DSuf' out parameter.
* \param [in] cut3DCurve input parameter that gives for each 3DCurve cell if it owns fully to the plane or partially.
- * \param [out] nodesOnPlane, returns all the nodes that are on the plane.
+ * \param [out] nodesOnPlane returns all the nodes that are on the plane.
* \param [in] nodal3DSurf is the nodal connectivity of 3D surf mesh.
* \param [in] nodalIndx3DSurf is the nodal connectivity index of 3D surf mesh.
* \param [in] nodal3DCurve is the nodal connectivity of 3D curve mesh.
- * \param [in] nodal3DIndxCurve is the nodal connectivity index of 3D curve mesh.
+ * \param [in] nodalIndx3DCurve is the nodal connectivity index of 3D curve mesh.
* \param [in] desc is the descending connectivity 3DSurf->3DCurve
* \param [in] descIndx is the descending connectivity index 3DSurf->3DCurve
- * \param [out] cut3DSuf input/output param.
+ * \param [out] cut3DSurf input/output param.
*/
void MEDCouplingUMesh::AssemblyForSplitFrom3DCurve(const std::vector<mcIdType>& cut3DCurve, std::vector<mcIdType>& nodesOnPlane, const mcIdType *nodal3DSurf, const mcIdType *nodalIndx3DSurf,
const mcIdType *nodal3DCurve, const mcIdType *nodalIndx3DCurve,
* Private. Third step of the partitioning algorithm (Intersect2DMeshes): reconstruct full 2D cells from the
* (newly created) nodes corresponding to the edge intersections.
* Output params:
- * @param[out] cr, crI connectivity of the resulting mesh
- * @param[out] cNb1, cNb2 correspondence arrays giving for the merged mesh the initial cells IDs in m1 / m2
+ * @param[out] cr connectivity of the resulting mesh
+ * @param[out] crI connectivity of the resulting mesh
+ * @param[out] cNb1 correspondence arrays giving for the merged mesh the initial cells IDs in m1 / m2
+ * @param[out] cNb2 correspondence arrays giving for the merged mesh the initial cells IDs in m1 / m2
* TODO: describe input parameters
*/
void MEDCouplingUMesh::BuildIntersecting2DCellsFromEdges(double eps, const MEDCouplingUMesh *m1, const mcIdType *desc1, const mcIdType *descIndx1,
* The meshes should be in 2D space. In
* addition, returns two arrays mapping cells of the result mesh to cells of the input
* meshes.
+ * \b WARNING: the two meshes should be correctly oriented for this method to work properly. Methods changeSpaceDimension() and
+ * orientCorrectly2DCells() can be used for this.
+ * \b WARNING: the two meshes should be "clean" (no un-merged nodes, no non-conformal cells)
* \param [in] m1 - the first input mesh which is a partitioned object. The mesh must be so that each point in the space covered by \a m1
* must be covered exactly by one entity, \b no \b more. If it is not the case, some tools are available to heal the mesh (conformize2D, mergeNodes)
* \param [in] m2 - the second input mesh which is a partition tool. The mesh must be so that each point in the space covered by \a m2
* and finally, in case of quadratic polygon the centers of edges new nodes.
* The meshes should be in 2D space. In addition, returns two arrays mapping cells of the resulting mesh to cells of the input.
*
+ * \b WARNING: the 2D mesh should be correctly oriented for this method to work properly. Methods changeSpaceDimension() and
+ * orientCorrectly2DCells() can be used for this.
+ * \b WARNING: the two meshes should be "clean" (no un-merged nodes, no non-conformal cells)
+ *
* \param [in] mesh2D - the 2D mesh (spacedim=meshdim=2) to be intersected using \a mesh1D tool. The mesh must be so that each point in the space covered by \a mesh2D
* must be covered exactly by one entity, \b no \b more. If it is not the case, some tools are available to heal the mesh (conformize2D, mergeNodes)
* \param [in] mesh1D - the 1D mesh (spacedim=2 meshdim=1) the is the tool that will be used to intersect \a mesh2D. \a mesh1D must be ordered consecutively. If it is not the case
CPPUNIT_ASSERT_EQUAL(ToIdType(0),f->getGaussLocalizationIdOfOneCell(0));
CPPUNIT_ASSERT_EQUAL(ToIdType(1),f->getGaussLocalizationIdOfOneCell(1));
CPPUNIT_ASSERT_EQUAL(ToIdType(1),f->getGaussLocalizationIdOfOneCell(2));
- CPPUNIT_ASSERT_THROW(f->checkConsistencyLight(),INTERP_KERNEL::Exception);//<- cell 3 has no localization
+ CPPUNIT_ASSERT_THROW(f->checkConsistencyLight(),INTERP_KERNEL::Exception);// <- cell 3 has no localization
mcIdType ids4[1]={3};
std::vector<double> _gsCoo2(_gsCoo1);
std::vector<double> _wg2(_wg1);
f->getCellIdsHavingGaussLocalization(0,tmpIds);
CPPUNIT_ASSERT_EQUAL(2,(int)tmpIds.size());
CPPUNIT_ASSERT(std::equal(ids2,ids2+2,tmpIds.begin()));
- CPPUNIT_ASSERT_THROW(f->checkConsistencyLight(),INTERP_KERNEL::Exception);//<- it's always not ok because undelying array not with the good size.
+ CPPUNIT_ASSERT_THROW(f->checkConsistencyLight(),INTERP_KERNEL::Exception);// <- it's always not ok because undelying array not with the good size.
DataArrayDouble *array2=f->getArray()->subArray(0,10);
f->setArray(array2);
array2->decrRef();
- f->checkConsistencyLight();//<- here it is OK
+ f->checkConsistencyLight();// <- here it is OK
MEDCouplingFieldDouble *f2=f->clone(true);
CPPUNIT_ASSERT(f->isEqual(f2,1e-14,1e-14));
MEDCouplingGaussLocalization& gl1=f2->getGaussLocalization(0);
* has not been constructed via file reading, an exception is thrown.
* For more info, see \ref AdvMEDLoaderAPIFieldRW
* \param [in] type - a spatial discretization of interest.
- * \param [in] mName - a name of the supporting mesh.
+ * \param [in] mname - a name of the supporting mesh.
* \param [in] meshDimRelToMax - a relative dimension of the supporting mesh entities.
* \param [in] renumPol - specifies how to permute values of the result field according to
* the optional numbers of cells and nodes, if any. The valid values are
* field of interest lies on. If the field lies on all entities of the given
* dimension, all ids in \a pfl are zero. The caller is to delete this array
* using decrRef() as it is no more needed.
- * \param [in] glob - the global data storing profiles and localization.
* \return DataArrayDouble * - a new instance of DataArrayDouble holding values of the
* field. The caller is to delete this array using decrRef() as it is no more needed.
* \throw If there are no mesh entities of \a meshDimRelToMax dimension in \a mesh.
/*!
* This method throws an INTERP_KERNEL::Exception if \a fieldName field is not in file pointed by \a fid and with name \a fileName.
*
- * \param [out]
+ * \param [in] fid - MED file handler
+ * \param [in] fieldName - name of the field
+ * \param [out] posCFormat - index of the field in the file(?)
+ * \param [out] typcha - type of the field
+ * \param [out] infos - informations on the field
+ * \param [out] dtunitOut - time unit description
+ * \param [out] meshName - name of the mesh supporting the field
* \return in case of success the number of time steps available for the field with name \a fieldName.
*/
int MEDFileAnyTypeField1TS::LocateField(med_idt fid, const std::string& fieldName, int& posCFormat, med_field_type& typcha, std::vector<std::string>& infos, std::string& dtunitOut, std::string& meshName)
/*!
* Creates a MEDFileFieldGlobsReal on a given file name. Nothing is read here.
- * \param [in] fname - the file name.
+ * \param [in] fid - the MED file handler.
*/
MEDFileFieldGlobsReal::MEDFileFieldGlobsReal(med_idt fid):_globals(MEDFileFieldGlobs::New(fid))
{
/*!
* Returns a string describing profiles and Gauss points held in \a this.
- * \return std::string - the description string.
+ * \param[out] oss - the description string (in a std::ostream).
*/
void MEDFileFieldGlobsReal::simpleReprGlobs(std::ostream& oss) const
{
/*!
* Sets the name of a MED file.
- * \param [inout] fileName - the file name.
+ * \param [in,out] fileName - the file name.
*/
void MEDFileFieldGlobsReal::setFileName(const std::string& fileName)
{
/*!
* Returns an id of a profile by its name.
- * \param [in] loc - the profile name of interest.
+ * \param [in] pfl - the profile name of interest.
* \return int - the id of the profile.
* \throw If there is no a profile named \a loc.
*/
/*!
* Sets name of \a this field
- * \param [in] name - the new field name.
+ * \param [in] fieldName - the new field name.
*/
void MEDFileFieldNameScope::setName(const std::string& fieldName)
{
/*!
* Leaf method of field with profile assignment. This method is the most general one. No optimization is done here.
- * \param [in] pflName input containing name of profile if any. 0 if no profile (except for GAUSS_PT where a no profile can hide a profile when split by loc_id).
+ * \param [in] isPflAlone whether there are several profiles or not
+ * \param [in] start starting ID
* \param [in] multiTypePfl is the end user profile specified in high level API
* \param [in] idsInPfl is the selection into the \a multiTypePfl whole profile that corresponds to the current geometric type.
* \param [in] locIds is the profile needed to be created for MED file format. It can be null if all cells of current geometric type are fetched in \a multiTypePfl.
/*!
* Constructor.
* \param [in] correspondence - correspondence.
- * \param [in] is_nodal - is the correspondence of cells or nodes.
+ * \param [in] isNodal - is the correspondence of cells or nodes.
* \param [in] loc_geo_type - the local geometry type of correspondence.
* \param [in] rem_geo_type - the remote geometry type of correspondence.
*/
/*!
* Returns a new MEDFileJoint holding the mesh data that has been read from a given MED
* file. The Joint to load is specified by mesh name and a Joint iteration.
- * \param [in] fileName - the name of MED file to read.
+ * \param [in] fid - the handler ID of MED file to read.
* \param [in] mName - the name of the mesh to read.
* \param [in] curJoint - the iteration number of current joint.
- * \return MEDFileJoint * - a new instance of MEDFileJoint.
* \throw If the file is not readable.
* \throw If there is no mesh with given attributes in the file.
*/
}
/*!
- * Returns ids of nodes contained in a given group.
- * \param [in] grp - the name of the group of interest.
+ * Returns ids of nodes contained in a given family.
+ * \param [in] fam - the name of the family of interest.
* \param [in] renum - if \c true, the optional numbers of nodes, if available, are
* returned instead of ids.
* \return DataArrayIdType * - a new instance of DataArrayIdType holding either ids or
- * numbers, if available and required, of nodes of the group. The caller
+ * numbers, if available and required, of nodes of the family. The caller
* is to delete this array using decrRef() as it is no more needed.
- * \throw If the name of a nonexistent group is specified.
+ * \throw If the name of a nonexistent family is specified.
* \throw If the family field is missing for nodes.
*/
DataArrayIdType *MEDFileMesh::getNodeFamilyArr(const std::string& fam, bool renum) const
* \param [in] fileName - the name of the file.
* \param [in] mName - the name of the mesh to be read.
* \param [in] types - the list of the geo types of which some part will be taken. A geometric type in \a types must appear only once at most.
- * \param [in] slicPerType - an array of size 3 times larger than \a types that specifies for each type in \a types (in the same order) resp the start, the stop and the step.
+ * \param [in] slicPerTyp - an array of size 3 times larger than \a types that specifies for each type in \a types (in the same order) resp the start, the stop and the step.
* \param [in] dt - the iteration, that is to say the first element of the pair that locates the asked time step.
* \param [in] it - the order, that is to say the second element of the pair that locates the asked time step.
* \param [in] mrs - the request for what to be loaded.
* \param [in] mName - Name of the mesh inside file pointed be \a fileName nodes to be read of.
* \param [in] dt - Time iteration inside file pointed be \a fileName nodes to be read of.
* \param [in] it - Time order inside file pointed be \a fileName nodes to be read of.
- * \param [in] infosOnCompo - Components info of nodes to be read of. The size of string vector should be equal to space dimension of mesh to be read.
+ * \param [in] infosOnComp - Components info of nodes to be read of. The size of string vector should be equal to space dimension of mesh to be read.
* \param [in] startNodeId - Start Node Id (included) of chunk of data to be read
* \param [in] stopNodeId - Start Node Id (included) of chunk of data to be read
* \param [out] coords - output coordinates of requested chunk (DataArrayDouble)
* valid**. This is a feature, because MEDLoader does not create cells that do not exist!
* To build a valid MEDCouplingUMesh from the returned one in this case,
* call MEDCouplingUMesh::Build0DMeshFromCoords().
- * \param [in] meshDimRelToMax - the relative dimension of interest.
+ * \param [in] meshDimRelToMaxExt - the relative dimension of interest.
* \param [in] renum - if \c true, the returned mesh is permuted according to the
* optional numbers of mesh entities.
* \return MEDCouplingUMesh * - a pointer to MEDCouplingUMesh that the caller is to
}
/*!
- * \param [out] ret1
+ * \param [out] ret1 - list of available timesteps
*/
std::vector< std::pair<int,int> > MEDFileParameterMultiTS::getTimeSteps(std::vector<double>& ret1) const
{
//================================================================================
/*!
* \brief Split sub-components with different nb of gauss points into several sub-components
- * \param [in,out] fld - a field to split if necessary
*/
//================================================================================
WriteUMesh(fileName,mesh1,true);
const mcIdType part1[5]={1,2,4,13,15};
MEDCouplingUMesh *mesh2=(MEDCouplingUMesh *)mesh1->buildPartOfMySelf(part1,part1+5,true);
- mesh2->setName(mesh1->getName().c_str());//<- important for the test
+ mesh2->setName(mesh1->getName().c_str());// <- important for the test
//
mcIdType nbOfCells=mesh2->getNumberOfCells();
CPPUNIT_ASSERT_EQUAL(ToIdType(5),nbOfCells);
f1->setTime(3.14,2,7);
f1->checkConsistencyLight();
//
- WriteField(fileName,f1,false);//<- false important for the test
+ WriteField(fileName,f1,false);// <- false important for the test
//
MEDCouplingFieldDouble *f2=dynamic_cast<MEDCouplingFieldDouble *>(ReadFieldCell(fileName,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),2,7));
std::vector<MEDCoupling::TypeOfField> types=GetTypesOfField(fileName,f1->getMesh()->getName().c_str(),f1->getName().c_str());
const mcIdType arr2[2]={1,4};//node ids are 2,4,5,3,6,7
MEDCouplingFieldDouble *f2=f1->buildSubPart(arr2,arr2+2);
(const_cast<MEDCouplingMesh *>(f2->getMesh()))->setName(f1->getMesh()->getName().c_str());
- WriteField(fileName,f2,false);//<- false important for the test
+ WriteField(fileName,f2,false);// <- false important for the test
//
MEDCouplingFieldDouble *f3=dynamic_cast<MEDCouplingFieldDouble *>(ReadFieldNode(fileName,f2->getMesh()->getName().c_str(),0,f2->getName().c_str(),2,7));
f3->checkConsistencyLight();
const mcIdType arr3[6]={1,3,0,5,2,4};
f2->renumberNodes(arr3);
WriteUMesh(fileName2,m,true);
- WriteField(fileName2,f2,false);//<- false important for the test
+ WriteField(fileName2,f2,false);// <- false important for the test
f3=dynamic_cast<MEDCouplingFieldDouble *>(ReadFieldNode(fileName2,f2->getMesh()->getName().c_str(),0,f2->getName().c_str(),2,7));
f3->checkConsistencyLight();
CPPUNIT_ASSERT(f3->isEqual(f2,1e-12,1e-12));
const mcIdType renumArr[12]={3,7,2,1,5,11,10,0,9,6,8,4};
f1->renumberNodes(renumArr);
f1->checkConsistencyLight();
- WriteField(fileName,f1,false);//<- false important for the test
+ WriteField(fileName,f1,false);// <- false important for the test
MEDCouplingFieldDouble *f2=dynamic_cast<MEDCouplingFieldDouble *>(ReadFieldNode(fileName,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),2,7));
CPPUNIT_ASSERT(f2->isEqual(f1,1e-12,1e-12));
//
MPI_Datatype ParaTraits<Int64>::MPIDataType = MPI_LONG;
- /*! \anchor CommInterface-det
- \class CommInterface
-
- The class \a CommInterface is the gateway to the MPI library.
- It is a wrapper around all MPI calls, thus trying to abstract the rest of the code from using the direct MPI API
- (but this is not strictly respected overall in practice ...). It is used in all
- the \ref parallel "DEC related classes".
-
- It is typically instantiated after the MPI_Init() call in a program and is afterwards passed as a
- parameter to the constructors of various \ref parallel "parallel objects" so that they access the
- MPI library via this common interface.
-
- As an example, the following code excerpt initializes a processor group made of the zero processor.
-
- \verbatim
- #include "CommInterface.hxx"
- #include "ProcessorGroup.hxx"
-
- int main(int argc, char** argv)
- {
- //initialization
- MPI_Init(&argc, &argv);
- MEDCoupling::CommInterface comm_interface;
-
- //setting up a processor group with proc 0
- set<int> procs;
- procs.insert(0);
- MEDCoupling::ProcessorGroup group(procs, comm_interface);
-
- //cleanup
- MPI_Finalize();
- }
- \endverbatim
- */
-
void CommInterface::gatherArrays(MPI_Comm comm, int root, const DataArrayIdType *array, std::vector< MCAuto<DataArrayIdType> >& arraysOut) const
{
this->gatherArraysT2<mcIdType>(comm,root,array,arraysOut);
static MPI_Datatype MPIDataType;
};
+ /*! \anchor CommInterface-det
+ \class CommInterface
+
+ The class \a CommInterface is the gateway to the MPI library.
+ It is a wrapper around all MPI calls, thus trying to abstract the rest of the code from using the direct MPI API
+ (but this is not strictly respected overall in practice ...). It is used in all
+ the \ref parallel "DEC related classes".
+
+ It is typically instantiated after the MPI_Init() call in a program and is afterwards passed as a
+ parameter to the constructors of various \ref parallel "parallel objects" so that they access the
+ MPI library via this common interface.
+
+ As an example, the following code excerpt initializes a processor group made of the zero processor.
+
+ \verbatim
+ #include "CommInterface.hxx"
+ #include "ProcessorGroup.hxx"
+
+ int main(int argc, char** argv)
+ {
+ //initialization
+ MPI_Init(&argc, &argv);
+ MEDCoupling::CommInterface comm_interface;
+
+ //setting up a processor group with proc 0
+ set<int> procs;
+ procs.insert(0);
+ MEDCoupling::ProcessorGroup group(procs, comm_interface);
+
+ //cleanup
+ MPI_Finalize();
+ }
+ \endverbatim
+ */
class CommInterface
{
public:
namespace MEDCoupling
{
-
- /*!
- * \anchor DisjointDEC-det
- * \class DisjointDEC
- *
- * \section DisjointDEC-over Overview
- *
- * Abstract interface class representing a link between two
- * processor groups for exchanging mesh or field data. The two processor groups must
- * have a void intersection (\ref MEDCoupling::OverlapDEC "OverlapDEC" is to be considered otherwise).
- * The %DEC is initialized by attaching a field on the receiving or on the
- * sending side.
- *
- * The data is sent or received through calls to the (abstract) methods recvData() and sendData().
- *
- * One can attach either a \c MEDCoupling::ParaFIELD, or a
- * \c ICoCo::Field, or directly a \c MEDCoupling::MEDCouplingFieldDouble instance.
- * See the various signatures of the method DisjointDEC::attachLocalField()
- *
- * The derivations of this class should be considered for practical instantiation:
- * - \ref InterpKernelDEC-det "InterpKernelDEC"
- * - \ref ExplicitCoincidentDEC-det "ExplicitCoincidentDEC"
- * - \ref StructuredCoincidentDEC-det "StructuredCoincidentDEC"
- *
- * \section DisjointDEC-options DisjointDEC options
- * The options supported by %DisjointDEC objects are the same that the ones supported for all
- * DECs in general and are all inherited from the class \ref MEDCoupling::DECOptions "DECOptions"
- *
- */
-
DisjointDEC::DisjointDEC(ProcessorGroup& source_group, ProcessorGroup& target_group):
_local_field(0),
_source_group(&source_group),
{
class ProcessorGroup;
class ParaFIELD;
-
+
+ /*!
+ * \anchor DisjointDEC-det
+ * \class DisjointDEC
+ *
+ * \section DisjointDEC-over Overview
+ *
+ * Abstract interface class representing a link between two
+ * processor groups for exchanging mesh or field data. The two processor groups must
+ * have a void intersection (\ref MEDCoupling::OverlapDEC "OverlapDEC" is to be considered otherwise).
+ * The %DEC is initialized by attaching a field on the receiving or on the
+ * sending side.
+ *
+ * The data is sent or received through calls to the (abstract) methods recvData() and sendData().
+ *
+ * One can attach either a \c MEDCoupling::ParaFIELD, or a
+ * \c ICoCo::Field, or directly a \c MEDCoupling::MEDCouplingFieldDouble instance.
+ * See the various signatures of the method DisjointDEC::attachLocalField()
+ *
+ * The derivations of this class should be considered for practical instantiation:
+ * - \ref InterpKernelDEC-det "InterpKernelDEC"
+ * - \ref ExplicitCoincidentDEC-det "ExplicitCoincidentDEC"
+ * - \ref StructuredCoincidentDEC-det "StructuredCoincidentDEC"
+ *
+ * \section DisjointDEC-options DisjointDEC options
+ * The options supported by %DisjointDEC objects are the same that the ones supported for all
+ * DECs in general and are all inherited from the class \ref MEDCoupling::DECOptions "DECOptions"
+ *
+ */
+
class DisjointDEC : public DEC
{
public:
#include "ElementLocator.hxx"
namespace MEDCoupling
-{
-
- /*!
- \anchor InterpKernelDEC-det
- \class InterpKernelDEC
-
- \section InterpKernelDEC-over Overview
-
- The InterpKernelDEC enables the \ref InterpKerRemapGlobal "remapping" (or interpolation) of fields between
- two parallel codes.
-
- The projection
- methodology is based on the algorithms of %INTERP_KERNEL, that is to say, they work in a similar fashion than
- what the \ref remapper "sequential remapper" does. The following \ref discretization "projection methods"
- are supported: P0->P0 (the most common case), P1->P0, P0->P1.
-
- The computation is possible for 3D meshes, 2D meshes, and 3D-surface
- meshes. Dimensions must be identical for code A and code B (for instance, though it could be
- desirable, it is not yet possible to couple 3D surfaces with 2D surfaces).
-
- The name "InterpKernelDEC" comes from the fact that this class uses exactly the same algorithms
- as the sequential remapper. Both this class and the sequential
- \ref MEDCoupling::MEDCouplingRemapper "MEDCouplingRemapper" are built on top of the %INTERP_KERNEL
- algorithms (notably the computation of the intersection volumes).
-
- Among the important properties inherited from the parent abstract class \ref DisjointDEC-det "DisjointDEC",
- the two \ref MPIProcessorGroup-det "processor groups" (source and target) must have a void intersection.
-
- \image html NonCoincident_small.png "Transfer of a field supported by a quadrangular mesh to a triangular mesh".
-
- \image latex NonCoincident_small.eps "Transfer of a field supported by a quadrangular mesh to a triangular mesh"
-
- In the figure above we see the transfer of a field based on a quadrangular mesh to a new field supported by
- a triangular mesh. In a P0-P0 interpolation, to obtain the value on a triangle, the values on the
- quadrangles are weighted by their intersection area and summed.
-
- A typical use of InterpKernelDEC encompasses two distinct phases :
- - A setup phase during which the intersection volumes are computed and the communication structures are
- setup. This corresponds to calling the InterpKernelDEC::synchronize() method.
- - A running phase during which the projections are actually performed. This corresponds to the calls to
- sendData() and recvData() which actually trigger the data exchange. The data exchange are synchronous
- in the current version of the library so that recvData() and sendData() calls must be synchronized
- on code A and code B processor groups.
-
- The following code excerpt illustrates a typical use of the InterpKernelDEC class.
-
- \code
- ...
- InterpKernelDEC dec(groupA, groupB);
- dec.attachLocalField(field);
- dec.synchronize();
- if (groupA.containsMyRank())
- dec.recvData();
- else if (groupB.containsMyRank())
- dec.sendData();
- ...
- \endcode
- A \ref InterpKerRemapGlobal "remapping" of the field from the source mesh to the target mesh is performed by
- the function synchronise(), which computes the interpolation matrix.
-
- Computing the field on the receiving side can be expressed in terms of a matrix-vector product :
- \f$ \phi_t=W.\phi_s\f$, with \f$ \phi_t \f$ the field on the target side and \f$ \phi_s \f$ the field
- on the source side.
- When remapping a 3D surface to another 3D surface, a projection phase is necessary to match elements
- from both sides. Care must be taken when defining this projection to obtain a
- \ref InterpKerRemapGlobal "conservative remapping".
-
- In the P0-P0 case, this matrix is a plain rectangular matrix with coefficients equal to the
- intersection areas between triangle and quadrangles. For instance, in the above figure, the matrix
- is :
-
- \f[
- \begin{tabular}{|cccc|}
- 0.72 & 0 & 0.2 & 0 \\
- 0.46 & 0 & 0.51 & 0.03\\
- 0.42 & 0.53 & 0 & 0.05\\
- 0 & 0 & 0.92 & 0.05 \\
- \end{tabular}
- \f]
-
- \section InterpKernelDEC-options Options
- On top of the usual \ref MEDCoupling::DECOptions "DEC options", the options supported by %InterpKernelDEC objects are
- related to the underlying \ref InterpKerIntersectors "intersector class".
- All the options available in the intersector objects are
- available for the %InterpKernelDEC object. The various options available for intersectors can
- be reviewed in \ref InterpKerIntersectors.
-
- For instance :
- \verbatim
- InterpKernelDEC dec(source_group, target_group);
- dec.attachLocalField(field);
- dec.setDoRotate(false);
- dec.setPrecision(1e-12);
- dec.synchronize();
- \endverbatim
-
- \warning{ Options must be set before calling the synchronize method. }
- */
-
+{
InterpKernelDEC::InterpKernelDEC():
DisjointDEC(),
_nb_distant_points(0), _distant_coords(0),
{
class InterpolationMatrix;
+ /*!
+ \anchor InterpKernelDEC-det
+ \class InterpKernelDEC
+
+ \section InterpKernelDEC-over Overview
+
+ The InterpKernelDEC enables the \ref InterpKerRemapGlobal "remapping" (or interpolation) of fields between
+ two parallel codes.
+
+ The projection
+ methodology is based on the algorithms of %INTERP_KERNEL, that is to say, they work in a similar fashion than
+ what the \ref remapper "sequential remapper" does. The following \ref discretization "projection methods"
+ are supported: P0->P0 (the most common case), P1->P0, P0->P1.
+
+ The computation is possible for 3D meshes, 2D meshes, and 3D-surface
+ meshes. Dimensions must be identical for code A and code B (for instance, though it could be
+ desirable, it is not yet possible to couple 3D surfaces with 2D surfaces).
+
+ The name "InterpKernelDEC" comes from the fact that this class uses exactly the same algorithms
+ as the sequential remapper. Both this class and the sequential
+ \ref MEDCoupling::MEDCouplingRemapper "MEDCouplingRemapper" are built on top of the %INTERP_KERNEL
+ algorithms (notably the computation of the intersection volumes).
+
+ Among the important properties inherited from the parent abstract class \ref DisjointDEC-det "DisjointDEC",
+ the two \ref MPIProcessorGroup-det "processor groups" (source and target) must have a void intersection.
+
+ \image html NonCoincident_small.png "Transfer of a field supported by a quadrangular mesh to a triangular mesh".
+
+ \image latex NonCoincident_small.eps "Transfer of a field supported by a quadrangular mesh to a triangular mesh"
+
+ In the figure above we see the transfer of a field based on a quadrangular mesh to a new field supported by
+ a triangular mesh. In a P0-P0 interpolation, to obtain the value on a triangle, the values on the
+ quadrangles are weighted by their intersection area and summed.
+
+ A typical use of InterpKernelDEC encompasses two distinct phases :
+ - A setup phase during which the intersection volumes are computed and the communication structures are
+ setup. This corresponds to calling the InterpKernelDEC::synchronize() method.
+ - A running phase during which the projections are actually performed. This corresponds to the calls to
+ sendData() and recvData() which actually trigger the data exchange. The data exchange are synchronous
+ in the current version of the library so that recvData() and sendData() calls must be synchronized
+ on code A and code B processor groups.
+
+ The following code excerpt illustrates a typical use of the InterpKernelDEC class.
+
+ \code
+ ...
+ InterpKernelDEC dec(groupA, groupB);
+ dec.attachLocalField(field);
+ dec.synchronize();
+ if (groupA.containsMyRank())
+ dec.recvData();
+ else if (groupB.containsMyRank())
+ dec.sendData();
+ ...
+ \endcode
+ A \ref InterpKerRemapGlobal "remapping" of the field from the source mesh to the target mesh is performed by
+ the function synchronise(), which computes the interpolation matrix.
+
+ Computing the field on the receiving side can be expressed in terms of a matrix-vector product :
+ \f$ \phi_t=W.\phi_s\f$, with \f$ \phi_t \f$ the field on the target side and \f$ \phi_s \f$ the field
+ on the source side.
+ When remapping a 3D surface to another 3D surface, a projection phase is necessary to match elements
+ from both sides. Care must be taken when defining this projection to obtain a
+ \ref InterpKerRemapGlobal "conservative remapping".
+
+ In the P0-P0 case, this matrix is a plain rectangular matrix with coefficients equal to the
+ intersection areas between triangle and quadrangles. For instance, in the above figure, the matrix
+ is :
+
+ \f[
+ \begin{tabular}{|cccc|}
+ 0.72 & 0 & 0.2 & 0 \\
+ 0.46 & 0 & 0.51 & 0.03\\
+ 0.42 & 0.53 & 0 & 0.05\\
+ 0 & 0 & 0.92 & 0.05 \\
+ \end{tabular}
+ \f]
+
+ \section InterpKernelDEC-options Options
+ On top of the usual \ref MEDCoupling::DECOptions "DEC options", the options supported by %InterpKernelDEC objects are
+ related to the underlying \ref InterpKerIntersectors "intersector class".
+ All the options available in the intersector objects are
+ available for the %InterpKernelDEC object. The various options available for intersectors can
+ be reviewed in \ref InterpKerIntersectors.
+
+ For instance :
+ \verbatim
+ InterpKernelDEC dec(source_group, target_group);
+ dec.attachLocalField(field);
+ dec.setDoRotate(false);
+ dec.setPrecision(1e-12);
+ dec.synchronize();
+ \endverbatim
+
+ \warning{ Options must be set before calling the synchronize method. }
+ */
+
class InterpKernelDEC : public DisjointDEC, public INTERP_KERNEL::InterpolationOptions
{
public:
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_field local source field
\param source_group processor group containing the local processors
\param target_group processor group containing the distant processors
- \param method interpolation method
+ \param dec_options DEC options (including projection method P0, P1)
+ \param interp_options interpolation options
*/
InterpolationMatrix::InterpolationMatrix(const MEDCoupling::ParaFIELD *source_field,
const ProcessorGroup& source_group,
* This method introduce global ids aspects in computed 'rowsPartialSumD'.
* As precondition rowsPartialSumD.size()==policyPartial.size()==globalIdsPartial.size(). Foreach i in [0;rowsPartialSumD.size() ) rowsPartialSumD[i].size()==globalIdsPartial[i].size()
* @param rowsPartialSumD : in parameter, Partial row sum computed for each lazy procs connected with.
- * @param rowsPartialSumI : in parameter, Corresponding local ids for each lazy procs connected with.
* @param globalIdsPartial : in parameter, the global numbering, of elements connected with.
* @param globalIdsLazySideInteraction : out parameter, constituted from all global ids of lazy procs connected with.
* @para sumCorresponding : out parameter, relative to 'globalIdsLazySideInteraction'
\param source_group working side ProcessorGroup
\param target_group lazy side ProcessorGroup
\param Asynchronous Communication mode (default asynchronous)
- \param nStepBefore Number of Time step needed for the interpolation before current time
- \param nStepAfter Number of Time step needed for the interpolation after current time
-
*/
-
MPIAccessDEC::MPIAccessDEC( const ProcessorGroup& source_group,
const ProcessorGroup& target_group,
bool Asynchronous )
namespace MEDCoupling
{
-/*!
- \anchor OverlapDEC-det
- \class OverlapDEC
-
- \section OverlapDEC-over Overview
-
- 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 single \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-det "InterpKernelDEC" is that this
- \ref para-dec "DEC" works with a *single* processor group, in which processors will share the work.
- Consequently each processor manages two \ref MEDCouplingFieldTemplatesPage "field templates" (A and B)
- called source and target.
- Furthermore all processors in the processor group cooperate in the global interpolation matrix
- computation. In this respect \c InterpKernelDEC 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 split of the source and target mesh among the 3 procs"
-
- \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 MEDCoupling::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 transfers 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 temporary 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) wherever 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 the matrix-vector computation.
- This is incarnated by OverlapMapping::keepTracksOfSourceIds in proc k.
-
- This step is performed in MEDCoupling::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 the \ref MEDCoupling::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
- MEDCoupling::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 MEDCoupling::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 MEDCoupling::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 : MEDCoupling::OverlapMapping::prepare.
-*/
OverlapDEC::OverlapDEC(const std::set<int>& procIds, const MPI_Comm& world_comm):
_load_balancing_algo(1),
_own_group(true),_interpolation_matrix(0), _locator(0),
class ProcessorGroup;
class ParaFIELD;
+ /*!
+ \anchor OverlapDEC-det
+ \class OverlapDEC
+
+ \section OverlapDEC-over Overview
+
+ 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 single \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-det "InterpKernelDEC" is that this
+ \ref para-dec "DEC" works with a *single* processor group, in which processors will share the work.
+ Consequently each processor manages two \ref MEDCouplingFieldTemplatesPage "field templates" (A and B)
+ called source and target.
+ Furthermore all processors in the processor group cooperate in the global interpolation matrix
+ computation. In this respect \c InterpKernelDEC 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 split of the source and target mesh among the 3 procs"
+
+ \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 MEDCoupling::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 transfers 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 temporary 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) wherever 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 the matrix-vector computation.
+ This is incarnated by OverlapMapping::keepTracksOfSourceIds in proc k.
+
+ This step is performed in MEDCoupling::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 the \ref MEDCoupling::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
+ MEDCoupling::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 MEDCoupling::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 MEDCoupling::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 : MEDCoupling::OverlapMapping::prepare.
+ */
+
class OverlapDEC : public DEC, public INTERP_KERNEL::InterpolationOptions
{
public:
namespace MEDCoupling
{
- /*!
- \anchor StructuredCoincidentDEC-det
- \class StructuredCoincidentDEC
-
- This class aims at \ref interpolation "remapping fields" that have identical
- structured supports (=the same underlying mesh) but different parallel topologies
- (=different sub-domains in the structured mesh). It can be used to couple
- together multi-physics codes that operate on the same domain
- with different partitioning. This can be useful for example if one of
- 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 \ref para-dec "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
- \ref InterpKernelDEC-det "InterpKernelDEC").
- Therefore, beware that this \ref para-dec "DEC" can not be used
- for coincident meshes if they do *not* have the exact same numbering.
-
- With this %DEC no projection, and no interpolation of the field data is done, contrary
- to what happens in \ref InterpKernelDEC-det "InterpKernelDEC". It is just
- a matter of allocating the values from one side to the other, using directly the cell
- identifiers.
-
- As all the other DECs, its usage requires two phases :
- - a setup phase during which the topologies are exchanged so that
- the target side knows from which processors it should expect
- the data.
- - a send/recv phase during which the field data is actually transferred.
-
- This example illustrates the sending of a field with
- the \c StructuredCoincidentDEC :
- \code
- ...
- StructuredCoincidentDEC dec(groupA, groupB);
- dec.attachLocalField(field);
- dec.synchronize();
- if (groupA.containsMyRank())
- dec.recvData();
- else if (groupB.containsMyRank())
- dec.sendData();
- ...
- \endcode
-
- Creating a ParaFIELD to be attached to the %DEC is done in exactly the same way as for
- the other DECs, if only the partitioning of the support mesh differs.
- In the case where the
- fields have also different *component* topologies, creating the ParaFIELD
- requires some more effort. See the \ref para-over "parallelism" section for more details.
- */
-
-
StructuredCoincidentDEC::StructuredCoincidentDEC():_topo_source(0),_topo_target(0),
_send_counts(0),_recv_counts(0),
_send_displs(0),_recv_displs(0),
class DEC;
class BlockTopology;
+ /*!
+ \anchor StructuredCoincidentDEC-det
+ \class StructuredCoincidentDEC
+
+ This class aims at \ref interpolation "remapping fields" that have identical
+ structured supports (=the same underlying mesh) but different parallel topologies
+ (=different sub-domains in the structured mesh). It can be used to couple
+ together multi-physics codes that operate on the same domain
+ with different partitioning. This can be useful for example if one of
+ 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 \ref para-dec "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
+ \ref InterpKernelDEC-det "InterpKernelDEC").
+ Therefore, beware that this \ref para-dec "DEC" can not be used
+ for coincident meshes if they do *not* have the exact same numbering.
+
+ With this %DEC no projection, and no interpolation of the field data is done, contrary
+ to what happens in \ref InterpKernelDEC-det "InterpKernelDEC". It is just
+ a matter of allocating the values from one side to the other, using directly the cell
+ identifiers.
+
+ As all the other DECs, its usage requires two phases :
+ - a setup phase during which the topologies are exchanged so that
+ the target side knows from which processors it should expect
+ the data.
+ - a send/recv phase during which the field data is actually transferred.
+
+ This example illustrates the sending of a field with
+ the \c StructuredCoincidentDEC :
+ \code
+ ...
+ StructuredCoincidentDEC dec(groupA, groupB);
+ dec.attachLocalField(field);
+ dec.synchronize();
+ if (groupA.containsMyRank())
+ dec.recvData();
+ else if (groupB.containsMyRank())
+ dec.sendData();
+ ...
+ \endcode
+
+ Creating a ParaFIELD to be attached to the %DEC is done in exactly the same way as for
+ the other DECs, if only the partitioning of the support mesh differs.
+ In the case where the
+ fields have also different *component* topologies, creating the ParaFIELD
+ requires some more effort. See the \ref para-over "parallelism" section for more details.
+ */
class StructuredCoincidentDEC : public DisjointDEC
{
public: