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;
_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;
}
- /***************************************************************/
- /* 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<map<int,double> > Interpolation2D::interpolateMeshes(const MEDMEM::MESH& myMesh_S,
const MEDMEM::MESH& myMesh_P)
{
#include "BBTree.H"
#include<time.h>
+
+
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;
_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;
}
- /***************************************************************/
- /* 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<map<int,double> > Interpolation3DSurf::interpolateMeshes(const MEDMEM::MESH& myMesh_S,
const MEDMEM::MESH& myMesh_P)
{