From 06bee9bac5bd383683cb22fc35535ddcf8cc4e9c Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 12 Mar 2013 13:56:25 +0000 Subject: [PATCH] 0021856: [CEA 663] Documenting API of MEDCoupling and MEDLoader Some typos and decoration +\section MEDCouplingArrayFill Filling DataArray with values --- doc/doxygen/medcoupling.dox | 43 ++++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/doc/doxygen/medcoupling.dox b/doc/doxygen/medcoupling.dox index 6c49ae303..167a3d3bb 100644 --- a/doc/doxygen/medcoupling.dox +++ b/doc/doxygen/medcoupling.dox @@ -227,23 +227,22 @@ It will be presented in this section common concept shared by the two classes to A \ref ParaMEDMEM::DataArray "DataArray" instance has an attribute **name**. **name** is particulary useful for \ref ParaMEDMEM::DataArray "DataArray" representing profiles, families, groups, fields in MEDLoader. -But excepted these useful usecases, **name** attribute is often ignored when \ref ParaMEDMEM::DataArray "DataArrays" are aggregated (field array, connectivity, coordinates) is a bigger object. -Whatever the useage of the **name** attribute of \ref ParaMEDMEM::DataArray "DataArrays", all methods in ParaMEDMEM::DataArrayDouble and ParaMEDMEM::DataArrayInt class deal with **name** as they do for components names. +But excepted these useful usecases, **name** attribute is often ignored when \ref ParaMEDMEM::DataArray "DataArrays" are aggregated (field array, connectivity, coordinates) in a bigger object. +Whatever the usage of the **name** attribute of \ref ParaMEDMEM::DataArray "DataArrays", all methods in ParaMEDMEM::DataArrayDouble and ParaMEDMEM::DataArrayInt class deal with **name** as they do for components names. \subsection MEDCouplingArrayBasicsTuplesAndCompo Raw data, tuples and components of DataArrays. The main goal of \ref ParaMEDMEM::DataArray "DataArray" is to store contiguous vector of atomical elements with same basic datatype (signed integers, double precision...). This vector of atomical elements is called **raw data** of \ref ParaMEDMEM::DataArray "DataArray". -The size of this vector of data is called, number of elements. So the number of bytes stored by a \ref ParaMEDMEM::DataArray "DataArray" instance, is equal to +The size of this vector of data is called "number of elements". So the number of bytes stored by a \ref ParaMEDMEM::DataArray "DataArray" instance, is equal to the product of the __number of elements__ * __constant size of DataType__ . -As \ref ParaMEDMEM::DataArray "DataArray" instances are designed to stored vector fields, tensor fields, coordinate of nodes, the notion of components has been -added. +As \ref ParaMEDMEM::DataArray "DataArray" instances are designed to store vector fields, tensor fields, coordinate of nodes, the notion of _components_ has been added. So, \ref ParaMEDMEM::DataArray "DataArrays" have an additional attribute that is number of components that represent the size of a contiguous set of atomical elements. -The vector of atomical elements stored into \ref ParaMEDMEM::DataArray "DataArrays" are grouped in contiguous in memory set of atomical elements having each same size. +The vector of atomical elements stored into \ref ParaMEDMEM::DataArray "DataArrays" are grouped in contiguous memory set of atomical elements having each same size. -The contiguous set of atomical elements is called **tuple**. And each **tuple** stored in raw data, have each a length exactly equal to the number of components of +The contiguous set of atomical elements is called **tuple**. And each **tuple** stored in raw data, have each a length exactly equal to the number of components of \ref ParaMEDMEM::DataArray "DataArray" storing it. Thus : @@ -256,8 +255,8 @@ Thus : N_{bytes}=N_{elements}*sizeof(DataType)=N_{tuples}*N_{components}*sizeof(DataType). \f] -In another words, **raw data** of \ref ParaMEDMEM::DataArray "DataArrays" can be seen as a dense matrix, whose number of components would be the row size and number of tuples -would be the column size. In this point of view of \ref ParaMEDMEM::DataArray "DataArrays" a **tuple** is represented by the corresponding row in the dense matrix. +In other words, **raw data** of \ref ParaMEDMEM::DataArray "DataArrays" can be seen as a dense matrix, whose number of components would be the row size and number of tuples +would be the column size. In this point of view of \ref ParaMEDMEM::DataArray "DataArrays" a **tuple** is represented by the corresponding row in the dense matrix. Typically in the **raw data** of \ref ParaMEDMEM::DataArray "DataArrays" **number of tuples** is highly bigger than **number of components** ! @@ -324,7 +323,8 @@ An another way is to do that : \section MEDCouplingArraySteps1 Building an array from scratch in C++ -Here a description of typical usages to use \ref ParaMEDMEM::DataArrayDouble "MEDCoupling arrays".\n +Here is a description of typical usages of \ref ParaMEDMEM::DataArrayDouble "MEDCoupling arrays". + In this example we will create arrays with 12 tuples constituted each of 3 components. These arrays will be created using different ways.\n @@ -436,6 +436,20 @@ There are two types of comparison : - ParaMEDMEM::DataArrayInt::isEqualWithoutConsideringStr - ParaMEDMEM::DataArrayDouble::isEqualWithoutConsideringStr +\section MEDCouplingArrayFill Filling DataArray with values + +Both DataArrayDouble and DataArrayInt provide comfort methods that +fill the array with some values. These methods are: +- ParaMEDMEM::DataArrayInt::fillWithZero and + ParaMEDMEM::DataArrayDouble::fillWithZero which assigns zero to all + values in array. +- ParaMEDMEM::DataArrayInt::fillWithValue and + ParaMEDMEM::DataArrayDouble::fillWithValue which assigns a certain value to all + values in array. +- ParaMEDMEM::DataArrayInt::iota() and + ParaMEDMEM::DataArrayDouble::iota() which assigns incrementing values to all + values in array. + \section MEDCouplingArrayRenumbering Array renumbering Here is presented all it is necessary to know concerning renumbering. @@ -497,6 +511,9 @@ Method in new to old mode that works on bijective applications : Method in new to old mode that works on surjective applications : - \ref ParaMEDMEM::DataArrayDouble::selectByTupleId "DataArrayDouble::selectByTupleId" +- \ref ParaMEDMEM::DataArrayDouble::selectByTupleIdSafe "DataArrayDouble::selectByTupleIdSafe" +- \ref ParaMEDMEM::DataArrayDouble::selectByTupleId2 "DataArrayDouble::selectByTupleId2" +- \ref ParaMEDMEM::DataArrayDouble::selectByTupleRanges "DataArrayDouble::selectByTupleRanges" \section MEDCouplingArrayApplyFunc Application of a function on DataArrayDouble instances. @@ -729,9 +746,9 @@ and 9 nodes. You can notice that it is possible to mix cell types as long as the dimension of cell is exactly equal to meshDim to respect \ref MEDCouplingMeshes "this rule". -\subpage medcouplingcppexamplesUmeshStdBuild1 "Here the C++ implementation." +\subpage medcouplingcppexamplesUmeshStdBuild1 "Here is the C++ implementation." -\subpage medcouplingpyexamplesUmeshStdBuild1 "Here the Python implementation." +\subpage medcouplingpyexamplesUmeshStdBuild1 "Here is the Python implementation." \section MEDCouplingUMeshNodalConnectivity How MEDCouplingUMesh stores its nodal connectivity. @@ -856,4 +873,4 @@ The usage is simple : The virtual call to ParaMEDMEM::TimeLabel::updateTime change the behaviour of ParaMEDMEM::TimeLabel::getTimeOfThis it is a bug, so please notify the bug into the salome forum. -*/ \ No newline at end of file +*/ -- 2.39.2