\subsubsection cpp_mcfield_remapper_middlelevel Using interpolation tools - Middle level usage
-- The simplest way to use the interpolator with \ref medcoupling "MEDCoupling data struture" is illustrated in the following example.
+- The simplest way to use the interpolator with \ref medcoupling "MEDCoupling data structure" is illustrated in the following example.
\code
...
\ref MEDCoupling "MEDCoupling namespace".
The true parallel functionalities of the \ref library "MED library" are detailed here: \ref parallel
-The memory management of the various structures is eased by the class
+The memory management of the various structures is eased by the class
\ref MEDCoupling::MCAuto "MCAuto". It acts as an auto pointer and takes care of deleting the
memory automatically when going out of scope. See an example usage in \ref cpp_mcfielddouble_WriteVTK .
Beware however that not all functions return a pointer that should be deleted when going out of scope.
// geometric precision, debug print level, choice of the median plane, intersection etc ...
void setOptions(double precision, int printLevel,
IntersectionType intersectionType, int orientation=0);
-
+
// Main function to interpolate triangular and quadratic meshes
template<class MyMeshType, class MatrixType>
int interpolateMeshes(const MyMeshType& meshS, const MyMeshType& meshT, MatrixType& result, const std::string& method);
CPPUNIT_TEST_SUITE_END();
public:
-
+
/// Intersection between two boxes, aligned with the axes.One has 60 hexahedral elements and the other has 39 tetrahedral elements
/// \brief Status : pass
void simpleHexaBox()
}
/// Intersection between two boxes in general position with hexahedral elements. One has 200 elements and the other 420.
- /// \brief Status : fails - reason unknown. The matrix does not fulfil the transpose requirement : that W_AB = W_BA^T
+ /// \brief Status : fails - reason unknown. The matrix does not fulfill the transpose requirement : that W_AB = W_BA^T
void hexaBoxesMoved()
{
_testTools->intersectMeshes("MovedHexaBox1", "MovedHexaBox2", 65250);
}
/*!
- * This method is useful to slice work among a pool of threads or processes. \a begin, \a end \a step is the input whole slice of work to perform,
+ * This method is useful to slice work among a pool of threads or processes. \a begin, \a end \a step is the input whole slice of work to perform,
* typically it is a whole slice of tuples of DataArray or cells, nodes of a mesh...
*
* The input \a sliceId should be an id in [0, \a nbOfSlices) that specifies the slice of work.
* \param [in] nbOfSlices - the number of slices (typically the number of cores on which the work is expected to be sliced)
* \param [out] startSlice - the start of the slice considered
* \param [out] stopSlice - the stop of the slice consided
- *
+ *
* \throw If \a step == 0
* \throw If \a nbOfSlices not > 0
* \throw If \a sliceId not in [0,nbOfSlices)
/*!
* Returns a new instance of DataArrayDouble. The caller is to delete this array
- * using decrRef() as it is no more needed.
+ * using decrRef() as it is no more needed.
*/
DataArrayDouble *DataArrayDouble::New()
{
* Returns a full copy of \a this. For more info on copying data arrays see
* \ref MEDCouplingArrayBasicsCopyDeep.
* \return DataArrayDouble * - a new instance of DataArrayDouble. The caller is to
- * delete this array using decrRef() as it is no more needed.
+ * delete this array using decrRef() as it is no more needed.
*/
DataArrayDouble *DataArrayDouble::deepCopy() const
{
* with at least absolute difference value of |\a eps| at each step.
* If not an exception is thrown.
* \param [in] increasing - if \a true, the array values should be increasing.
- * \param [in] eps - minimal absolute difference between the neighbor values at which
+ * \param [in] eps - minimal absolute difference between the neighbor values at which
* the values are considered different.
* \throw If sequence of values is not strictly monotonic in agreement with \a
* increasing arg.
* Checks that \a this array is consistently **increasing** or **decreasing** in value,
* with at least absolute difference value of |\a eps| at each step.
* \param [in] increasing - if \a true, array values should be increasing.
- * \param [in] eps - minimal absolute difference between the neighbor values at which
+ * \param [in] eps - minimal absolute difference between the neighbor values at which
* the values are considered different.
* \return bool - \a true if values change in accordance with \a increasing arg.
* \throw If \a this->getNumberOfComponents() != 1.
/*!
* Equivalent to DataArrayDouble::isEqual except that if false the reason of
* mismatch is given.
- *
+ *
* \param [in] other the instance to be compared with \a this
* \param [in] prec the precision to compare numeric data of the arrays.
* \param [out] reason In case of inequality returns the reason.
* considered not coincident.
* \param [in] limitTupleId - limit tuple id. If all tuples within a group of coincident
* tuples have id strictly lower than \a limitTupleId then they are not returned.
- * \param [out] comm - the array holding ids (== indices) of coincident tuples.
- * \a comm->getNumberOfComponents() == 1.
+ * \param [out] comm - the array holding ids (== indices) of coincident tuples.
+ * \a comm->getNumberOfComponents() == 1.
* \a comm->getNumberOfTuples() == \a commIndex->back().
* \param [out] commIndex - the array dividing all indices stored in \a comm into
* groups of (indices of) coincident tuples. Its every value is a tuple
{
bounds[idim*2]=std::numeric_limits<double>::max();
bounds[idim*2+1]=-std::numeric_limits<double>::max();
- }
+ }
const double *ptr=getConstPointer();
int nbOfTuples=getNumberOfTuples();
for(int i=0;i<nbOfTuples;i++)
/*!
* This method retrieves a newly allocated DataArrayDouble instance having same number of tuples than \a this and twice number of components than \a this
- * to store both the min and max per component of each tuples.
+ * to store both the min and max per component of each tuples.
* \param [in] epsilon the width of the bbox (identical in each direction) - 0.0 by default
*
* \return a newly created DataArrayDouble instance having \c this->getNumberOfTuples() tuples and 2 * \c this->getNumberOfComponent() components
/*!
* For each tuples **t** in \a other, this method retrieves tuples in \a this that are equal to **t**.
* Two tuples are considered equal if the euclidian distance between the two tuples is lower than \a eps.
- *
+ *
* \param [in] other a DataArrayDouble having same number of components than \a this.
* \param [in] eps absolute precision representing distance (using infinite norm) between 2 tuples behind which 2 tuples are considered equal.
* \param [out] c will contain the set of tuple ids in \a this that are equal to to the tuple ids in \a other contiguously.
/*!
* This method recenter tuples in \b this in order to be centered at the origin to benefit about the advantages of maximal precision to be around the box
* around origin of 'radius' 1.
- *
+ *
* \param [in] eps absolute epsilon. under that value of delta between max and min no scale is performed.
*/
void DataArrayDouble::recenterForMaxPrecision(double eps)
/*!
* Accumulates values of each component of \a this array.
- * \param [out] res - an array of length \a this->getNumberOfComponents(), allocated
+ * \param [out] res - an array of length \a this->getNumberOfComponents(), allocated
* by the caller, that is filled by this method with sum value for each
* component.
* \throw If \a this is not allocated.
for(int i=0;i<nbTuple;i++)
{
double val=0.;
- for(int j=0;j<nbComps;j++,work++)
+ for(int j=0;j<nbComps;j++,work++)
val+=(*work-tupleBg[j])*((*work-tupleBg[j]));
if(val>=ret0)
continue;
* \param [in] bgOfIndex - begin (included) of the input index array.
* \param [in] endOfIndex - end (excluded) of the input index array.
* \return DataArrayDouble * - the new instance having the same number of components than \a this.
- *
+ *
* \throw If bgOfIndex or end is NULL.
* \throw If input index array is not ascendingly sorted.
* \throw If there is an id in [ \a bgOfIndex, \a endOfIndex ) not in [0, \c this->getNumberOfTuples).
/*!
* Converts each 2D point defined by the tuple of \a this array from the Polar to the
- * Cartesian coordinate system. The two components of the tuple of \a this array are
+ * Cartesian coordinate system. The two components of the tuple of \a this array are
* considered to contain (1) radius and (2) angle of the point in the Polar CS.
* \return DataArrayDouble * - the new instance of DataArrayDouble, whose each tuple
* contains X and Y coordinates of the point in the Cartesian CS. The caller
/*!
* Converts each 3D point defined by the tuple of \a this array from the Cylindrical to
- * the Cartesian coordinate system. The three components of the tuple of \a this array
+ * the Cartesian coordinate system. The three components of the tuple of \a this array
* are considered to contain (1) radius, (2) azimuth and (3) altitude of the point in
* the Cylindrical CS.
* \return DataArrayDouble * - the new instance of DataArrayDouble, whose each tuple
* contains X, Y and Z coordinates of the point in the Cartesian CS. The info
* on the third component is copied from \a this array. The caller
- * is to delete this array using decrRef() as it is no more needed.
+ * is to delete this array using decrRef() as it is no more needed.
* \throw If \a this->getNumberOfComponents() != 3.
* \sa fromCartToCyl
*/
/*!
* Converts each 3D point defined by the tuple of \a this array from the Spherical to
- * the Cartesian coordinate system. The three components of the tuple of \a this array
+ * the Cartesian coordinate system. The three components of the tuple of \a this array
* are considered to contain (1) radius, (2) polar angle and (3) azimuthal angle of the
* point in the Cylindrical CS.
* \return DataArrayDouble * - the new instance of DataArrayDouble, whose each tuple
* \return DataArrayDouble * - the new instance of DataArrayDouble, whose each tuple
* is the determinant of matrix of the corresponding tuple of \a this array.
* The caller is to delete this result array using decrRef() as it is no more
- * needed.
+ * needed.
* \throw If \a this->getNumberOfComponents() is not in [4,6,9].
*/
DataArrayDouble *DataArrayDouble::determinant() const
* \a this array, which contains 6 components.
* \return DataArrayDouble * - the new instance of DataArrayDouble containing 3
* components, whose each tuple contains the eigenvalues of the matrix of
- * corresponding tuple of \a this array.
+ * corresponding tuple of \a this array.
* The caller is to delete this result array using decrRef() as it is no more
- * needed.
+ * needed.
* \throw If \a this->getNumberOfComponents() != 6.
*/
DataArrayDouble *DataArrayDouble::eigenValues() const
* corresponds to that of the upper triangular matrix.
* \return DataArrayDouble * - the new instance of DataArrayDouble containing the
* same number of components as \a this one, whose each tuple is the inverse
- * matrix of the matrix of corresponding tuple of \a this array.
+ * matrix of the matrix of corresponding tuple of \a this array.
* The caller is to delete this result array using decrRef() as it is no more
- * needed.
+ * needed.
* \throw If \a this->getNumberOfComponents() is not in [4,6,9].
*/
DataArrayDouble *DataArrayDouble::inverse() const
* Computes the trace of every matrix defined by the tuple of \a this
* array, which contains either 4, 6 or 9 components. The case of 6 components
* corresponds to that of the upper triangular matrix.
- * \return DataArrayDouble * - the new instance of DataArrayDouble containing
+ * \return DataArrayDouble * - the new instance of DataArrayDouble containing
* 1 component, whose each tuple is the trace of
- * the matrix of corresponding tuple of \a this array.
+ * the matrix of corresponding tuple of \a this array.
* The caller is to delete this result array using decrRef() as it is no more
- * needed.
+ * needed.
* \throw If \a this->getNumberOfComponents() is not in [4,6,9].
*/
DataArrayDouble *DataArrayDouble::trace() const
/*!
* Computes the maximal value within every tuple of \a this array and it returns the first component
* id for each tuple that corresponds to the maximal value within the tuple.
- *
+ *
* \param [out] compoIdOfMaxPerTuple - the new new instance of DataArrayInt containing the
* same number of tuples and only one component.
* \return DataArrayDouble * - the new instance of DataArrayDouble containing the
/*!
* This method returns a newly allocated DataArrayDouble instance having one component and \c this->getNumberOfTuples() * \c this->getNumberOfTuples() tuples.
- * \n This returned array contains the euclidian distance for each tuple in \a this.
+ * \n This returned array contains the euclidian distance for each tuple in \a this.
* \n So the returned array can be seen as a dense symmetrical matrix whose diagonal elements are equal to 0.
* \n The returned array has only one component (and **not** \c this->getNumberOfTuples() components to avoid the useless memory consumption due to components info in returned DataArrayDouble)
*
* \warning use this method with care because it can leads to big amount of consumed memory !
- *
+ *
* \return A newly allocated (huge) MEDCoupling::DataArrayDouble instance that the caller should deal with.
*
* \throw If \a this is not allocated.
/*!
* This method returns a newly allocated DataArrayDouble instance having one component and \c this->getNumberOfTuples() * \c other->getNumberOfTuples() tuples.
- * \n This returned array contains the euclidian distance for each tuple in \a other with each tuple in \a this.
+ * \n This returned array contains the euclidian distance for each tuple in \a other with each tuple in \a this.
* \n So the returned array can be seen as a dense rectangular matrix with \c other->getNumberOfTuples() rows and \c this->getNumberOfTuples() columns.
* \n Output rectangular matrix is sorted along rows.
* \n The returned array has only one component (and **not** \c this->getNumberOfTuples() components to avoid the useless memory consumption due to components info in returned DataArrayDouble)
*
* \warning use this method with care because it can leads to big amount of consumed memory !
- *
+ *
* \param [in] other DataArrayDouble instance having same number of components than \a this.
* \return A newly allocated (huge) MEDCoupling::DataArrayDouble instance that the caller should deal with.
*
* Each of this tuples represent a point into 2D space.
* This method tries to find an arc of circle starting from first point (tuple) to 2nd and middle point (tuple) along 3nd and last point (tuple).
* If such arc of circle exists, the corresponding center, radius of circle is returned. And additionnaly the length of arc expressed with an \a ang output variable in ]0,2*pi[.
- *
+ *
* \throw If \a this is not allocated.
* \throw If \a this has not 3 tuples of 2 components
* \throw If tuples/points in \a this are aligned
/*!
* Modify all elements of \a this array, so that
* an element _x_ becomes \f$ numerator / x \f$.
- * \warning If an exception is thrown because of presence of 0.0 element in \a this
+ * \warning If an exception is thrown because of presence of 0.0 element in \a this
* array, all elements processed before detection of the zero element remain
* modified.
* \param [in] numerator - the numerator used to modify array elements.
* all values in \a this have to be >= 0 if val is \b not integer.
* \param [in] val - the value used to apply pow on all array elements.
* \throw If \a this is not allocated.
- * \warning If an exception is thrown because of presence of 0 element in \a this
+ * \warning If an exception is thrown because of presence of 0 element in \a this
* array and \a val is \b not integer, all elements processed before detection of the zero element remain
* modified.
*/
* \param [in] val - the value used to apply pow on all array elements.
* \throw If \a this is not allocated.
* \throw If \a val < 0.
- * \warning If an exception is thrown because of presence of 0 element in \a this
+ * \warning If an exception is thrown because of presence of 0 element in \a this
* array, all elements processed before detection of the zero element remain
* modified.
*/
* FunctionToEvaluate to every tuple of \a this array. Textual data is not copied.
* For more info see \ref MEDCouplingArrayApplyFunc
* \param [in] nbOfComp - number of components in the result array.
- * \param [in] func - the \a FunctionToEvaluate declared as
- * \c bool (*\a func)(\c const \c double *\a pos, \c double *\a res),
+ * \param [in] func - the \a FunctionToEvaluate declared as
+ * \c bool (*\a func)(\c const \c double *\a pos, \c double *\a res),
* where \a pos points to the first component of a tuple of \a this array
* and \a res points to the first component of a tuple of the result array.
* Note that length (number of components) of \a pos can differ from
/*!
* Returns a new instance of DataArrayInt. The caller is to delete this array
- * using decrRef() as it is no more needed.
+ * using decrRef() as it is no more needed.
*/
DataArrayInt *DataArrayInt::New()
{
* Returns a textual and human readable representation of \a this instance of
* DataArrayInt. This text is shown when a DataArrayInt is printed in Python.
* \return std::string - text describing \a this DataArrayInt.
- *
+ *
* \sa reprNotTooLong, reprZip
*/
std::string DataArrayInt::repr() const
* \param [in] arrEnd - specifies the end of the array \a arrBg, so that
* the last value of \a arrBg is \a arrEnd[ -1 ].
* \param [out] castArr - a new instance of DataArrayInt, of same size as \a this array
- * (same number of tuples and components), the caller is to delete
+ * (same number of tuples and components), the caller is to delete
* using decrRef() as it is no more needed.
* This array contains indices of ranges for every value of \a this array. I.e.
* the i-th value of \a castArr gives the index of range the i-th value of \a this
* This array contains ranks of values of \a this array within ranges
* they belongs to. I.e. the i-th value of \a rankInsideCast gives the rank of
* the i-th value of \a this array within the \a castArr[ i ]-th range, to which
- * the i-th value of \a this belongs to. Or, in other words, this param contains
+ * the i-th value of \a this belongs to. Or, in other words, this param contains
* for each tuple its rank inside its cast. The rank is computed as difference
* between the value and the lowest value of range.
* \param [out] castsPresent - a new instance of DataArrayInt, containing indices of
* The caller is to delete this array using decrRef() as it is no more needed.
*
* \b Example: If \a this contains [6,5,0,3,2,7,8,1,4] and \a arrBg contains [0,4,9] then
- * the output of this method will be :
+ * the output of this method will be :
* - \a castArr : [1,1,0,0,0,1,1,0,1]
* - \a rankInsideCast: [2,1,0,3,2,3,4,1,0]
* - \a castsPresent : [0,1]
if(nbTuples==0)
{ strt=0; sttoopp=0; stteepp=1; return true; }
const int *pt(begin());
- strt=*pt;
+ strt=*pt;
if(nbTuples==1)
{ sttoopp=strt+1; stteepp=1; return true; }
strt=*pt; sttoopp=pt[nbTuples-1];
* \param [in] indArrEnd - specifies the end of the array \a indArrBg, so that
* the last value of \a indArrBg is \a indArrEnd[ -1 ].
* \throw If \a this->getNumberOfComponents() != 1
- * \throw If any value of \a this can't be used as a valid index for
+ * \throw If any value of \a this can't be used as a valid index for
* [\a indArrBg, \a indArrEnd).
*
* \sa changeValue, findIdForEach
}
/*!
- * Creates a one-dimensional DataArrayInt (\a res) whose contents are computed from
+ * Creates a one-dimensional DataArrayInt (\a res) whose contents are computed from
* values of \a this (\a a) and the given (\a indArr) arrays as follows:
* \a res[ \a indArr[ \a a[ i ]]] = i. I.e. for each value in place i \a v = \a a[ i ],
* new value in place \a indArr[ \a v ] is i.
/*!
* Creates a one-dimensional DataArrayInt of given length, whose contents are computed
- * from values of \a this array, which is supposed to contain a renumbering map in
+ * from values of \a this array, which is supposed to contain a renumbering map in
* "Old to New" mode. The result array contains a renumbering map in "New to Old" mode.
* To know how to use the renumbering maps see \ref numbering.
* \param [in] newNbOfElem - 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.
- *
+ *
* \if ENABLE_EXAMPLES
* \ref cpp_mcdataarrayint_invertarrayo2n2n2o "Here is a C++ example".<br>
* \ref py_mcdataarrayint_invertarrayo2n2n2o "Here is a Python example".
}
/*!
- * This method is similar to DataArrayInt::invertArrayO2N2N2O except that
+ * This method is similar to DataArrayInt::invertArrayO2N2N2O except that
* Example : If \a this contains [0,1,2,0,3,4,5,4,6,4] this method will return [0,1,2,4,5,6,8] whereas DataArrayInt::invertArrayO2N2N2O returns [3,1,2,4,9,6,8]
*/
DataArrayInt *DataArrayInt::invertArrayO2N2N2OBis(int newNbOfElem) const
/*!
* Creates a one-dimensional DataArrayInt of given length, whose contents are computed
- * from values of \a this array, which is supposed to contain a renumbering map in
+ * 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 DataArrayInt * - the new instance of DataArrayInt.
* The caller is to delete this result array using decrRef() as it is no more
* needed.
- *
+ *
* \if ENABLE_EXAMPLES
* \ref cpp_mcdataarrayint_invertarrayn2o2o2n "Here is a C++ example".
*
/*!
* Creates a map, whose contents are computed
- * from values of \a this array, which is supposed to contain a renumbering map in
+ * 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
* \ref cpp_mcdataarrayint_invertarrayn2o2o2n "Here is a C++ example".
*
* \return DataArrayInt * - a new instance of DataArrayInt. The caller is to delete this
* array using decrRef() as it is no more needed.
* \throw If either ids1 or ids2 is null not allocated or not with one components.
- *
+ *
* \sa DataArrayInt32::findIdForEach
*/
DataArrayInt *DataArrayInt::FindPermutationFromFirstToSecond(const DataArrayInt *ids1, const DataArrayInt *ids2)
/*!
* Returns two arrays describing a surjective mapping from \a this set of values (\a A)
- * onto a set of values of size \a targetNb (\a B). The surjective function is
+ * onto a set of values of size \a targetNb (\a B). The surjective function is
* \a B[ \a A[ i ]] = i. That is to say that for each \a id in [0,\a targetNb), where \a
* targetNb < \a this->getNumberOfTuples(), there exists at least one tupleId (\a tid) so
* that <em> this->getIJ( tid, 0 ) == id</em>. <br>
* the element of \a B 0 encounters within \a A once (\a arrI[ 0+1 ] - \a arrI[ 0 ]) and
* its index within \a A is 0 ( \a arr[ 0:1 ] == \a arr[ \a arrI[ 0 ] : \a arrI[ 0+1 ]]);<br>
* the element of \a B 2 encounters within \a A 4 times (\a arrI[ 2+1 ] - \a arrI[ 2 ]) and
- * its indices within \a A are [2,4,5,7] ( \a arr[ 2:6 ] == \a arr[ \a arrI[ 2 ] :
+ * its indices within \a A are [2,4,5,7] ( \a arr[ 2:6 ] == \a arr[ \a arrI[ 2 ] :
* \a arrI[ 2+1 ]]); <br> etc.
* \param [in] targetNb - the size of the set \a B. \a targetNb must be equal or more
* than the maximal value of \a A.
* for example). The result array minimizes the permutation. <br>
* For more info on renumbering see \ref numbering. <br>
* \b Example: <br>
- * - \a nbOfOldTuples: 10
+ * - \a nbOfOldTuples: 10
* - \a arr : [0,3, 5,7,9]
* - \a arrIBg : [0,2,5]
* - \a newNbOfTuples: 7
* \b Example: <br>
* - \a this: [2,0,1,1,0,1,2,0,1,1,0,0]
* - result: [10,0,5,6,1,7,11,2,8,9,3,4]
- * - after applying result to \a this: [0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2]
+ * - after applying result to \a this: [0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2]
*
* \return DataArrayInt * - a new instance of DataArrayInt. The caller is to delete this
* array using decrRef() as it is no more needed.
/*!
* Creates a new DataArrayInt containing IDs (indices) of tuples holding value \b not
- * equal to a given one.
+ * equal to a given one.
* \param [in] val - the value to ignore within \a this.
* \return DataArrayInt * - a new instance of DataArrayInt. The caller is to delete this
* array using decrRef() as it is no more needed.
* any number of components excepted 0 (an INTERP_KERNEL::Exception is thrown in this case).
* This method searches in \b this is there is a tuple that matched the input parameter \b tupl.
* If any the tuple id is returned. If not -1 is returned.
- *
+ *
* This method throws an INTERP_KERNEL::Exception if the number of components in \b this mismatches with the size of
* the input vector. An INTERP_KERNEL::Exception is thrown too if \b this is not allocated.
*
/*!
* Accumulates values of each component of \a this array.
- * \param [out] res - an array of length \a this->getNumberOfComponents(), allocated
+ * \param [out] res - an array of length \a this->getNumberOfComponents(), allocated
* by the caller, that is filled by this method with sum value for each
* component.
* \throw If \a this is not allocated.
* \param [in] bgOfIndex - begin (included) of the input index array.
* \param [in] endOfIndex - end (excluded) of the input index array.
* \return DataArrayInt * - the new instance having the same number of components than \a this.
- *
+ *
* \throw If bgOfIndex or end is NULL.
* \throw If input index array is not ascendingly sorted.
* \throw If there is an id in [ \a bgOfIndex, \a endOfIndex ) not in [0, \c this->getNumberOfTuples).
* A packed index array is an allocated array with one component, and at least one tuple. The first element
* of each array in \a arrs must be 0. Each array in \a arrs is expected to be increasingly monotonic.
* This method is useful for users that want to aggregate a pair of DataArrayInt representing an indexed data (typically nodal connectivity index in unstructured meshes.
- *
+ *
* \return DataArrayInt * - a new object to be managed by the caller.
*/
DataArrayInt *DataArrayInt::AggregateIndexes(const std::vector<const DataArrayInt *>& arrs)
/*!
* Modify all elements of \a this array, so that
* an element _x_ becomes \f$ numerator / x \f$.
- * \warning If an exception is thrown because of presence of 0 element in \a this
+ * \warning If an exception is thrown because of presence of 0 element in \a this
* array, all elements processed before detection of the zero element remain
* modified.
* \param [in] numerator - the numerator used to modify array elements.
* This method works only on data array with one component.
* This method returns a newly allocated array storing stored ascendantly tuple ids in \b this so that
* this[*id] in [\b vmin,\b vmax)
- *
+ *
* \param [in] vmin begin of range. This value is included in range (included).
* \param [in] vmax end of range. This value is \b not included in range (excluded).
* \return a newly allocated data array that the caller should deal with.
* This method works only on data array with one component.
* This method returns a newly allocated array storing stored ascendantly tuple ids in \b this so that
* this[*id] \b not in [\b vmin,\b vmax)
- *
+ *
* \param [in] vmin begin of range. This value is \b not included in range (excluded).
* \param [in] vmax end of range. This value is included in range (included).
* \return a newly allocated data array that the caller should deal with.
- *
+ *
* \sa DataArrayInt::findIdsInRange , DataArrayInt::findIdsStricltyNegative
*/
DataArrayInt *DataArrayInt::findIdsNotInRange(int vmin, int vmax) const
/*!
* This method works only on data array with one component.
* This method checks that all ids in \b this are in [ \b vmin, \b vmax ). If there is at least one element in \a this not in [ \b vmin, \b vmax ) an exception will be thrown.
- *
+ *
* \param [in] vmin begin of range. This value is included in range (included).
* \param [in] vmax end of range. This value is \b not included in range (excluded).
* \return if all ids in \a this are so that (*this)[i]==i for all i in [ 0, \c this->getNumberOfTuples() ). */
/*!
* Modify all elements of \a this array, so that
* an element _x_ becomes <em> val % x </em>.
- * \warning If an exception is thrown because of presence of an element <= 0 in \a this
+ * \warning If an exception is thrown because of presence of an element <= 0 in \a this
* array, all elements processed before detection of the zero element remain
* modified.
* \param [in] val - the divident used to modify array elements.
* \param [in] val - the value used to apply pow on all array elements.
* \throw If \a this is not allocated.
* \throw If there is an element < 0 in \a this array.
- * \warning If an exception is thrown because of presence of 0 element in \a this
+ * \warning If an exception is thrown because of presence of 0 element in \a this
* array, all elements processed before detection of the zero element remain
* modified.
*/
}
/*!
- * This method allows to put a vector of vector of integer into a more compact data structure (skyline).
+ * This method allows to put a vector of vector of integer into a more compact data structure (skyline).
* This method is not available into python because no available optimized data structure available to map std::vector< std::vector<int> >.
*
* \param [in] v the input data structure to be translate into skyline format.
/*!
* \a this is expected to have one component and to be sorted ascendingly (as for \a other).
* \a other is expected to be a part of \a this. If not DataArrayInt::buildSubstraction should be called instead.
- *
+ *
* \param [in] other an array with one component and expected to be sorted ascendingly.
* \ret list of ids in \a this but not in \a other.
* \sa DataArrayInt::buildSubstraction
* This method can be applied on allocated with one component DataArrayInt instance.
* This method is typically relevant for sorted arrays. All consecutive duplicated items in \a this will appear only once in returned DataArrayInt instance.
* Example : if \a this contains [1,2,2,3,3,3,3,4,5,5,7,7,7,19] the returned array will contain [1,2,3,4,5,7,19]
- *
+ *
* \return a newly allocated array that contain the result of the unique operation applied on \a this.
* \throw if \a this is not allocated or if \a this has not exactly one component.
* \sa DataArrayInt::buildUniqueNotSorted
/*!
* Returns a new DataArrayInt which contains size of every of groups described by \a this
- * "index" array. Such "index" array is returned for example by
+ * "index" array. Such "index" array is returned for example by
* \ref MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity
* "MEDCouplingUMesh::buildDescendingConnectivity" and
* \ref MEDCoupling::MEDCouplingUMesh::getNodalConnectivityIndex
* This method performs the reverse operation of DataArrayInt::computeOffsetsFull.
* \return DataArrayInt * - a new instance of DataArrayInt, whose number of tuples
* equals to \a this->getNumberOfComponents() - 1, and number of components is 1.
- * The caller is to delete this array using decrRef() as it is no more needed.
+ * The caller is to delete this array using decrRef() as it is no more needed.
* \throw If \a this is not allocated.
* \throw If \a this->getNumberOfComponents() != 1.
* \throw If \a this->getNumberOfTuples() < 2.
*
- * \b Example: <br>
+ * \b Example: <br>
* - this contains [1,3,6,7,7,9,15]
* - result array contains [2,3,1,0,2,6],
* where 2 = 3 - 1, 3 = 6 - 3, 1 = 7 - 6 etc.
* - \a offsets: [0,3,6,10,14,20]
* - result array: [0,1,2,6,7,8,9,10,11,12,13] == <br>
* \c range(0,3) + \c range(6,10) + \c range(10,14) ==<br>
- * \c range( \a offsets[ \a this[0] ], offsets[ \a this[0]+1 ]) +
- * \c range( \a offsets[ \a this[1] ], offsets[ \a this[1]+1 ]) +
+ * \c range( \a offsets[ \a this[0] ], offsets[ \a this[0]+1 ]) +
+ * \c range( \a offsets[ \a this[1] ], offsets[ \a this[1]+1 ]) +
* \c range( \a offsets[ \a this[2] ], offsets[ \a this[2]+1 ])
*/
DataArrayInt *DataArrayInt::buildExplicitArrByRanges(const DataArrayInt *offsets) const
}
/*!
- * Returns a new DataArrayInt whose contents is computed using \a this that must be a
+ * Returns a new DataArrayInt whose contents is computed using \a this that must be a
* scaled array (monotonically increasing).
from that of \a this and \a
* offsets arrays as follows. \a offsets is a one-dimensional array considered as an
{
std::ostringstream oss; oss << "DataArrayInt::buildExplicitArrOfSliceOnScaledArr : At pos #" << i << " of input slice, value is " << pos << " and at this pos this is not monotonically increasing !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
- }
+ }
}
else
{
- std::ostringstream oss; oss << "DataArrayInt::buildExplicitArrOfSliceOnScaledArr : At pos #" << i << " of input slice, value is " << pos << " should be in [0," << nbOfTuples-1 << ") !";
+ std::ostringstream oss; oss << "DataArrayInt::buildExplicitArrOfSliceOnScaledArr : At pos #" << i << " of input slice, value is " << pos << " should be in [0," << nbOfTuples-1 << ") !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
}
*
* For example if \a this contains : [1,24,7,8,10,17] and \a ranges contains [(0,3),(3,8),(8,15),(15,22),(22,30)]
* The return DataArrayInt will contain : **[0,4,1,2,2,3]**
- *
+ *
* \param [in] ranges typically come from output of MEDCouplingUMesh::ComputeRangesFromTypeDistribution. Each range is specified like this : 1st component is
* for lower value included and 2nd component is the upper value of corresponding range **excluded**.
* \throw If offsets is a null pointer or does not have 2 components or if \a this is not allocated or \a this do not have exactly one component. To finish an exception
* is thrown if no ranges in \a ranges contains value in \a this.
- *
+ *
* \sa DataArrayInt::findIdInRangeForEachTuple
*/
DataArrayInt *DataArrayInt::findRangeIdForEachTuple(const DataArrayInt *ranges) const
* For example if \a this contains : [1,24,7,8,10,17] and \a ranges contains [(0,3),(3,8),(8,15),(15,22),(22,30)]
* The return DataArrayInt will contain : **[1,2,4,0,2,2]**
* This method is often called in pair with DataArrayInt::findRangeIdForEachTuple method.
- *
+ *
* \param [in] ranges typically come from output of MEDCouplingUMesh::ComputeRangesFromTypeDistribution. Each range is specified like this : 1st component is
* for lower value included and 2nd component is the upper value of corresponding range **excluded**.
* \throw If offsets is a null pointer or does not have 2 components or if \a this is not allocated or \a this do not have exactly one component. To finish an exception
* If this method has correctly worked, \a this will be able to be considered as a linked list.
* This method does nothing if number of tuples is lower of equal to 1.
*
- * This method is useful for users having an unstructured mesh having only SEG2 to rearrange internally the connectibity without any coordinates consideration.
+ * This method is useful for users having an unstructured mesh having only SEG2 to rearrange internally the connectivity without any coordinates consideration.
*
* \sa MEDCouplingUMesh::orderConsecutiveCells1D, DataArrayInt::fromLinkedListOfPairToList
*/
/*!
* \a this is expected to be a correctly linked list of pairs.
- *
+ *
* \sa DataArrayInt::sortEachPairToMakeALinkedList
*/
MCAuto<DataArrayInt> DataArrayInt::fromLinkedListOfPairToList() const
*
* \param [in] nbOfSlices - number of slices expected.
* \return - a vector having a size equal to \a nbOfSlices giving the start (included) and the stop (excluded) of each chunks.
- *
+ *
* \sa DataArray::GetSlice
* \throw If \a this is not allocated or not with exactly one component.
* \throw If an element in \a this if < 0.
/*!
* This method tries to minimize at most the number of deep copy.
* So if \a idsPerType is not empty it can be returned directly (without copy, but with ref count incremented) in return.
- *
+ *
* See MEDCouplingUMesh::checkTypeConsistencyAndContig for more information
*/
DataArrayInt *MEDCouplingStructuredMesh::checkTypeConsistencyAndContig(const std::vector<int>& code, const std::vector<const DataArrayInt *>& idsPerType) const
* This method is the opposite of MEDCouplingUMesh::checkTypeConsistencyAndContig method. Given a list of cells in \a profile it returns a list of sub-profiles sorted by geo type.
* 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 [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]
* \param [out] idsPerType is a vector of size of different sub profiles needed to be defined to represent the profile \a profile for a given geometric type.
* This vector can be empty in case of all geometric type cells are fully covered in ascending in the given input \a profile.
- *
+ *
* \warning for performance reasons no deep copy will be performed, if \a profile can been used as this in output parameters \a idsInPflPerType and \a idsPerType.
*
* \throw if \a profile has not exactly one component. It throws too, if \a profile contains some values not in [0,getNumberOfCells()) or if \a this is not fully defined
* \b Example1: <br>
* - Before \a this has 3 cells \a profile contains [0,1,2]
* - After \a code contains [NORM_...,nbCells,-1], \a idsInPflPerType [[0,1,2]] and \a idsPerType is empty <br>
- *
+ *
* \b Example2: <br>
* - Before \a this has 3 cells \a profile contains [1,2]
* - After \a code contains [NORM_...,nbCells,0], \a idsInPflPerType [[0,1]] and \a idsPerType is [[1,2]] <br>
* and the cells are ordered with the same logic, i.e. in (i,j) notation: (0,0), (1,0), (2,0), ... (0,1), (1,1), ...
*
* \return MEDCouplingUMesh * - a new instance of MEDCouplingUMesh. The caller is to
- * delete this array using decrRef() as it is no more needed.
+ * delete this array using decrRef() as it is no more needed.
* \throw If \a this->getMeshDimension() is not among [1,2,3].
*/
MEDCoupling1SGTUMesh *MEDCouplingStructuredMesh::build1SGTUnstructured() const
/*!
* This method returns the unstructured mesh (having single geometric type) of the sub level mesh of \a this.
* This method is equivalent to computing MEDCouplingUMesh::buildDescendingConnectivity on the unstructurized \a this mesh.
- *
- * The caller is to delete the returned mesh using decrRef() as it is no more needed.
+ *
+ * The caller is to delete the returned mesh using decrRef() as it is no more needed.
*/
MEDCoupling1SGTUMesh *MEDCouplingStructuredMesh::build1SGTSubLevelMesh() const
{
* and the cells are ordered with the same logic, i.e. in (i,j) notation: (0,0), (1,0), (2,0), ... (0,1), (1,1), ...
*
* \return MEDCouplingUMesh * - a new instance of MEDCouplingUMesh. The caller is to
- * delete this array using decrRef() as it is no more needed.
+ * delete this array using decrRef() as it is no more needed.
* \throw If \a this->getMeshDimension() is not among [1,2,3].
*/
MEDCouplingUMesh *MEDCouplingStructuredMesh::buildUnstructured() const
* \param [in] end - specifies the end of the array \a start, so that
* the last value of \a start is \a end[ -1 ].
* \return MEDCouplingMesh * - a new instance of MEDCouplingUMesh. The caller is to
- * delete this mesh using decrRef() as it is no more needed.
+ * delete this mesh using decrRef() as it is no more needed.
*/
MEDCouplingMesh *MEDCouplingStructuredMesh::buildPart(const int *start, const int *end) const
{
/*!
* 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
* \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
* \return - A vector of size this->getSpaceDimension()
* \throw if \a cellId not in [ 0, this->getNumberOfNodes() )
* Returns a new MEDCouplingUMesh which is a full copy of \a this one. No data is shared
* between \a this and the new mesh.
* \return MEDCouplingUMesh * - a new instance of MEDCouplingMesh. The caller is to
- * delete this mesh using decrRef() as it is no more needed.
+ * delete this mesh using decrRef() as it is no more needed.
*/
MEDCouplingUMesh *MEDCouplingUMesh::deepCopy() const
{
* \param [in] recDeepCpy - if \a true, the copy is deep, else all data arrays of \a
* this mesh are shared by the new mesh.
* \return MEDCouplingUMesh * - a new instance of MEDCouplingMesh. The caller is to
- * delete this mesh using decrRef() as it is no more needed.
+ * delete this mesh using decrRef() as it is no more needed.
*/
MEDCouplingUMesh *MEDCouplingUMesh::clone(bool recDeepCpy) const
{
/*!
* This method behaves mostly like MEDCouplingUMesh::deepCopy method, except that only nodal connectivity arrays are deeply copied.
* The coordinates are shared between \a this and the returned instance.
- *
+ *
* \return MEDCouplingUMesh * - A new object instance holding the copy of \a this (deep for connectivity, shallow for coordiantes)
* \sa MEDCouplingUMesh::deepCopy
*/
}
/*!
- * Allocates memory to store an estimation of the given number of cells.
+ * Allocates memory to store an estimation of the given number of cells.
* The closer the estimation to the number of cells effectively inserted, the less need the library requires
* to reallocate memory. If the number of cells to be inserted is not known simply assign 0 to this parameter.
* If a nodal connectivity previously existed before the call of this method, it will be reset.
* \param [in] type - type of cell to add.
* \param [in] size - number of nodes constituting this cell.
* \param [in] nodalConnOfCell - the connectivity of the cell to add.
- *
+ *
* \if ENABLE_EXAMPLES
* \ref medcouplingcppexamplesUmeshStdBuild1 "Here is a C++ example".<br>
* \ref medcouplingpyexamplesUmeshStdBuild1 "Here is a Python example".
/*!
* Compacts data arrays to release unused memory. This method is to be called after
* finishing cell insertion using \a this->insertNextCell().
- *
+ *
* \if ENABLE_EXAMPLES
* \ref medcouplingcppexamplesUmeshStdBuild1 "Here is a C++ example".<br>
* \ref medcouplingpyexamplesUmeshStdBuild1 "Here is a Python example".
* having the same geometric type. So a same geometric type can appear more than once if the cells are not sorted per geometric type.
*
* \throw if connectivity in \a this is not correctly defined.
- *
+ *
* \sa MEDCouplingMesh::getAllGeoTypes
*/
std::vector<INTERP_KERNEL::NormalizedCellType> MEDCouplingUMesh::getAllGeoTypesSorted() const
MEDCouplingPointSet::checkFastEquivalWith(other,prec);
const MEDCouplingUMesh *otherC=dynamic_cast<const MEDCouplingUMesh *>(other);
if(!otherC)
- throw INTERP_KERNEL::Exception("MEDCouplingUMesh::checkFastEquivalWith : Two meshes are not not unstructured !");
+ throw INTERP_KERNEL::Exception("MEDCouplingUMesh::checkFastEquivalWith : Two meshes are not not unstructured !");
}
/*!
* \param [in,out] revNodalIndx - an array, of length \a this->getNumberOfNodes() + 1,
* dividing cell ids in \a revNodal into groups each referring to one
* node. Its every element (except the last one) is an index pointing to the
- * first id of a group of cells. For example cells sharing the node #1 are
- * described by following range of indices:
+ * first id of a group of cells. For example cells sharing the node #1 are
+ * described by following range of indices:
* [ \a revNodalIndx[1], \a revNodalIndx[2] ) and the cell ids are
* \a revNodal[ \a revNodalIndx[1] ], \a revNodal[ \a revNodalIndx[1] + 1], ...
* Number of cells sharing the *i*-th node is
* \a revNodalIndx[ *i*+1 ] - \a revNodalIndx[ *i* ].
* \throw If the coordinates array is not set.
* \throw If the nodal connectivity of cells is not defined.
- *
+ *
* \if ENABLE_EXAMPLES
* \ref cpp_mcumesh_getReverseNodalConnectivity "Here is a C++ example".<br>
* \ref py_mcumesh_getReverseNodalConnectivity "Here is a Python example".
* returned. The arrays \a desc and \a descIndx (\ref numbering-indirect) describe the descending connectivity,
* i.e. enumerate cells of the result mesh bounding each cell of \a this mesh. The
* arrays \a revDesc and \a revDescIndx (\ref numbering-indirect) describe the reverse descending connectivity,
- * i.e. enumerate cells of \a this mesh bounded by each cell of the result mesh.
+ * i.e. enumerate cells of \a this mesh bounded by each cell of the result mesh.
* \warning For speed reasons, this method does not check if node ids in the nodal
* connectivity correspond to the size of node coordinates array.
* \warning Cells of the result mesh are \b not sorted by geometric type, hence,
* \throw If the nodal connectivity of cells is node defined.
* \throw If \a desc == NULL || \a descIndx == NULL || \a revDesc == NULL || \a
* revDescIndx == NULL.
- *
+ *
* \if ENABLE_EXAMPLES
* \ref cpp_mcumesh_buildDescendingConnectivity "Here is a C++ example".<br>
* \ref py_mcumesh_buildDescendingConnectivity "Here is a Python example".
* cell with id #0 can't be negative, the array \a desc returns ids in FORTRAN mode,
* i.e. cell ids are one-based.
* Arrays \a revDesc and \a revDescIndx (\ref numbering-indirect) describe the reverse descending connectivity,
- * i.e. enumerate cells of \a this mesh bounded by each cell of the result mesh.
+ * i.e. enumerate cells of \a this mesh bounded by each cell of the result mesh.
* \warning For speed reasons, this method does not check if node ids in the nodal
* connectivity correspond to the size of node coordinates array.
* \warning Cells of the result mesh are \b not sorted by geometric type, hence,
* \throw If the nodal connectivity of cells is node defined.
* \throw If \a desc == NULL || \a descIndx == NULL || \a revDesc == NULL || \a
* revDescIndx == NULL.
- *
+ *
* \if ENABLE_EXAMPLES
* \ref cpp_mcumesh_buildDescendingConnectivity2 "Here is a C++ example".<br>
* \ref py_mcumesh_buildDescendingConnectivity2 "Here is a Python example".
* The number of tuples is equal to the last values in \b neighborsIndx.
* \param [out] neighborsIdx is an array of size this->getNumberOfCells()+1 newly allocated and should
* be dealt by the caller. This arrays allow to use the first output parameter \b neighbors.
- *
+ *
* \sa MEDCouplingUMesh::computeEnlargedNeighborsOfNodes
*/
void MEDCouplingUMesh::computeNeighborsOfNodes(DataArrayInt *&neighbors, DataArrayInt *&neighborsIdx) const
* Computes enlarged neighbors for each nodes in \a this. The behavior of this method is close to MEDCouplingUMesh::computeNeighborsOfNodes except that the neighborhood of each node is wider here.
* A node j is considered to be in the neighborhood of i if and only if there is a cell in \a this containing in its nodal connectivity both i and j.
* This method is useful to find ghost cells of a part of a mesh with a code based on fields on nodes.
- *
+ *
* \sa MEDCouplingUMesh::computeNeighborsOfNodes
*/
void MEDCouplingUMesh::computeEnlargedNeighborsOfNodes(MCAuto<DataArrayInt> &neighbors, MCAuto<DataArrayInt>& neighborsIdx) const
/*!
* This method expects that spaceDimension is equal to 3 and meshDimension equal to 3.
* This method performs operation only on polyhedrons in \b this. If no polyhedrons exists in \b this, \b this remains unchanged.
- * This method allows to merge if any coplanar 3DSurf cells that may appear in some polyhedrons cells.
+ * This method allows to merge if any coplanar 3DSurf cells that may appear in some polyhedrons cells.
*
- * \param [in] eps is a relative precision that allows to establish if some 3D plane are coplanar or not. This epsilon is used to recenter around origin to have maximal
+ * \param [in] eps is a relative precision that allows to establish if some 3D plane are coplanar or not. This epsilon is used to recenter around origin to have maximal
* precision.
*/
void MEDCouplingUMesh::simplifyPolyhedra(double eps)
* This method returns all node ids used in the connectivity of \b this. The data array returned has to be dealt by the caller.
* The returned node ids are sorted ascendingly. This method is close to MEDCouplingUMesh::getNodeIdsInUse except
* the format of the returned DataArrayInt instance.
- *
+ *
* \return a newly allocated DataArrayInt sorted ascendingly of fetched node ids.
* \sa MEDCouplingUMesh::getNodeIdsInUse, areAllNodesFetched
*/
/*!
* 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.
+ * a mapping in "Old to New" mode.
* \param [out] nbrOfNodesInUse - number of node ids present in the nodal connectivity.
* \return DataArrayInt * - a new instance of DataArrayInt. 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
- * array using decrRef() as it is no more needed.
+ * array using decrRef() as it is no more needed.
* \throw If the coordinates array is not set.
* \throw If the nodal connectivity of cells is not defined.
* \throw If the nodal connectivity includes an invalid id.
* For each cell in \b this the number of nodes constituting cell is computed.
* For each polyhedron cell, the sum of the number of nodes of each face constituting polyhedron cell is returned.
* So for pohyhedrons some nodes can be counted several times in the returned result.
- *
+ *
* \return a newly allocated array
* \sa MEDCouplingUMesh::computeEffectiveNbOfNodesPerCell
*/
/*!
* This method returns a newly allocated array containing this->getNumberOfCells() tuples and 1 component.
* For each cell in \b this the number of faces constituting (entity of dimension this->getMeshDimension()-1) cell is computed.
- *
+ *
* \return a newly allocated array
*/
DataArrayInt *MEDCouplingUMesh::computeNbOfFacesPerCell() const
/*!
* Removes unused nodes (the node coordinates array is shorten) and returns an array
* mapping between new and old node ids in "Old to New" mode. -1 values in the returned
- * array mean that the corresponding old node is no more used.
+ * array mean that the corresponding old node is no more used.
* \return DataArrayInt * - a new instance of DataArrayInt of length \a
* this->getNumberOfNodes() before call of this method. The caller is to
- * delete this array using decrRef() as it is no more needed.
+ * delete this array using decrRef() as it is no more needed.
* \throw If the coordinates array is not set.
* \throw If the nodal connectivity of cells is not defined.
* \throw If the nodal connectivity includes an invalid id.
* \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, int startCellId, DataArrayInt *& commonCellsArr, DataArrayInt *& commonCellsIArr) const
{
* than \a this->getNumberOfCells() in the returned array means that there is no
* corresponding cell in \a this mesh.
* It is expected that \a this and \a other meshes share the same node coordinates
- * array, if it is not so an exception is thrown.
+ * array, if it is not so an exception is thrown.
* \param [in] other - the mesh to compare with.
* \param [in] compType - specifies a cell comparison technique. For meaning of its
* valid values [0,1,2], see zipConnectivityTraducer().
* Build a sub part of \b this lying or not on the same coordinates than \b this (regarding value of \b keepCoords).
* 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 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
- *
+ *
* \warning This method modifies can generate an unstructured mesh whose cells are not sorted by geometric type order.
* In view of the MED file writing, a renumbering of cells of returned unstructured mesh (using MEDCouplingUMesh::sortCellsInMEDFileFrmt) should be necessary.
*/
* array of \a this mesh, else "free" nodes are removed from the result mesh
* by calling zipCoords().
* \return MEDCouplingUMesh * - a new instance of MEDCouplingUMesh. The caller is
- * to delete this mesh using decrRef() as it is no more needed.
+ * to delete this mesh using decrRef() as it is no more needed.
* \throw If the coordinates array is not set.
* \throw If the nodal connectivity of cells is not defined.
* \throw If any cell id in the array \a begin is not valid.
MCAuto<DataArrayInt> arrOutAuto(arrOut),arrIOutAuto(arrIOut);
setConnectivity(arrOut,arrIOut,true);
}
-}
+}
/*!
* specified node ids and the value of \a fullyIn parameter. If \a fullyIn ==\c true, a
* cell is copied if its all nodes are in the array \a begin of node ids. If \a fullyIn
* ==\c false, a cell is copied if any its node is in the array of node ids. The
- * created mesh shares the node coordinates array with \a this mesh.
+ * created mesh shares the node coordinates array with \a this mesh.
* \param [in] begin - the array of node ids.
* \param [in] end - a pointer to the (last+1)-th element of \a begin.
* \param [in] fullyIn - if \c true, then cells whose all nodes are in the
* array \a begin are added, else cells whose any node is in the
* array \a begin are added.
* \return MEDCouplingUMesh * - new instance of MEDCouplingUMesh. The caller is
- * to delete this mesh using decrRef() as it is no more needed.
+ * to delete this mesh using decrRef() as it is no more needed.
* \throw If the coordinates array is not set.
* \throw If the nodal connectivity of cells is not defined.
* \throw If any node id in \a begin is not valid.
* array of \a this mesh, else "free" nodes are removed from the result mesh
* by calling zipCoords().
* \return MEDCouplingUMesh * - a new instance of MEDCouplingUMesh. The caller is
- * to delete this mesh using decrRef() as it is no more needed.
+ * to delete this mesh using decrRef() as it is no more needed.
* \throw If the coordinates array is not set.
* \throw If the nodal connectivity of cells is not defined.
*
/*!
* This method returns a newly created DataArrayInt instance containing ids of cells located in boundary.
* A cell is detected to be on boundary if it contains one or more than one face having only one father.
- * This method makes the assumption that \a this is fully defined (coords,connectivity). If not an exception will be thrown.
+ * This method makes the assumption that \a this is fully defined (coords,connectivity). If not an exception will be thrown.
*/
DataArrayInt *MEDCouplingUMesh::findCellIdsOnBoundary() const
{
/*!
* This method computes the skin of \b this. That is to say the consituting meshdim-1 mesh is built and only the boundary subpart is
* returned. This subpart of meshdim-1 mesh is built using meshdim-1 cells in it shared only one cell in \b this.
- *
+ *
* \return a newly allocated mesh lying on the same coordinates than \b this. The caller has to deal with returned mesh.
*/
MEDCouplingUMesh *MEDCouplingUMesh::computeSkin() const
/*!
* This method operates a modification of the connectivity and coords in \b this.
- * Every time that a node id in [ \b nodeIdsToDuplicateBg, \b nodeIdsToDuplicateEnd ) will append in nodal connectivity of \b this
+ * Every time that a node id in [ \b nodeIdsToDuplicateBg, \b nodeIdsToDuplicateEnd ) will append in nodal connectivity of \b this
* its ids will be modified to id this->getNumberOfNodes()+std::distance(nodeIdsToDuplicateBg,std::find(nodeIdsToDuplicateBg,nodeIdsToDuplicateEnd,id)).
* More explicitly the renumber array in nodes is not explicitly given in old2new to avoid to build a big array of renumbering whereas typically few node ids needs to be
* renumbered. The node id nodeIdsToDuplicateBg[0] will have id this->getNumberOfNodes()+0, node id nodeIdsToDuplicateBg[1] will have id this->getNumberOfNodes()+1,
* node id nodeIdsToDuplicateBg[2] will have id this->getNumberOfNodes()+2...
- *
+ *
* As a consequence nodal connectivity array length will remain unchanged by this method, and nodal connectivity index array will remain unchanged by this method.
- *
+ *
* \param [in] nodeIdsToDuplicateBg begin of node ids (included) to be duplicated in connectivity only
* \param [in] nodeIdsToDuplicateEnd end of node ids (excluded) to be duplicated in connectivity only
*/
* This method is a generalization of shiftNodeNumbersInConn().
* \warning This method performs no check of validity of new ids. **Use it with care !**
* \param [in] newNodeNumbersO2N - a permutation array, of length \a
- * this->getNumberOfNodes(), in "Old to New" mode.
+ * this->getNumberOfNodes(), in "Old to New" mode.
* See \ref numbering for more info on renumbering modes.
* \throw If the nodal connectivity of cells is not defined.
*
* This method renumbers nodes \b in \b connectivity \b only \b without \b any \b reference \b to \b coords.
* This method performs no check on the fact that new coordinate ids are valid. \b Use \b it \b with \b care !
* This method is an specialization of \ref MEDCoupling::MEDCouplingUMesh::renumberNodesInConn "renumberNodesInConn method".
- *
+ *
* \param [in] delta specifies the shift size applied to nodeId in nodal connectivity in \b this.
*/
void MEDCouplingUMesh::shiftNodeNumbersInConn(int delta)
/*!
* This method operates a modification of the connectivity in \b this.
* Coordinates are \b NOT considered here and will remain unchanged by this method. this->_coords can ever been null for the needs of this method.
- * Every time that a node id in [ \b nodeIdsToDuplicateBg, \b nodeIdsToDuplicateEnd ) will append in nodal connectivity of \b this
+ * Every time that a node id in [ \b nodeIdsToDuplicateBg, \b nodeIdsToDuplicateEnd ) will append in nodal connectivity of \b this
* its ids will be modified to id offset+std::distance(nodeIdsToDuplicateBg,std::find(nodeIdsToDuplicateBg,nodeIdsToDuplicateEnd,id)).
* More explicitly the renumber array in nodes is not explicitly given in old2new to avoid to build a big array of renumbering whereas typically few node ids needs to be
* renumbered. The node id nodeIdsToDuplicateBg[0] will have id offset+0, node id nodeIdsToDuplicateBg[1] will have id offset+1,
* node id nodeIdsToDuplicateBg[2] will have id offset+2...
- *
+ *
* As a consequence nodal connectivity array length will remain unchanged by this method, and nodal connectivity index array will remain unchanged by this method.
* As an another consequense after the call of this method \b this can be transiently non cohrent.
- *
+ *
* \param [in] nodeIdsToDuplicateBg begin of node ids (included) to be duplicated in connectivity only
* \param [in] nodeIdsToDuplicateEnd end of node ids (excluded) to be duplicated in connectivity only
- * \param [in] offset the offset applied to all node ids in connectivity that are in [ \a nodeIdsToDuplicateBg, \a nodeIdsToDuplicateEnd ).
+ * \param [in] offset the offset applied to all node ids in connectivity that are in [ \a nodeIdsToDuplicateBg, \a nodeIdsToDuplicateEnd ).
*/
void MEDCouplingUMesh::duplicateNodesInConn(const int *nodeIdsToDuplicateBg, const int *nodeIdsToDuplicateEnd, int offset)
{
* If 'check' equals false the method will not check the content of [ \a old2NewBg ; \a old2NewEnd ).
* To avoid any throw of SIGSEGV when 'check' equals false, the elements in [ \a old2NewBg ; \a old2NewEnd ) should be unique and
* 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
*/
* Finds cells whose bounding boxes intersect a given bounding box.
* \param [in] bbox - an array defining the bounding box via coordinates of its
* extremum points in "no interlace" mode, i.e. xMin, xMax, yMin, yMax, zMin,
- * zMax (if in 3D).
+ * zMax (if in 3D).
* \param [in] eps - a factor used to increase size of the bounding box of cell
* before comparing it with \a bbox. This factor is multiplied by the maximal
* extent of the bounding box of cell to produce an addition to this bounding box.
* \return DataArrayInt * - a new instance of DataArrayInt holding ids for found
* cells. The caller is to delete this array using decrRef() as it is no more
- * needed.
+ * needed.
* \throw If the coordinates array is not set.
* \throw If the nodal connectivity of cells is not defined.
*
* This method returns an instance with all arrays allocated (connectivity, connectivity index, coordinates)
* but with length of these arrays set to 0. It allows to define an "empty" mesh (with nor cells nor nodes but compliant with
* some algos).
- *
+ *
* This method expects that \a this has a mesh dimension set and higher or equal to 0. If not an exception will be thrown.
* This method analyzes the 3 arrays of \a this. For each the following behaviour is done : if the array is null a newly one is created
* with number of tuples set to 0, if not the array is taken as this in the returned instance.
* \param [in] begin - an array of cell ids of interest.
* \param [in] end - the end of \a begin, i.e. a pointer to its (last+1)-th element.
* \return std::set<INTERP_KERNEL::NormalizedCellType> - a set of enumeration items
- * describing the cell types.
+ * describing the cell types.
* \throw If the coordinates array is not set.
* \throw If the nodal connectivity of cells is not defined.
* \sa getAllGeoTypes()
/*!
* Defines the nodal connectivity using given connectivity arrays in \ref numbering-indirect format.
* Optionally updates
- * a set of types of cells constituting \a this mesh.
+ * a set of types of cells constituting \a this mesh.
* This method is for advanced users having prepared their connectivity before. For
* more info on using this method see \ref MEDCouplingUMeshAdvBuild.
- * \param [in] conn - the nodal connectivity array.
+ * \param [in] conn - the nodal connectivity array.
* \param [in] connIndex - the nodal connectivity index array.
* \param [in] isComputingTypes - if \c true, the set of types constituting \a this
* mesh is updated.
/*!
- * Returns a number of cells constituting \a this mesh.
+ * Returns a number of cells constituting \a this mesh.
* \return int - the number of cells in \a this mesh.
* \throw If the nodal connectivity of cells is not defined.
*/
std::size_t MEDCouplingUMesh::getNumberOfCells() const
-{
+{
if(_nodal_connec_index)
return _nodal_connec_index->getNumberOfTuples()-1;
else
* \param [in] end - the end of \a begin, i.e. a pointer to its (last+1)-th element.
* \return DataArrayDouble * - a new instance of DataArrayDouble. The caller is to
* delete this array using decrRef() as it is no more needed.
- *
+ *
* \if ENABLE_EXAMPLES
* \ref cpp_mcumesh_getPartMeasureField "Here is a C++ example".<br>
* \ref py_mcumesh_getPartMeasureField "Here is a Python example".
* mesh. The returned normal vectors to each cell have a norm2 equal to 1.
* The computed vectors have <em> this->getMeshDimension()+1 </em> components
* and are normalized.
- * <br> \a this can be either
- * - a 2D mesh in 2D or 3D space or
+ * <br> \a this can be either
+ * - a 2D mesh in 2D or 3D space or
* - an 1D mesh in 2D space.
- *
+ *
* \return MEDCouplingFieldDouble * - a new instance of MEDCouplingFieldDouble on
* cells and one time. The caller is to delete this field using decrRef() as
* it is no more needed.
* Returns a new MEDCouplingFieldDouble holding normal vectors to specified cells of
* \a this mesh. The computed vectors have <em> this->getMeshDimension()+1 </em> components
* and are normalized.
- * <br> \a this can be either
- * - a 2D mesh in 2D or 3D space or
+ * <br> \a this can be either
+ * - a 2D mesh in 2D or 3D space or
* - an 1D mesh in 2D space.
- *
+ *
* This method avoids building explicitly a part of \a this mesh to perform the work.
* \param [in] begin - an array of cell ids of interest.
* \param [in] end - the end of \a begin, i.e. a pointer to its (last+1)-th element.
* using decrRef() as it is no more needed.
* \return MEDCouplingUMesh * - a new instance of MEDCouplingUMesh. This mesh does
* not share the node coordinates array with \a this mesh. The caller is to
- * delete this mesh using decrRef() as it is no more needed.
+ * delete this mesh using decrRef() as it is no more needed.
* \throw If the coordinates array is not set.
* \throw If the nodal connectivity of cells is not defined.
* \throw If \a this->getMeshDimension() != 3 or \a this->getSpaceDimension() != 3.
* \return MEDCouplingUMesh * - a new instance of MEDCouplingUMesh. This is an 1D
* mesh in 3D space. This mesh does not share the node coordinates array with
* \a this mesh. The caller is to delete this mesh using decrRef() as it is
- * no more needed.
+ * no more needed.
* \throw If the coordinates array is not set.
* \throw If the nodal connectivity of cells is not defined.
* \throw If \a this->getMeshDimension() != 2 or \a this->getSpaceDimension() != 3.
}
/*!
- * This method computes the distance from a point \a pt to \a this and the first \a cellId in \a this corresponding to the returned distance.
+ * This method computes the distance from a point \a pt to \a this and the first \a cellId in \a this corresponding to the returned distance.
* \a this is expected to be a mesh so that its space dimension is equal to its
* mesh dimension + 1. Furthermore only mesh dimension 1 and 2 are supported for the moment.
* Distance from \a ptBg to \a ptEnd is expected to be equal to the space dimension. \a this is also expected to be fully defined (connectivity and coordinates).
/*!
* This method computes the distance from each point of points serie \a pts (stored in a DataArrayDouble in which each tuple represents a point)
- * to \a this and the first \a cellId in \a this corresponding to the returned distance.
+ * to \a this and the first \a cellId in \a this corresponding to the returned distance.
* WARNING, if there is some orphan nodes in \a this (nodes not fetched by any cells in \a this ( see MEDCouplingUMesh::zipCoords ) ) these nodes will ** not ** been taken
* into account in this method. Only cells and nodes lying on them are considered in the algorithm (even if one of these orphan nodes is closer than returned distance).
* A user that needs to consider orphan nodes should invoke DataArrayDouble::minimalDistanceTo method on the coordinates array of \a this.
- *
+ *
* \a this is expected to be a mesh so that its space dimension is equal to its
* mesh dimension + 1. Furthermore only mesh dimension 1 and 2 are supported for the moment.
* Number of components of \a pts is expected to be equal to the space dimension. \a this is also expected to be fully defined (connectivity and coordinates).
/// @endcond
/*!
- * Finds cells in contact with a ball (i.e. a point with precision).
+ * Finds cells in contact with a ball (i.e. a point with precision).
* For speed reasons, the INTERP_KERNEL::NORM_QUAD4, INTERP_KERNEL::NORM_TRI6 and INTERP_KERNEL::NORM_QUAD8 cells are considered as convex cells to detect if a point is IN or OUT.
* If it is not the case, please change their types to INTERP_KERNEL::NORM_POLYGON or INTERP_KERNEL::NORM_QPOLYG before invoking this method.
*
* \warning This method is suitable if the caller intends to evaluate only one
* point, for more points getCellsContainingPoints() is recommended as it is
- * faster.
+ * faster.
* \param [in] pos - array of coordinates of the ball central point.
* \param [in] eps - ball radius.
* \return int - a smallest id of cells being in contact with the ball, -1 in case
* If it is not the case, please change their types to INTERP_KERNEL::NORM_POLYGON or INTERP_KERNEL::NORM_QPOLYG before invoking this method.
* \warning This method is suitable if the caller intends to evaluate only one
* point, for more points getCellsContainingPoints() is recommended as it is
- * faster.
+ * faster.
* \param [in] pos - array of coordinates of the ball central point.
* \param [in] eps - ball radius.
* \param [out] elts - vector returning ids of the found cells. It is cleared
* If it is not the case, please change their types to INTERP_KERNEL::NORM_POLYGON or INTERP_KERNEL::NORM_QPOLYG before invoking this method.
* \param [in] pos - an array of coordinates of points in full interlace mode :
* X0,Y0,Z0,X1,Y1,Z1,... Size of the array must be \a
- * this->getSpaceDimension() * \a nbOfPoints
+ * this->getSpaceDimension() * \a nbOfPoints
* \param [in] nbOfPoints - number of points to locate within \a this mesh.
* \param [in] eps - radius of balls (i.e. the precision).
* \param [out] elts - vector returning ids of found cells.
*
* This method expects that space dimension is equal to 2 and mesh dimension is equal to 2 too. If it is not the case an INTERP_KERNEL::Exception will be thrown.
* This method works only for linear 2D cells. If there is any of non linear cells (INTERP_KERNEL::NORM_QUAD8 for example) an INTERP_KERNEL::Exception will be thrown too.
- *
+ *
* For each 2D linear cell in \b this, this method builds the convex envelop (or the convex hull) of the current cell.
* This convex envelop is computed using Jarvis march algorithm.
* The coordinates and the number of cells of \b this remain unchanged on invocation of this method.
* the 3 preceding points of the 1D mesh. The center of the arc is the center of rotation for each level, the rotation is done
* along an axis normal to the plane containing the arc, and finally the angle of rotation is defined by the first two points on the
* arc.
- * \return an unstructured mesh with meshDim==3 and spaceDim==3. The returned mesh has the same coords than \a this.
+ * \return an unstructured mesh with meshDim==3 and spaceDim==3. The returned mesh has the same coords than \a this.
*/
MEDCouplingUMesh *MEDCouplingUMesh::buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy)
{
* or to INTERP_KERNEL::NORM_TRI7 if \a conversionType is equal to 1. All non linear cells and polyhedron in \a this are let untouched.
* Contrary to MEDCouplingUMesh::convertQuadraticCellsToLinear method, the coordinates in \a this can be become bigger. All created nodes will be put at the
* end of the existing coordinates.
- *
+ *
* \param [in] conversionType specifies the type of conversion expected. Only 0 (default) and 1 are supported presently. 0 those that creates the 'most' simple
* corresponding quadratic cells. 1 is those creating the 'most' complex.
* \return a newly created DataArrayInt instance that the caller should deal with containing cell ids of converted cells.
- *
+ *
* \throw if \a this is not fully defined. It throws too if \a conversionType is not in [0,1].
*
* \sa MEDCouplingUMesh::convertQuadraticCellsToLinear
*
* \throw If \a policy is 0 or 1 and \a this->getMeshDimension() != 2.
* \throw If \a policy is INTERP_KERNEL::PLANAR_FACE_5 or INTERP_KERNEL::PLANAR_FACE_6
- * and \a this->getMeshDimension() != 3.
+ * and \a this->getMeshDimension() != 3.
* \throw If \a policy is not one of the four discussed above.
* \throw If the nodal connectivity of cells is not defined.
* \sa MEDCouplingUMesh::tetrahedrize, MEDCoupling1SGTUMesh::sortHexa8EachOther
* A cell is considered to be oriented correctly if an angle between its
* normal vector and a given vector is less than \c PI / \c 2.
* \param [in] vec - 3 components of the vector specifying the correct orientation of
- * cells.
+ * cells.
* \param [in] polyOnly - if \c true, only polygons are checked, else, all cells are
* checked.
* \param [in,out] cells - a vector returning ids of incorrectly oriented cells. It
/*!
* Reverse connectivity of 2D cells whose orientation is not correct. A cell is
* considered to be oriented correctly if an angle between its normal vector and a
- * given vector is less than \c PI / \c 2.
+ * given vector is less than \c PI / \c 2.
* \param [in] vec - 3 components of the vector specifying the correct orientation of
- * cells.
+ * cells.
* \param [in] polyOnly - if \c true, only polygons are checked, else, all cells are
* checked.
* \throw If \a this->getMeshDimension() != 2.
/*!
* Tries to fix connectivity of polyhedra, so that normal vector of all facets to point
- * out of the cell.
+ * out of the cell.
* \throw If \a this->getMeshDimension() != 3.
* \throw If \a this->getSpaceDimension() != 3.
* \throw If the coordinates array is not set.
}
/*!
- * This method invert orientation of all cells in \a this.
+ * This method invert orientation of all cells in \a this.
* After calling this method the absolute value of measure of cells in \a this are the same than before calling.
* This method only operates on the connectivity so coordinates are not touched at all.
*/
* pointing out of cell.
* \return DataArrayInt * - a new instance of DataArrayInt holding ids of fixed
* cells. The caller is to delete this array using decrRef() as it is no more
- * needed.
+ * needed.
* \throw If \a this->getMeshDimension() != 3.
* \throw If \a this->getSpaceDimension() != 3.
* \throw If the coordinates array is not set.
* This method is a faster method to correct orientation of all 3D cells in \a this.
* This method works only if \a this is a 3D mesh, that is to say a mesh with mesh dimension 3 and a space dimension 3.
* This method makes the hypothesis that \a this a coherent that is to say MEDCouplingUMesh::checkConsistency should throw no exception.
- *
+ *
* \return a newly allocated int array with one components containing cell ids renumbered to fit the convention of MED (MED file and MEDCoupling)
- * \sa MEDCouplingUMesh::orientCorrectlyPolyhedrons,
+ * \sa MEDCouplingUMesh::orientCorrectlyPolyhedrons,
*/
DataArrayInt *MEDCouplingUMesh::findAndCorrectBadOriented3DCells()
{
* INTERP_KERNEL::NORM_TRI3, INTERP_KERNEL::NORM_QUAD4 and INTERP_KERNEL::NORM_TETRA4.
* For a cell of other type an exception is thrown.
* Space dimension of a 2D mesh can be either 2 or 3.
- * The Edge Ratio of a cell \f$t\f$ is:
+ * The Edge Ratio of a cell \f$t\f$ is:
* \f$\frac{|t|_\infty}{|t|_0}\f$,
* where \f$|t|_\infty\f$ and \f$|t|_0\f$ respectively denote the greatest and
* the smallest edge lengths of \f$t\f$.
* \return MEDCouplingFieldDouble * - a new instance of MEDCouplingFieldDouble on
* cells and one time, lying on \a this mesh. The caller is to delete this
- * field using decrRef() as it is no more needed.
+ * field using decrRef() as it is no more needed.
* \throw If the coordinates array is not set.
* \throw If \a this mesh contains elements of dimension different from the mesh dimension.
* \throw If the connectivity data array has more than one component.
* Space dimension of a 2D mesh can be either 2 or 3.
* \return MEDCouplingFieldDouble * - a new instance of MEDCouplingFieldDouble on
* cells and one time, lying on \a this mesh. The caller is to delete this
- * field using decrRef() as it is no more needed.
+ * field using decrRef() as it is no more needed.
* \throw If the coordinates array is not set.
* \throw If \a this mesh contains elements of dimension different from the mesh dimension.
* \throw If the connectivity data array has more than one component.
* \f]
* \return MEDCouplingFieldDouble * - a new instance of MEDCouplingFieldDouble on
* cells and one time, lying on \a this mesh. The caller is to delete this
- * field using decrRef() as it is no more needed.
+ * field using decrRef() as it is no more needed.
* \throw If the coordinates array is not set.
* \throw If \a this mesh contains elements of dimension different from the mesh dimension.
* \throw If the connectivity data array has more than one component.
* For a cell of other type an exception is thrown.
* \return MEDCouplingFieldDouble * - a new instance of MEDCouplingFieldDouble on
* cells and one time, lying on \a this mesh. The caller is to delete this
- * field using decrRef() as it is no more needed.
+ * field using decrRef() as it is no more needed.
* \throw If the coordinates array is not set.
* \throw If \a this mesh contains elements of dimension different from the mesh dimension.
* \throw If the connectivity data array has more than one component.
/*!
* This method aggregate the bbox of each cell and put it into bbox parameter (xmin,xmax,ymin,ymax,zmin,zmax).
- *
+ *
* \param [in] arcDetEps - a parameter specifying in case of 2D quadratic polygon cell the detection limit between linear and arc circle. (By default 1e-12)
* For all other cases this input parameter is ignored.
* \return DataArrayDouble * - newly created object (to be managed by the caller) \a this number of cells tuples and 2*spacedim components.
- *
+ *
* \throw If \a this is not fully set (coordinates and connectivity).
* \throw If a cell in \a this has no valid nodeId.
* \sa MEDCouplingUMesh::getBoundingBoxForBBTreeFast, MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic
/*!
* This method aggregate the bbox of each cell only considering the nodes constituting each cell and put it into bbox parameter.
* So meshes having quadratic cells the computed bounding boxes can be invalid !
- *
+ *
* \return DataArrayDouble * - newly created object (to be managed by the caller) \a this number of cells tuples and 2*spacedim components.
- *
+ *
* \throw If \a this is not fully set (coordinates and connectivity).
* \throw If a cell in \a this has no valid nodeId.
*/
* useful for 2D meshes having quadratic cells
* because for this type of cells getBoundingBoxForBBTreeFast method may return invalid bounding boxes (since it just considers
* the two extremities of the arc of circle).
- *
+ *
* \param [in] arcDetEps - a parameter specifying in case of 2D quadratic polygon cell the detection limit between linear and arc circle. (By default 1e-12)
* \return DataArrayDouble * - newly created object (to be managed by the caller) \a this number of cells tuples and 2*spacedim components.
* \throw If \a this is not fully defined.
else
pol=INTERP_KERNEL::QuadraticPolygon::BuildArcCirclePolygon(nodes);
INTERP_KERNEL::Bounds b; b.prepareForAggregation(); pol->fillBounds(b); delete pol;
- bbox[0]=b.getXMin(); bbox[1]=b.getXMax(); bbox[2]=b.getYMin(); bbox[3]=b.getYMax();
+ bbox[0]=b.getXMin(); bbox[1]=b.getXMax(); bbox[2]=b.getYMin(); bbox[3]=b.getYMax();
}
return ret.retn();
}
* useful for 2D meshes having quadratic cells
* because for this type of cells getBoundingBoxForBBTreeFast method may return invalid bounding boxes (since it just considers
* the two extremities of the arc of circle).
- *
+ *
* \param [in] arcDetEps - a parameter specifying in case of 2D quadratic polygon cell the detection limit between linear and arc circle. (By default 1e-12)
* \return DataArrayDouble * - newly created object (to be managed by the caller) \a this number of cells tuples and 2*spacedim components.
* \throw If \a this is not fully defined.
* This method expects that \a this is sorted by types. If not an exception will be thrown.
* This method returns in the same format as code (see MEDCouplingUMesh::checkTypeConsistencyAndContig or MEDCouplingUMesh::splitProfilePerType) how
* \a this is composed in cell types.
- * The returned array is of size 3*n where n is the number of different types present in \a this.
- * For every k in [0,n] ret[3*k+2]==-1 because it has no sense here.
+ * The returned array is of size 3*n where n is the number of different types present in \a this.
+ * For every k in [0,n] ret[3*k+2]==-1 because it has no sense here.
* This parameter is kept only for compatibility with other method listed above.
*/
std::vector<int> MEDCouplingUMesh::getDistributionOfTypes() const
* If it exists k so that 3*k geometric type is not in geometric types of this an exception will be thrown.
* If it exists k so that 3*k geometric type exists but the number of consecutive cell types does not match,
* an exception is thrown too.
- *
+ *
* If all geometric types in \a code are exactly those in \a this null pointer is returned.
- * If it exists a geometric type in \a this \b not in \a code \b no exception is thrown
+ * If it exists a geometric type in \a this \b not in \a code \b no exception is thrown
* and a DataArrayInt instance is returned that the user has the responsibility to deallocate.
*/
DataArrayInt *MEDCouplingUMesh::checkTypeConsistencyAndContig(const std::vector<int>& code, const std::vector<const DataArrayInt *>& idsPerType) const
* This method is the opposite of MEDCouplingUMesh::checkTypeConsistencyAndContig method. Given a list of cells in \a profile it returns a list of sub-profiles sorted by geo type.
* 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 [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,
/*!
* This method is a specialization of MEDCouplingUMesh::checkConsecutiveCellTypesAndOrder method that is called here.
* The geometric type order is specified by MED file.
- *
+ *
* \sa MEDCouplingUMesh::checkConsecutiveCellTypesAndOrder
*/
bool MEDCouplingUMesh::checkConsecutiveCellTypesForMEDFileFrmt() const
/*!
* This method computes for each cell in \a this, the location of the iso barycenter of nodes constituting
- * the cell. Contrary to badly named MEDCouplingUMesh::computeCellCenterOfMass method that returns the center of inertia of the
- *
- * \return a newly allocated DataArrayDouble instance that the caller has to deal with. The returned
+ * the cell. Contrary to badly named MEDCouplingUMesh::computeCellCenterOfMass method that returns the center of inertia of the
+ *
+ * \return a newly allocated DataArrayDouble instance that the caller has to deal with. The returned
* DataArrayDouble instance will have \c this->getNumberOfCells() tuples and \c this->getSpaceDimension() components.
- *
+ *
* \sa MEDCouplingUMesh::computeCellCenterOfMass
* \throw If \a this is not fully defined (coordinates and connectivity)
* \throw If there is presence in nodal connectivity in \a this of node ids not in [0, \c this->getNumberOfNodes() )
/*!
* Returns a new DataArrayDouble holding barycenters of specified cells. The
* barycenter is computed by averaging coordinates of cell nodes. The cells to treat
- * are specified via an array of cell ids.
- * \warning Validity of the specified cell ids is not checked!
+ * are specified via an array of cell ids.
+ * \warning Validity of the specified cell ids is not checked!
* Valid range is [ 0, \a this->getNumberOfCells() ).
* \param [in] begin - an array of cell ids of interest.
* \param [in] end - the end of \a begin, i.e. a pointer to its (last+1)-th element.
* \return DataArrayDouble * - a new instance of DataArrayDouble, of size ( \a
* end - \a begin ) tuples per \a this->getSpaceDimension() components. The
- * caller is to delete this array using decrRef() as it is no more needed.
+ * caller is to delete this array using decrRef() as it is no more needed.
* \throw If the coordinates array is not set.
* \throw If the nodal connectivity of cells is not defined.
*
* So this method expects that \a this has a spaceDimension equal to 3 and meshDimension equal to 2.
* The computation of the plane equation is done using each time the 3 first nodes of 2D cells.
* This method is useful to detect 2D cells in 3D space that are not coplanar.
- *
+ *
* \return DataArrayDouble * - a new instance of DataArrayDouble having 4 components and a number of tuples equal to number of cells in \a this.
* \throw If spaceDim!=3 or meshDim!=2.
* \throw If connectivity of \a this is invalid.
/*!
* This method expects as input a DataArrayDouble non nul instance 'da' that should be allocated. If not an exception is thrown.
- *
+ *
*/
MEDCouplingUMesh *MEDCouplingUMesh::Build0DMeshFromCoords(DataArrayDouble *da)
{
* the nodal connectivity array. The given meshes **can be of different** mesh
* dimension. This method is particularly useful in MEDLoader context to build a \ref
* MEDCoupling::MEDFileUMesh "MEDFileUMesh" instance that expects that underlying
- * MEDCouplingUMesh'es of different dimension share the same nodal connectivity array.
+ * MEDCouplingUMesh'es of different dimension share the same nodal connectivity array.
* \param [in,out] meshes - a vector of meshes to update.
* \param [in] eps - the precision used to detect coincident nodes (infinite norm).
* \throw If any of \a meshes is NULL.
{
(*it)->renumberNodesInConn(o2n->begin());
(*it)->setCoords(newCoords);
- }
+ }
}
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::IsTetra4WellOriented : Tetra4 cell with not 4 nodes ! Call checkConsistency !");
double vec0[3],vec1[3];
const double *pt0=coords+3*begin[0],*pt1=coords+3*begin[1],*pt2=coords+3*begin[2],*pt3=coords+3*begin[3];
- vec0[0]=pt1[0]-pt0[0]; vec0[1]=pt1[1]-pt0[1]; vec0[2]=pt1[2]-pt0[2]; vec1[0]=pt2[0]-pt0[0]; vec1[1]=pt2[1]-pt0[1]; vec1[2]=pt2[2]-pt0[2];
+ vec0[0]=pt1[0]-pt0[0]; vec0[1]=pt1[1]-pt0[1]; vec0[2]=pt1[2]-pt0[2]; vec1[0]=pt2[0]-pt0[0]; vec1[1]=pt2[1]-pt0[1]; vec1[2]=pt2[2]-pt0[2];
return ((vec0[1]*vec1[2]-vec0[2]*vec1[1])*(pt3[0]-pt0[0])+(vec0[2]*vec1[0]-vec0[0]*vec1[2])*(pt3[1]-pt0[1])+(vec0[0]*vec1[1]-vec0[1]*vec1[0])*(pt3[2]-pt0[2]))<0;
}
}
/*!
- * This method performs a simplyfication of a single polyedron cell. To do that each face of cell whose connectivity is defined by [ \b begin , \b end )
+ * This method performs a simplyfication of a single polyedron cell. To do that each face of cell whose connectivity is defined by [ \b begin , \b end )
* is compared with the others in order to find faces in the same plane (with approx of eps). If any, the cells are grouped together and projected to
* a 2D space.
*
/*!
* This method computes the normalized vector of the plane and the pos of the point belonging to the plane and the line defined by the vector going
* through origin. The plane is defined by its nodal connectivity [ \b begin, \b end ).
- *
+ *
* \param [in] eps below that value the dot product of 2 vectors is considered as colinears
* \param [in] coords coordinates expected to have 3 components.
* \param [in] begin start of the nodal connectivity of the face.
if(b1 || b2) { b=b2; isPerm[i]=true; smthChanged++; break; }
}
if(isPerm[i])
- {
+ {
if(!b)
std::reverse(bgFace+1,endFace);
for(std::size_t j=0;j<nbOfEdgesInFace;j++)
/*!
* This method makes the assumption spacedimension == meshdimension == 2.
* This method works only for linear cells.
- *
+ *
* \return a newly allocated array containing the connectivity of a polygon type enum included (NORM_POLYGON in pos#0)
*/
DataArrayInt *MEDCouplingUMesh::buildUnionOf2DMesh() const
/*!
* This method makes the assumption spacedimension == meshdimension == 3.
* This method works only for linear cells.
- *
+ *
* \return a newly allocated array containing the connectivity of a polygon type enum included (NORM_POLYHED in pos#0)
*/
DataArrayInt *MEDCouplingUMesh::buildUnionOf3DMesh() const
* avoid to have a non conform mesh.
*
* \return int - the number of new nodes created (in most of cases 0).
- *
+ *
* \throw If \a this is not coherent.
* \throw If \a this has not spaceDim equal to 2.
* \throw If \a this has not meshDim equal to 2.
* the geometric cell type set to INTERP_KERNEL::NORM_POLYGON.
* This method excepts that \b coords parameter is expected to be in dimension 2. [ \b nodalConnBg , \b nodalConnEnd ) is the nodal connectivity of the input
* cell (geometric cell type included at the position 0). If the meshdimension of the input cell is not equal to 2 an INTERP_KERNEL::Exception will be thrown.
- *
+ *
* \return false if the input connectivity represents already the convex hull, true if the input cell needs to be reordered.
*/
bool MEDCouplingUMesh::BuildConvexEnvelopOf2DCellJarvis(const double *coords, const int *nodalConnBg, const int *nodalConnEnd, DataArrayInt *nodalConnecOut)
/*!
* This method works on an input pair (\b arr, \b arrIndx) where \b arr indexes is in \b arrIndx.
* This method will not impact the size of inout parameter \b arrIndx but the size of \b arr will be modified in case of suppression.
- *
+ *
* \param [in] idsToRemoveBg begin of set of ids to remove in \b arr (included)
* \param [in] idsToRemoveEnd end of set of ids to remove in \b arr (excluded)
* \param [in,out] arr array in which the remove operation will be done.
* \param [in] srcArrIndex index array of \b srcArr
* \param [out] arrOut the resulting array
* \param [out] arrIndexOut the index array of the resulting array \b arrOut
- *
+ *
* \sa MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx
*/
void MEDCouplingUMesh::SetPartOfIndexedArrays(const int *idsOfSelectBg, const int *idsOfSelectEnd, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
* \param [in] arrIndxIn is the input index array allowing to walk into \b arrIn
* \param [in] srcArr input array that will be used as source of copy for ids in [ \b idsOfSelectBg , \b idsOfSelectEnd )
* \param [in] srcArrIndex index array of \b srcArr
- *
+ *
* \sa MEDCouplingUMesh::SetPartOfIndexedArrays
*/
void MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(const int *idsOfSelectBg, const int *idsOfSelectEnd, DataArrayInt *arrInOut, const DataArrayInt *arrIndxIn,
* Then it is repeated recursively until either all ids are fetched or no more ids are reachable step by step.
* A negative value in \b arrIn means that it is ignored.
* This method is useful to see if a mesh is contiguous regarding its connectivity. If it is not the case the size of returned array is different from arrIndxIn->getNumberOfTuples()-1.
- *
+ *
* \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
* \return a newly allocated DataArray that stores all ids fetched by the gradually spread process.
* \param [in] srcArrIndex index array of \b srcArr
* \param [out] arrOut the resulting array
* \param [out] arrIndexOut the index array of the resulting array \b arrOut
- *
+ *
* \sa MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx MEDCouplingUMesh::SetPartOfIndexedArrays
*/
void MEDCouplingUMesh::SetPartOfIndexedArraysSlice(int start, int end, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
* \param [in] arrIndxIn is the input index array allowing to walk into \b arrIn
* \param [in] srcArr input array that will be used as source of copy for ids in [\b idsOfSelectBg, \b idsOfSelectEnd)
* \param [in] srcArrIndex index array of \b srcArr
- *
+ *
* \sa MEDCouplingUMesh::SetPartOfIndexedArraysSlice MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx
*/
void MEDCouplingUMesh::SetPartOfIndexedArraysSameIdxSlice(int start, int end, int step, DataArrayInt *arrInOut, const DataArrayInt *arrIndxIn,
* The returned mesh contains as poly cells as number of contiguous zone (regarding connectivity).
* A spread contiguous zone is built using poly cells (polyhedra in 3D, polygons in 2D and polyline in 1D).
* The sum of measure field of returned mesh is equal to the sum of measure field of this.
- *
+ *
* \return a newly allocated mesh lying on the same coords than \b this with same meshdimension than \b this.
*/
MEDCouplingUMesh *MEDCouplingUMesh::buildSpreadZonesWithPoly() const
* This method will split **all** 3D cells in \a this into INTERP_KERNEL::NORM_TETRA4 cells and put them in the returned mesh.
* It leads to an increase to number of cells.
* This method contrary to MEDCouplingUMesh::simplexize can append coordinates in \a this to perform its work.
- * The \a nbOfAdditionalPoints returned value informs about it. If > 0, the coordinates array in returned mesh will have \a nbOfAdditionalPoints
+ * The \a nbOfAdditionalPoints returned value informs about it. If > 0, the coordinates array in returned mesh will have \a nbOfAdditionalPoints
* more tuples (nodes) than in \a this. Anyway, all the nodes in \a this (with the same order) will be in the returned mesh.
*
* \param [in] policy - the policy of splitting that must be in (PLANAR_FACE_5, PLANAR_FACE_6, GENERAL_24, GENERAL_48). The policy will be used only for INTERP_KERNEL::NORM_HEXA8 cells.
* For all other cells, the splitting policy will be ignored. See INTERP_KERNEL::SplittingPolicy for the images.
- * \param [out] nbOfAdditionalPoints - number of nodes added to \c this->_coords. If > 0 a new coordinates object will be constructed result of the aggregation of the old one and the new points added.
+ * \param [out] nbOfAdditionalPoints - number of nodes added to \c this->_coords. If > 0 a new coordinates object will be constructed result of the aggregation of the old one and the new points added.
* \param [out] n2oCells - A new instance of DataArrayInt holding, for each new cell,
* an id of old cell producing it. The caller is to delete this array using
* decrRef() as it is no more needed.
*
* \warning This method operates on each cells in this independently ! So it can leads to non conform mesh in returned value ! If you expect to have a conform mesh in output
* the policy PLANAR_FACE_6 should be used on a mesh sorted with MEDCoupling1SGTUMesh::sortHexa8EachOther.
- *
+ *
* \throw If \a this is not a 3D mesh (spaceDim==3 and meshDim==3).
* \throw If \a this is not fully constituted with linear 3D cells.
* \sa MEDCouplingUMesh::simplexize, MEDCoupling1SGTUMesh::sortHexa8EachOther
/*!
- * Implementes \a conversionType 0 for meshes with meshDim = 1, of MEDCouplingUMesh::convertLinearCellsToQuadratic method.
+ * Implements \a conversionType 0 for meshes with meshDim = 1, of MEDCouplingUMesh::convertLinearCellsToQuadratic method.
* \return a newly created DataArrayInt instance that the caller should deal with containing cell ids of converted cells.
* \sa MEDCouplingUMesh::convertLinearCellsToQuadratic.
*/
}
/*!
- * Implementes \a conversionType 0 for meshes with meshDim = 2, of MEDCouplingUMesh::convertLinearCellsToQuadratic method.
+ * Implements \a conversionType 0 for meshes with meshDim = 2, of MEDCouplingUMesh::convertLinearCellsToQuadratic method.
* \return a newly created DataArrayInt instance that the caller should deal with containing cell ids of converted cells.
* \sa MEDCouplingUMesh::convertLinearCellsToQuadratic.
*/
}
/*!
- * Implementes \a conversionType 0 for meshes with meshDim = 3, of MEDCouplingUMesh::convertLinearCellsToQuadratic method.
+ * Implements \a conversionType 0 for meshes with meshDim = 3, of MEDCouplingUMesh::convertLinearCellsToQuadratic method.
* \return a newly created DataArrayInt instance that the caller should deal with containing cell ids of converted cells.
* \sa MEDCouplingUMesh::convertLinearCellsToQuadratic.
*/
private:
void checkUniqueLoc(const std::string& loc) const;
static MCAuto<DataArrayDouble> BuildMeshFromAngleVrille(INTERP_KERNEL::NormalizedCellType gt, const DataArrayDouble *angleDeVrille, const std::string& pfl, const MEDFileFieldLoc& loc, const MEDFileEltStruct4Mesh *zeStr, const MEDFileUMesh *mesh, const MEDFileUMesh *section, const MEDFileFieldGlobsReal *globs);
- static MCAuto<DataArrayDouble> BuildMeshFromEpaisseur(INTERP_KERNEL::NormalizedCellType gt, const DataArrayDouble *thikness, const std::string& pfl, const MEDFileFieldLoc& loc, const MEDFileEltStruct4Mesh *zeStr, const MEDFileUMesh *mesh, const MEDFileUMesh *section, const MEDFileFieldGlobsReal *globs);
+ static MCAuto<DataArrayDouble> BuildMeshFromEpaisseur(INTERP_KERNEL::NormalizedCellType gt, const DataArrayDouble *thickness, const std::string& pfl, const MEDFileFieldLoc& loc, const MEDFileEltStruct4Mesh *zeStr, const MEDFileUMesh *mesh, const MEDFileUMesh *section, const MEDFileFieldGlobsReal *globs);
static MCAuto<DataArrayDouble> BuildMeshPipeSEG3(const DataArrayDouble *angle, const DataArrayDouble *scale, const std::string& pfl, const MEDFileFieldLoc& loc, const MEDFileEltStruct4Mesh *zeStr, const MEDFileUMesh *mesh, const MEDFileUMesh *section, const MEDFileFieldGlobsReal *globs);
static MCAuto<MEDCouplingUMesh> BuildMeshCommon(INTERP_KERNEL::NormalizedCellType gt, const std::string& pfl, const MEDFileFieldLoc& loc, const MEDFileEltStruct4Mesh *zeStr, const MEDFileUMesh *mesh, const MEDFileUMesh *section, const MEDFileFieldGlobsReal *globs, MCAuto<DataArrayDouble>& ptsForLoc);
static MCAuto<DataArrayDouble> BuildMeshFromStructure(INTERP_KERNEL::NormalizedCellType gt, const std::string& pfl, const MEDFileFieldLoc& loc, const MEDFileEltStruct4Mesh *zeStr, const MEDFileUMesh *mesh, const MEDFileUMesh *section, const MEDFileFieldGlobsReal *globs);
return resu;
}
-MCAuto<DataArrayDouble> LocInfo::BuildMeshFromEpaisseur(INTERP_KERNEL::NormalizedCellType gt, const DataArrayDouble *thikness, const std::string& pfl, const MEDFileFieldLoc& loc, const MEDFileEltStruct4Mesh *zeStr, const MEDFileUMesh *mesh, const MEDFileUMesh *section, const MEDFileFieldGlobsReal *globs)
+MCAuto<DataArrayDouble> LocInfo::BuildMeshFromEpaisseur(INTERP_KERNEL::NormalizedCellType gt, const DataArrayDouble *thickness, const std::string& pfl, const MEDFileFieldLoc& loc, const MEDFileEltStruct4Mesh *zeStr, const MEDFileUMesh *mesh, const MEDFileUMesh *section, const MEDFileFieldGlobsReal *globs)
{
MCAuto<DataArrayDouble> ptsForLoc;
MCAuto<MEDCouplingUMesh> geoMesh(BuildMeshCommon(gt,pfl,loc,zeStr,mesh,section,globs,ptsForLoc));
int nbSecPts(section->getNumberOfNodes()),nbCells(geoMesh->getNumberOfCells()),nbg(loc.getGaussWeights().size());
- MCConstAuto<DataArrayDouble> zeThikness;
+ MCConstAuto<DataArrayDouble> zeThickness;
if(!pfl.empty())
{
const DataArrayInt *pflArr(globs->getProfile(pfl));
- zeThikness=thikness->selectByTupleIdSafe(pflArr->begin(),pflArr->end());
+ zeThickness=thickness->selectByTupleIdSafe(pflArr->begin(),pflArr->end());
}
else
- zeThikness.takeRef(thikness);
+ zeThickness.takeRef(thickness);
MCAuto<DataArrayDouble> orthoArr;
{
MCAuto<MEDCouplingFieldDouble> ortho(geoMesh->buildOrthogonalField());
std::vector< MCAuto<DataArrayDouble> > arrs(nbCells*nbg);
for(int j=0;j<nbCells;j++)
{
- double thck(zeThikness->getIJ(j,0)),eccentricity(zeThikness->getIJ(j,1));
+ double thck(zeThickness->getIJ(j,0)),eccentricity(zeThickness->getIJ(j,1));
MCAuto<DataArrayDouble> fact(DataArrayDouble::New()),fact2(DataArrayDouble::New()); fact->alloc(1,nbCompo); fact2->alloc(1,nbCompo);
std::copy(orthoArr->begin()+j*nbCompo,orthoArr->begin()+(j+1)*nbCompo,fact->getPointer());
std::copy(orthoArr->begin()+j*nbCompo,orthoArr->begin()+(j+1)*nbCompo,fact2->getPointer());
/*!
* - \c this->_loc_id mutable attribute is used for elt id in mesh offsets.
- *
+ *
* \param [in] offset the offset id used to take into account that \a result is not compulsory empty in input
* \param [in] entriesOnSameDisc some entries **on same localization** if not the result can be invalid. The _start and _end on them are relative to \a arr parameter.
* \param [in] explicitIdsInMesh ids in mesh of the considered chunk.
}
/*!
- * \param [in,out] globalNum a global numbering counter for the renumbering.
+ * \param [in,out] globalNum a global numbering counter for the renumbering.
* \param [out] its - list of pair (start,stop) kept
* \return bool - false if the type of field \a tof is not contained in \a this.
*/
/*!
* \param [in,out] start - Integer that gives the current position in the final aggregated array
- * \param [in] pms - list of elements to aggregate. integer gives the mesh id
+ * \param [in] pms - list of elements to aggregate. integer gives the mesh id
* \param [in] dts - (Distribution of types) = level 1 : meshes to aggregate. Level 2 : all geo type. Level 3 pair specifying geo type and number of elem in geotype.
* \param [out] extractInfo - Gives information about the where the data comes from. It is a vector of triplet. First element in the triplet the mesh pos. The 2nd one the start pos. The 3rd the end pos.
*/
* \param geomType - element geometry (EGeometrieElement or med_geometrie_element)
* \param nbPoints - nb gauss point
* \param variant - [1-3] to choose the variant of definition
- *
+ *
* Throws in case of invalid parameters
- * variant == 1 refers to "Fonctions de forme et points d'integration
+ * variant == 1 refers to "Fonctions de forme et points d'integration
* des elements finis" v7.4 by J. PELLET, X. DESROCHES, 15/09/05
* variant == 2 refers to the same doc v6.4 by J.P. LEFEBVRE, X. DESROCHES, 03/07/03
* variant == 3 refers to the same doc v6.4, second variant for 2D elements
TInt aNbRef = myRefCoord.size();
for(TInt aRefId = 0; aRefId < aNbRef; aRefId++){
TCoordSlice aCoord = GetCoord(aRefId);
- switch(aRefId){
+ switch(aRefId){
case 0: aCoord[0] = 1.0; aCoord[1] = 0.0; aCoord[2] = 0.0; break;
case 3: aCoord[0] = 0.0; aCoord[1] = 1.0; aCoord[2] = 0.0; break;
case 2: aCoord[0] = -1.0; aCoord[1] = 0.0; aCoord[2] = 0.0; break;
const double P1 = 1./1.8;
const double P2 = 1./1.125;
add( -a, P1 );
- add( 0, P2 );
+ add( 0, P2 );
add( a, P1 ); break;
}
case 4: {
const double P1 = 0.652145154862546, P2 = 0.347854845137454 ;
add( a, P1 );
add( -a, P1 );
- add( b, P2 );
+ add( b, P2 );
add( -b, P2 ); break;
}
default:
case 6: { // FPG6
const double P1 = 0.11169079483905, P2 = 0.0549758718227661;
const double a = 0.445948490915965, b = 0.091576213509771;
- add( b, b, P2 );
+ add( b, b, P2 );
add( 1-2*b, b, P2 );
add( b, 1-2*b, P2 );
add( a, 1-2*a, P1 );
- add( a, a, P1 );
+ add( a, a, P1 );
add( 1-2*a, a, P1 ); break;
}
case 7: { // FPG7
const double B = 0.101286507323456;
const double P1 = 0.066197076394253;
const double P2 = 0.062969590272413;
- add( 1/3., 1/3., 9/80. );
- add( A, A, P1 );
+ add( 1/3., 1/3., 9/80. );
+ add( A, A, P1 );
add( 1-2*A, A, P1 );
add( A, 1-2*A, P1 );
- add( B, B, P2 );
+ add( B, B, P2 );
add( 1-2*B, B, P2 );
add( B, 1-2*B, P2 ); break;
}
const double P1 = 0.025422453185103;
const double P2 = 0.058393137863189;
const double P3 = 0.041425537809187;
- add( A, A, P1 );
+ add( A, A, P1 );
add( 1-2*A, A, P1 );
add( A, 1-2*A, P1 );
- add( B, B, P2 );
+ add( B, B, P2 );
add( 1-2*B, B, P2 );
add( B, 1-2*B, P2 );
add( C, D, P3 );
case 6: {
const double P1 = 0.11169079483905, P2 = 0.0549758718227661;
const double A = 0.445948490915965, B = 0.091576213509771;
- add( 2*B-1, 1-4*B, 4*P2 );
+ add( 2*B-1, 1-4*B, 4*P2 );
add( 2*B-1, 2*B-1, 4*P2 );
add( 1-4*B, 2*B-1, 4*P2 );
add( 1-4*A, 2*A-1, 4*P1 );
- add( 2*A-1, 1-4*A, 4*P1 );
+ add( 2*A-1, 1-4*A, 4*P1 );
add( 2*A-1, 2*A-1, 4*P1 ); break;
}
default:
add( 0., 0., h3, p3 ); break;
}
case 27: { // FPG27
- const double a1 = 0.788073483;
- const double b6 = 0.499369002;
- const double b1 = 0.848418011;
- const double c8 = 0.478508449;
- const double c1 = 0.652816472;
- const double d12 = 0.032303742;
+ const double a1 = 0.788073483;
+ const double b6 = 0.499369002;
+ const double b1 = 0.848418011;
+ const double c8 = 0.478508449;
+ const double c1 = 0.652816472;
+ const double d12 = 0.032303742;
const double d1 = 1.106412899;
double z = 1/2., fz = b1/2*(1 - z);
add( 0., 0., z, a1 ); // 1
THROW_IK_EXCEPTION("TGaussDef: Not all gauss points defined");
}
}
-
+
//================================================================================
/*!
* \brief Return dimension for the given cell type
XDRReader::~XDRReader()
{
-#ifdef HAS_XDR
+#ifdef HAS_XDR
if ( _xdrs_file )
{
xdr_destroy((XDR*)_xdrs);
#ifdef HAS_XDR
#ifdef WIN32
if ((_xdrs_file = ::fopen(_fileName.c_str(), "rb")))
-#else
+#else
if ((_xdrs_file = ::fopen(_fileName.c_str(), "r")))
#endif
{
fld->setValues( valPtr, iSub );
setTS( fld, values, medFields, mesh, iSub++ );
- std::cout << fld->_name << " with compoments";
+ std::cout << fld->_name << " with components";
for ( size_t i = 0; i < (size_t)fld->_sub[iSub-1].nbComponents(); ++i )
std::cout << " " << fld->_sub[iSub-1]._comp_names[ i ];
std::cout << std::endl;
return typp < myTypeEnd ? getDimension( TCellType( typp )) : 4;
}
// END CellsByDimIterator ========================================================
-
fRead=MEDLoader.ReadFieldCell(fname,"mesh",0,f.getName(),-1,-1)
self.assertTrue(f.isEqual(fRead,1e-12,1e-12))
pass
-
+
def testMultiMeshTypeWrite1(self):
fname="Pyfile74.med"
m=MEDLoader.MEDCoupling1SGTUMesh("mesh",MEDLoader.NORM_QUAD4) ; m.allocateCells()
self.assertTrue(f3.isEqual(MEDLoader.ReadField(MEDLoader.ON_CELLS,fname,"mesh",0,"field2",4,5),1e-12,1e-12))
self.assertRaises(Exception,MEDLoader.ReadField,MEDLoader.ON_CELLS,fname,"mesh",0,"field2",5,5) # invalid time step
pass
-
+
pass
if __name__ == "__main__":
self.assertTrue(v.isEqual(vExp,1e-12))
pass
pass
-
+
def test5(self):
""" This test plays with profiles both cell profiles and node profiles. Two first fields (resp on cells and on nodes) lie on the same mesh support whereas the third
mesh lies on a different mesh.
self.assertTrue(v.isEqual(vExp,1e-12))
pass
pass
-
+
def test6(self):
""" This test plays with cartesian mesh and profiles. When a sub cartesian mesh can also be considered as a cartesian mesh it is done.
"""
vExp=DataArrayDouble(15*2) ; vExp.iota(400+i*1000) ; vExp.rearrange(2) ; vExp.setInfoOnComponents(['Comp1_4 [m]','Com2_4 [s^2]'])
self.assertTrue(v.isEqual(vExp,1e-12))
pass
-
+
fcscp=allFMTSLeavesPerCommonSupport[1][1]
mml=fcscp.buildFromScratchDataSetSupport(0,fields)
mml2=mml.prepare()
self.assertTrue(isinstance(mml2,MEDCMeshMultiLev)) # here the 2nd support is a part of CMesh that is also a CMesh -> CMesh not a UMesh
(a,b),c=mml2.buildVTUArrays()
- self.assertTrue(not c)# c is False because this a sub support specialy built for buildVTUArrays
+ self.assertTrue(not c)# c is False because this a sub support specially built for buildVTUArrays
self.assertTrue(a.isEqual(coordsX[[2,3,4]],1e-12))
self.assertTrue(b.isEqual(coordsY,1e-12))
a6,a7=mml2.retrieveFamilyIdsOnCells()
self.assertTrue(v.isEqual(vExp,1e-12))
pass
pass
-
+
def test10(self):
""" This test plays with fields only on nodes containing profiles.
"""
self.assertTrue(v.isEqual(vExp,1e-12))
pass
pass
-
+
def test11(self):
""" This test is the ultimate test for the profiles with gauss points. It tests that even if there is non contiguous parts in definition of gauss points, it works !
WARNING here, as no other discretizations exists, the priority is given to the field -> the mesh is renumbered to accelerate the build of array of field.
self.assertTrue(v.isEqual(vExp1[i],1e-12))
pass
pass
-
+
def test18(self):
""" First test on GAUSS_PT. Here no Profiles. 2 times steps.
"""
self.assertTrue(v.isEqual(vExp1[i],1e-12))
pass
pass
-
+
def test19(self):
"""
This test is a simple non profile CELL field but lying on cells of dimension -1 (not 0 as "usual").
m0=m.buildUnstructured() ; del m
m1=m0.computeSkin()
#
- mm=MEDFileUMesh()
+ mm=MEDFileUMesh()
mm.setMeshAtLevel(0,m0)
mm.setMeshAtLevel(-1,m1)
ff=MEDFileFieldMultiTS()
self.assertEqual(v.getHiddenCppPointer(),f.getUndergroundDataArray().getHiddenCppPointer())
vExp=DataArrayDouble(9) ; vExp.iota() ; vExp.setInfoOnComponents(["zeInfo"]) ; vExp.reverse()
self.assertTrue(v.isEqual(vExp,1e-12))
- pass
-
+ pass
+
def test23(self):
""" Non regression test 2219 of modes. Idem than test22 except that here the node field is on profile.
"""
self.assertTrue(v.isEqual(myarr,1e-12))
pass
pass
-
+
def test33(self):
"""Non regression test concerning polygons. Thanks Adrien. This bug can't be shown by simply reading an displaying a MED file containing only polygons. A filter must be applied on it to show it. The a2 array was responsible of that bug."""
fname="ForMEDReader33.med"
arr1=DataArrayDouble(nx*nx) ; arr1.iota() ; arr1+=100 ; f1.setArray(arr1)
ff1=MEDFileField1TS() ; ff1.setFieldNoProfileSBT(f1)
ff0.write(fname,0) ; ff1.write(fname,0)
- #
+ #
a=8 ; b=16
ms=MEDFileMeshes()
mm=MEDFileUMesh.LoadPartOf(fname,meshName,[NORM_QUAD4],[a,b,1],-1,-1)
fields=MEDFileFields() ; fields.pushField(fmts)
ms.write(fname,2) ; fields.write(fname,0)
#
- ms=MEDFileMeshes(fname)
+ ms=MEDFileMeshes(fname)
fields=MEDFileFields(fname,False)
fields.removeFieldsWithoutAnyTimeStep()
fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
self.assertEqual(v.getHiddenCppPointer(),ffCell.getUndergroundDataArray().getHiddenCppPointer())
self.assertTrue(v.isEqual(DataArrayDouble([0.0]),1e-14))
pass
-
+
pass
if __name__ == "__main__":
(=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
+ 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).
+ 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.
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 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 :
+ This example illustrates the sending of a field with
+ the \c StructuredCoincidentDEC :
\code
...
StructuredCoincidentDEC dec(groupA, groupB);
_send_counts(0),_recv_counts(0),
_send_displs(0),_recv_displs(0),
_recv_buffer(0),_send_buffer(0)
- {
+ {
}
_topo_source = dynamic_cast<BlockTopology*>(_local_field->getTopology());
if (_target_group->containsMyRank())
_topo_target = dynamic_cast<BlockTopology*>(_local_field->getTopology());
-
- // Transmitting source topology to target code
+
+ // Transmitting source topology to target code
broadcastTopology(_topo_source,1000);
// Transmitting target topology to source code
broadcastTopology(_topo_target,2000);
}
/*! Creates the arrays necessary for the data transfer
- * and fills the send array with the values of the
+ * and fills the send array with the values of the
* source field
* */
void StructuredCoincidentDEC::prepareSourceDE()
{
////////////////////////////////////
- //Step 1 : _buffer array creation
-
+ //Step 1 : _buffer array creation
+
if (!_topo_source->getProcGroup()->containsMyRank())
return;
MPIProcessorGroup* group=new MPIProcessorGroup(_topo_source->getProcGroup()->getCommInterface());
-
+
int myranksource = _topo_source->getProcGroup()->myRank();
-
+
vector <int>* target_arrays=new vector<int>[_topo_target->getProcGroup()->size()];
-
+
//cout<<" topotarget size"<< _topo_target->getProcGroup()->size()<<endl;
-
+
int nb_local = _topo_source-> getNbLocalElements();
for (int ielem=0; ielem< nb_local ; ielem++)
{
- // cout <<"source local :"<<myranksource<<","<<ielem<<endl;
+ // cout <<"source local :"<<myranksource<<","<<ielem<<endl;
int global = _topo_source->localToGlobal(make_pair(myranksource, ielem));
// cout << "global "<<global<<endl;
pair<int,int> target_local =_topo_target->globalToLocal(global);
- // cout << "target local : "<<target_local.first<<","<<target_local.second<<endl;
- target_arrays[target_local.first].push_back(target_local.second);
- }
-
+ // cout << "target local : "<<target_local.first<<","<<target_local.second<<endl;
+ target_arrays[target_local.first].push_back(target_local.second);
+ }
+
int union_size=group->size();
-
+
_send_counts=new int[union_size];
_send_displs=new int[union_size];
_recv_counts=new int[union_size];
_recv_displs=new int[union_size];
-
+
for (int i=0; i< union_size; i++)
{
_send_counts[i]=0;
_recv_displs[i]=0;
}
_send_displs[0]=0;
-
+
for (int iproc=0; iproc < _topo_target->getProcGroup()->size(); iproc++)
{
//converts the rank in target to the rank in union communicator
int unionrank=group->translateRank(_topo_target->getProcGroup(),iproc);
_send_counts[unionrank]=target_arrays[iproc].size();
}
-
+
for (int iproc=1; iproc<group->size();iproc++)
_send_displs[iproc]=_send_displs[iproc-1]+_send_counts[iproc-1];
-
+
_send_buffer = new double [nb_local ];
/////////////////////////////////////////////////////////////
- //Step 2 : filling the _buffers with the source field values
+ //Step 2 : filling the _buffers with the source field values
int* counter=new int [_topo_target->getProcGroup()->size()];
- counter[0]=0;
+ counter[0]=0;
for (int i=1; i<_topo_target->getProcGroup()->size(); i++)
counter[i]=counter[i-1]+target_arrays[i-1].size();
-
-
+
+
const double* value = _local_field->getField()->getArray()->getPointer();
//cout << "Nb local " << nb_local<<endl;
for (int ielem=0; ielem<nb_local ; ielem++)
//cout <<"global : "<< global<<" local :"<<target_local.first<<" "<<target_local.second;
//cout <<"counter[]"<<counter[target_local.first]<<endl;
_send_buffer[counter[target_local.first]++]=value[ielem];
-
+
}
delete[] target_arrays;
delete[] counter;
if (!_topo_target->getProcGroup()->containsMyRank())
return;
MPIProcessorGroup* group=new MPIProcessorGroup(_topo_source->getProcGroup()->getCommInterface());
-
+
int myranktarget = _topo_target->getProcGroup()->myRank();
-
+
vector < vector <int> > source_arrays(_topo_source->getProcGroup()->size());
int nb_local = _topo_target-> getNbLocalElements();
for (int ielem=0; ielem< nb_local ; ielem++)
{
- // cout <<"TS target local :"<<myranktarget<<","<<ielem<<endl;
+ // cout <<"TS target local :"<<myranktarget<<","<<ielem<<endl;
int global = _topo_target->localToGlobal(make_pair(myranktarget, ielem));
//cout << "TS global "<<global<<endl;
pair<int,int> source_local =_topo_source->globalToLocal(global);
- // cout << "TS source local : "<<source_local.first<<","<<source_local.second<<endl;
- source_arrays[source_local.first].push_back(source_local.second);
- }
+ // cout << "TS source local : "<<source_local.first<<","<<source_local.second<<endl;
+ source_arrays[source_local.first].push_back(source_local.second);
+ }
int union_size=group->size();
_recv_counts=new int[union_size];
_recv_displs=new int[union_size];
_send_counts=new int[union_size];
_send_displs=new int[union_size];
-
+
for (int i=0; i< union_size; i++)
{
_send_counts[i]=0;
for (int i=1; i<union_size; i++)
_recv_displs[i]=_recv_displs[i-1]+_recv_counts[i-1];
_recv_buffer=new double[nb_local];
-
+
delete group;
}
-
+
/*!
- * Synchronizing a topology so that all the
+ * Synchronizing a topology so that all the
* group possesses it.
- *
+ *
* \param topo Topology that is transmitted. It is read on processes where it already exists, and it is created and filled on others.
* \param tag Communication tag associated with this operation.
*/
void StructuredCoincidentDEC::broadcastTopology(BlockTopology*& topo, int tag)
{
MPI_Status status;
-
+
int* serializer=0;
int size;
-
+
MPIProcessorGroup* group=new MPIProcessorGroup(*_comm_interface);
-
+
// The master proc creates a send buffer containing
// a serialized topology
int rank_master;
-
+
if (topo!=0 && topo->getProcGroup()->myRank()==0)
{
MESSAGE ("Master rank");
_comm_interface->recv(&rank_master, 1,MPI_INT, MPI_ANY_SOURCE, tag+group->myRank(), *(group->getComm()),&status);
MESSAGE(" rank "<<group->myRank()<< "received master rank"<<rank_master);
}
- // The topology is broadcasted to all processsors in the group
+ // The topology is broadcasted to all processors in the group
_comm_interface->broadcast(&size, 1,MPI_INT,rank_master,*(group->getComm()));
-
+
int* buffer=new int[size];
if (topo!=0 && topo->getProcGroup()->myRank()==0)
- copy(serializer, serializer+size, buffer);
+ copy(serializer, serializer+size, buffer);
_comm_interface->broadcast(buffer,size,MPI_INT,rank_master,*(group->getComm()));
-
- // Processors which did not possess the source topology
+
+ // Processors which did not possess the source topology
// unserialize it
-
+
BlockTopology* topotemp=new BlockTopology();
topotemp->unserialize(buffer, *_comm_interface);
-
- if (topo==0)
+
+ if (topo==0)
topo=topotemp;
- else
+ else
delete topotemp;
-
+
// Memory cleaning
delete[] buffer;
if (serializer!=0)
for (int i=0; i< 4; i++)
cout << _recv_displs[i]<<" ";
cout <<endl;
-
+
cout<<"start AllToAll"<<endl;
MPI_Comm comm = *(dynamic_cast<MPIProcessorGroup*>(_union_group)->getComm());
- _comm_interface->allToAllV(_send_buffer, _send_counts, _send_displs, MPI_DOUBLE,
+ _comm_interface->allToAllV(_send_buffer, _send_counts, _send_displs, MPI_DOUBLE,
_recv_buffer, _recv_counts, _recv_displs, MPI_DOUBLE,comm);
cout<<"end AllToAll"<<endl;
int nb_local = _topo_target->getNbLocalElements();
//double* value=new double[nb_local];
double* value=const_cast<double*>(_local_field->getField()->getArray()->getPointer());
-
+
int myranktarget=_topo_target->getProcGroup()->myRank();
vector<int> counters(_topo_source->getProcGroup()->size());
counters[0]=0;
counters[i+1]=counters[i]+_recv_counts[worldrank];
delete group;
}
-
+
for (int ielem=0; ielem<nb_local ; ielem++)
{
int global = _topo_target->localToGlobal(make_pair(myranktarget, ielem));
pair<int,int> source_local =_topo_source->globalToLocal(global);
value[ielem]=_recv_buffer[counters[source_local.first]++];
}
-
-
+
+
//_local_field->getField()->setValue(value);
}
cout <<endl;
cout <<"start AllToAll"<<endl;
MPI_Comm comm = *(dynamic_cast<MPIProcessorGroup*>(_union_group)->getComm());
- _comm_interface->allToAllV(_send_buffer, _send_counts, _send_displs, MPI_DOUBLE,
+ _comm_interface->allToAllV(_send_buffer, _send_counts, _send_displs, MPI_DOUBLE,
_recv_buffer, _recv_counts, _recv_displs, MPI_DOUBLE,comm);
cout<<"end AllToAll"<<endl;
}
/*! Prepares a DEC for data exchange
- This method broadcasts the topologies from source to target
+ This method broadcasts the topologies from source to target
so that the target side can analyse from which processors it
- is expected to receive data.
+ is expected to receive data.
*/
-
+
void StructuredCoincidentDEC::synchronize()
{
if (_source_group->containsMyRank())
}
}
}
-