From edd1c16186c7b71dc1b9ddae42c75b373967279e Mon Sep 17 00:00:00 2001 From: ndjinga Date: Mon, 26 Nov 2007 15:42:32 +0000 Subject: [PATCH] Added comments for Medmem User Guide using Doxygen --- src/INTERP_KERNEL/Interpolation2D.cxx | 54 ++++++++++++++++---- src/INTERP_KERNEL/Interpolation3D.cxx | 7 ++- src/INTERP_KERNEL/Interpolation3DSurf.cxx | 60 +++++++++++++++++++---- 3 files changed, 102 insertions(+), 19 deletions(-) diff --git a/src/INTERP_KERNEL/Interpolation2D.cxx b/src/INTERP_KERNEL/Interpolation2D.cxx index ee90df2c2..99861350e 100755 --- a/src/INTERP_KERNEL/Interpolation2D.cxx +++ b/src/INTERP_KERNEL/Interpolation2D.cxx @@ -15,7 +15,17 @@ using namespace MED_EN; namespace MEDMEM { - +/** + * \defgroup interpolation2D Interpolation2D + * + * \class Interpolation2D + * \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. + */ + /** + * Constructor + * + */ Interpolation2D::Interpolation2D() { _Precision=1.0E-12; @@ -24,11 +34,19 @@ namespace MEDMEM _Intersection_type= MEDMEM::Triangulation; } - /*_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ */ - /* Options : */ - /* Precision : for geometric computation */ - /* PrintLevel : between 0 and 3 */ - /*_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ */ + /** + * \brief Function used to set the options for the intersection calculation + * \details The following options can be modified: + * -# Intersection_type: the type of algorithm to be used in the computation of the cell-cell intersections. + * - Values: Triangle, Convex. + * - Default: Triangle. + * -# Precision: Level of precision of the computations is precision times the characteristic size of the mesh. + * - Values: positive real number. + * - Default: 1.0E-12. + * -# PrintLevel: Level of verboseness during the computations. + * - Values: interger between 0 and 3. + * - Default: 0. + */ void Interpolation2D::setOptions(double Precision, int PrintLevel, IntersectionType intersection_type) { _Precision=Precision; @@ -37,9 +55,27 @@ namespace MEDMEM } - /***************************************************************/ - /* Main function to interpolate triangular or quadratic meshes */ - /***************************************************************/ + /** \brief Main function to interpolate triangular or quadrangular meshes. + \details The algorithm proceeds in two steps: first a filtering process reduces the number of pairs of elements for which the + * calculation must be carried out by eliminating pairs that do not intersect based on their bounding boxes. Then, the + * volume of intersection is calculated by an object of type Intersector2D for the remaining pairs, and entered into the + * intersection matrix. + * + * The matrix is partially sparse : it is a vector of maps of integer - double pairs. + * The length of the vector is equal to the number of target elements - for each target element there is a map, regardless + * of whether the element intersects any source elements or not. But in the maps there are only entries for those source elements + * which have a non-zero intersection volume with the target element. The vector has indices running from + * 0 to (#target elements - 1), meaning that the map for target element i is stored at index i - 1. In the maps, however, + * 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 myMesh_S 2D source mesh + * @param myMesh_P 2D target mesh + * @return vector containing for each element i of the source mesh, a map giving for each element j + * of the target mesh which i intersects, the area of the intersection + * + */ + vector > Interpolation2D::interpolateMeshes(const MEDMEM::MESH& myMesh_S, const MEDMEM::MESH& myMesh_P) { diff --git a/src/INTERP_KERNEL/Interpolation3D.cxx b/src/INTERP_KERNEL/Interpolation3D.cxx index 00d915435..a26a64786 100644 --- a/src/INTERP_KERNEL/Interpolation3D.cxx +++ b/src/INTERP_KERNEL/Interpolation3D.cxx @@ -27,7 +27,12 @@ using namespace MED_EN; namespace MEDMEM { - + /** + * \defgroup interpolation3D Interpolation3D + * \class Interpolation3D + * \brief Class used to calculate the volumes of intersection between the elements of two 3D meshes. + * + */ /** * Default constructor * diff --git a/src/INTERP_KERNEL/Interpolation3DSurf.cxx b/src/INTERP_KERNEL/Interpolation3DSurf.cxx index c899dd951..8994a8157 100644 --- a/src/INTERP_KERNEL/Interpolation3DSurf.cxx +++ b/src/INTERP_KERNEL/Interpolation3DSurf.cxx @@ -11,11 +11,23 @@ #include "BBTree.H" #include + + using namespace MED_EN; namespace MEDMEM { +/** +\defgroup interpolation3DSurf Interpolation3DSurf + \class Interpolation3DSurf +\brief Class used to compute the coefficients of the interpolation matrix between +two local surfacic meshes in three dimensions. Meshes can contain mixed triangular and quadrangular elements. +*/ + /** + * Constructor + * + */ Interpolation3DSurf::Interpolation3DSurf() { _Intersection_type= MEDMEM::Triangulation; @@ -26,12 +38,25 @@ namespace MEDMEM _Surf3DAdjustmentEps=0.0001; _PrintLevel=0; } - - /*_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ */ - /* Options : */ - /* Precision : for geometric computation */ - /* PrintLevel : between 0 and 3 */ - /*_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ */ + /** + \brief Function used to set the options for the intersection calculation +\details The following options can be modified: + -# Intersection_type: the type of algorithm to be used in the computation of the cell-cell intersections. + - Values: Triangle, Convex. + - Default: Triangle. + -# MedianPlane: Position of the median plane where both cells will be projected + - Values: between 0 and 1. + - Default: 0.5. + -# DoRotate: rotate the coordinate system such that the target cell is in the Oxy plane. + - Values: true (necessarilly if Intersection_type=Triangle), false. + - Default: true (as default Intersection_type=Triangle) + -# Precision: Level of precision of the computations is precision times the characteristic size of the mesh. + - Values: positive real number. + - Default: 1.0E-12. + -# PrintLevel: Level of verboseness during the computations. + - Values: interger between 0 and 3. + - Default: 0. + */ void Interpolation3DSurf::setOptions(double Precision, int PrintLevel, double MedianPlane, IntersectionType intersection_type, bool do_rotate) { _Intersection_type=intersection_type; @@ -42,9 +67,26 @@ namespace MEDMEM } - /***************************************************************/ - /* Main function to interpolate triangular or quadratic meshes */ - /***************************************************************/ + /** \brief Main function to interpolate triangular or quadrangular meshes. + \details The algorithm proceeds in two steps: first a filtering process reduces the number of pairs of elements for which the + * calculation must be carried out by eliminating pairs that do not intersect based on their bounding boxes. Then, the + * volume of intersection is calculated by an object of type Intersector3Dsurf for the remaining pairs, and entered into the + * intersection matrix. + * + * The matrix is partially sparse : it is a vector of maps of integer - double pairs. + * The length of the vector is equal to the number of target elements - for each target element there is a map, regardless + * of whether the element intersects any source elements or not. But in the maps there are only entries for those source elements + * which have a non-zero intersection volume with the target element. The vector has indices running from + * 0 to (#target elements - 1), meaning that the map for target element i is stored at index i - 1. In the maps, however, + * 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 myMesh_S 3D surface source mesh + * @param myMesh_P 3D surface target mesh + * @return vector containing for each element i of the source mesh, a map giving for each element j + * of the target mesh which i intersects, the area of the intersection + * + */ vector > Interpolation3DSurf::interpolateMeshes(const MEDMEM::MESH& myMesh_S, const MEDMEM::MESH& myMesh_P) { -- 2.39.2