--- /dev/null
+/*!
+\page medcouplingcppexamples MEDCoupling C++ examples
+
+\section ExamplesFields Fields
+
+\subsection ExamplesFieldsCreate Create
+
+\subsubsection medcouplingcppexamplesFieldDoubleBuild1 Standard build of a tensor field on cells with no time attached
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippetFieldDoubleBuild1_1
+
+
+\subsubsection medcouplingcppexamplesFieldDoubleBuild2 Standard build of a scalar field on nodes with no time attached
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippetFieldDoubleBuild2_1
+
+
+\subsubsection medcouplingcppexamplesFieldDoubleBuild3 Standard build of a vector field on cells with one time attached and no time interval
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippetFieldDoubleBuild3_1
+
+
+\subsubsection medcouplingcppexamplesFieldDoubleBuild4 Standard build of a vector field on nodes defined on a time interval with a constant value during this interval
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippetFieldDoubleBuild4_1
+
+
+\subsubsection cpp_mcfielddouble_MaxFields Getting maximal and minimal fields
+
+In this example we
+- create two fields with two tuples per two components,
+- use
+\ref ParaMEDMEM::MEDCouplingFieldDouble::MaxFields "MaxFields()"
+to get a field holding maximal values of the two fields.
+- use
+\ref ParaMEDMEM::MEDCouplingFieldDouble::MinFields "MinFields()"
+to get a field holding minimal values of the two fields.
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_MaxFields_1
+
+
+\subsubsection cpp_mcfielddouble_MergeFields Concatenating fields
+
+In this example we
+- create an 1D mesh and a field on it,
+- make a deep copy of the mesh and the field,
+- translate the mesh and the field,
+- use two variants of
+\ref ParaMEDMEM::MEDCouplingFieldDouble::MergeFields "MergeFields()"
+to create one field from the two by concatenating them and their meshes.
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_MergeFields_1
+The result field is twice "longer" than \b field1.
+
+
+\subsubsection cpp_mcfielddouble_buildNewTimeReprFromThis Getting a field copy with different time discretization
+
+First, we create a supporting 2D mesh and a field on it got using
+\ref ParaMEDMEM::MEDCouplingFieldDouble::fillFromAnalytic "fillFromAnalytic()".
+\ref MEDCouplingTemporalDisc "Time discretization" of this field is
+\ref ParaMEDMEM::ONE_TIME "ONE_TIME".
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_buildNewTimeReprFromThis_1
+Now we use
+\ref ParaMEDMEM::MEDCouplingFieldDouble::buildNewTimeReprFromThis "buildNewTimeReprFromThis()"
+to get a copy of \b field1 whose time discretization is
+\ref ParaMEDMEM::NO_TIME "NO_TIME".
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_buildNewTimeReprFromThis_2
+
+
+\subsubsection cpp_mcmesh_fillFromAnalytic3 Creating a field using an expression
+
+First, we create a 2D Cartesian mesh constituted by 2 cells.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingMesh_fillFromAnalytic3_1
+Now we use
+\ref ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic3 "fillFromAnalytic3()"
+to get a \ref ParaMEDMEM::MEDCouplingFieldDouble "MEDCouplingFieldDouble" on cells filled
+with values computed using an expression \b func. This expression is applied to coordinates of
+each point (barycenter) for which the field value is computed. We want to get the
+field on cells, with 3 components computed as follows. (In \b func, we refer to the
+first component of a point using the variable "a", and to the second component, using
+the variable "b").
+- Component #0 = the second coordinate of the point hence "IVec * b" in \b func.
+- Component #1 = the first coordinate of the point hence "JVec * a".
+- Component #2 = distance between the point and SC origin (0.,0.) hence
+"KVec * sqrt( a*a + b*b )".
+
+In addition we want to add 10.0 to each component computed as described above, hence
+"10" in \b func.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingMesh_fillFromAnalytic3_2
+Now we ascertain that the result field is as we expect. We check the second tuple of
+the \b field. We get barycenter of the cell #1 and checks that values of the second
+tuple are computed as we want.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingMesh_fillFromAnalytic3_3
+
+
+\subsubsection cpp_mcmesh_fillFromAnalytic2 Creating a field using an expression
+
+First, we create a 2D Cartesian mesh constituted by 2 cells.
+Note that we set names to coordinates arrays ("a" and "b" ) which will be used to refer to
+corresponding coordinates within a function.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingMesh_fillFromAnalytic2_1
+Now we use
+\ref ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic2 "fillFromAnalytic2()"
+to get a \ref ParaMEDMEM::MEDCouplingFieldDouble "MEDCouplingFieldDouble" on cells filled
+with values computed using an expression \b func. This expression is applied to coordinates of
+each point (barycenter) for which the field value is computed. We want to get the
+field on cells, with 3 components computed as follows. (In \b func, we refer to the
+first component of a point using the variable "a", and to the second component, using
+the variable "b").
+- Component #0 = the second coordinate of the point hence "IVec * b" in \b func.
+- Component #1 = the first coordinate of the point hence "JVec * a".
+- Component #2 = distance between the point and SC origin (0.,0.) hence
+"KVec * sqrt( a*a + b*b )".
+
+In addition we want to add 10.0 to each component computed as described above, hence
+"10" in \b func.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingMesh_fillFromAnalytic2_2
+Now we ascertain that the result field is as we expect. We check the second tuple of
+the \b field. We get barycenter of the cell #1 and checks that values of the second
+tuple are computed as we want.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingMesh_fillFromAnalytic2_3
+
+
+\subsubsection cpp_mcmesh_fillFromAnalytic Creating a field using an expression
+
+First, we create a 2D Cartesian mesh constituted by 2 cells.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingMesh_fillFromAnalytic_1
+Now we use
+\ref ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic "fillFromAnalytic()"
+to get a \ref ParaMEDMEM::MEDCouplingFieldDouble "MEDCouplingFieldDouble" on cells filled
+with values computed using an expression \b func. This expression is applied to coordinates of
+each point (barycenter) for which the field value is computed. We want to get the
+field on cells, with 3 components computed as follows. (In \b func, we refer to the
+first component of a point using the variable "a", and to the second component, using
+the variable "b").
+- Component #0 = the second coordinate of the point hence "IVec * b" in \b func.
+- Component #1 = the first coordinate of the point hence "JVec * a".
+- Component #2 = distance between the point and SC origin (0.,0.) hence
+"KVec * sqrt( a*a + b*b )".
+
+In addition we want to add 10.0 to each component computed as described above, hence
+"10" in \b func.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingMesh_fillFromAnalytic_2
+Now we ascertain that the result field is as we expect. We check the second tuple of
+the \b field. We get barycenter of the cell #1 and checks that values of the second
+tuple are computed as we want.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingMesh_fillFromAnalytic_3
+
+
+\subsubsection cpp_mcfielddouble_subpart1 Creation of a sub part of a field
+
+<br><h3>Creation of a sub part of a field on cells</h3>
+\snippet MEDCouplingExamplesTest.cxx CppSnippetFieldDoubleBuildSubPart1_1
+The field on cells \b f1 lies on a mesh containing 5 cells and 9 nodes.
+So this field \b f1 contains 5 tuples of 2 components each (10 values).
+Now let's create a subfield on cells \b f2 from \b f1.
+\snippet MEDCouplingExamplesTest.cxx CppSnippetFieldDoubleBuildSubPart1_2
+
+\b f1 is a field on cells, \ref ParaMEDMEM::MEDCouplingFieldDouble::buildSubPart "buildSubPart" method performs an extraction on cells too.
+
+So the array \b part1 lists ids on cells.
+
+- cell #0 of \b f2 is the same cell of cell #2 of \b f1
+- cell #1 of \b f2 is the same cell of cell #1 of \b f1
+- cell #2 of \b f2 is the same cell of cell #4 of \b f1
+
+So \b f2 contains 3 tuples with 2 components.
+
+The underlying mesh of \b f2 contains a newly created mesh with 3 cells (not as \b mesh1 in \b f1) and 9 nodes (as \b mesh1 in \b f1).
+\n For fields on cells the number of tuples of the returned field is always equal to the number of ids given in input (here \b part1).
+\nOnly fields on cells have this particular behaviour.
+
+<br><h3>Creation of a sub part of a field on nodes</h3>
+\snippet MEDCouplingExamplesTest.cxx CppSnippetFieldDoubleBuildSubPart1_3
+The field on nodes \b f1 lies on a mesh containing 5 cells and 9 nodes.
+So this field \b f1 contains 9 tuples of 2 components each (18 values).
+Now let's create a subfield on nodes \b f2 from \b f1.
+\snippet MEDCouplingExamplesTest.cxx CppSnippetFieldDoubleBuildSubPart1_4
+
+\b f1 is a field on nodes, but \ref ParaMEDMEM::MEDCouplingFieldDouble::buildSubPart "buildSubPart" method performs an extraction on \b cells.
+
+After the call of \ref ParaMEDMEM::MEDCouplingFieldDouble::buildSubPart "buildSubPart" on node field \b f1, \b f1 will be reduced on a
+submesh of \b mesh1 containing cells whose ids are in \b part2. So here the number of cells of \b f2 is 2 and the number of nodes is 4.
+\nSo contrary to fields on cells, it is normal for fields on nodes that number of tuples of the returned field of \ref ParaMEDMEM::MEDCouplingFieldDouble::buildSubPart "buildSubPart"
+method does not match the size of the input array (here \b part2).
+
+
+\subsection ExamplesFieldsModify Modify
+
+\subsubsection cpp_mcfielddouble_substractInPlaceDM Subtracting field on different meshes
+
+We make two meshes in 1D space with no cells and 4 nodes. Nodes #0 and #2 are swapped
+in the two meshes.<br>
+And we make two fields on these meshes, so that fields values to equal to node
+coordinates of the underlying meshes.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_substractInPlaceDM_1
+We are going to subtract \b field2 from \b field1, though they are on
+different meshes.
+\ref ParaMEDMEM::MEDCouplingFieldDouble::substractInPlaceDM "substractInPlaceDM()"
+allows us doing this. We use a mesh comparison level \b levOfCheck = 10 that allows
+subtracting fields on meshes with different node arrays.<br>
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_substractInPlaceDM_2
+After applying
+\ref ParaMEDMEM::MEDCouplingFieldDouble::substractInPlaceDM "substractInPlaceDM()"
+the both fields lie on \b mesh2. As
+\ref ParaMEDMEM::MEDCouplingFieldDouble::substractInPlaceDM "substractInPlaceDM()"
+permutes values of \b field1 before value subtraction, and thus \b field1 becomes
+equal to \b field2, hence their subtraction results in a zero field.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_substractInPlaceDM_3
+
+
+\subsubsection cpp_mcfielddouble_changeUnderlyingMesh Changing the underlying mesh
+
+We make two meshes in 1D space with no cells and 4 nodes. Nodes #0 and #2 are swapped
+in the two meshes.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_changeUnderlyingMesh_1
+We are going to use
+\ref ParaMEDMEM::MEDCouplingFieldDouble::changeUnderlyingMesh "changeUnderlyingMesh()"
+to set \b mesh2 instead of \b mesh1 as a support of a field. <br>
+We use
+\ref ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic "fillFromAnalytic()"
+to make a field on nodes of \b mesh1, so that its values to equal to node coordinates.
+Then we use
+\ref ParaMEDMEM::MEDCouplingFieldDouble::changeUnderlyingMesh "changeUnderlyingMesh()"
+to change the underlying mesh of the \b field.
+(We use a mesh comparison level \b levOfCheck = 10 that allows substituting meshes with
+different node arrays.) As a result, we expect that values of the \b field are also
+permuted same as nodes of the two meshes, and thus its values become equal to the
+array \b coords2.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_changeUnderlyingMesh_2
+
+
+\subsubsection cpp_mcfielddouble_applyFunc_same_nb_comp Changing a field using an expression
+
+We create a 2D vector field with 2 tuples and we want to transform this
+field using an expression using
+\ref ParaMEDMEM::MEDCouplingFieldDouble::applyFunc(const char *func) "applyFunc()".
+The expression \b func is applied to each atomic value of the \b field. We want to change
+the \b field as follows. (In \b func, we use the variable "v" to refer to an atomic field value).
+- Component #0 = component #0 (remains the same) hence "IVec * v" in \b func.
+- Component #1 = component #1 ^ 2 hence "JVec * v*v".
+
+In addition we want to add 10.0 to each component computed as described above, hence
+"10" in \b func.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_applyFunc_same_nb_comp_1
+Now we ascertain that the result field is as we expect.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_applyFunc_same_nb_comp_2
+
+
+\subsubsection cpp_mcfielddouble_applyFunc3 Changing a field using an expression
+
+We create a 2D vector field with 2 values (vectors) and then we transform this
+field into a 3D vector field by applying an expression to values of the 2D field
+using
+\ref ParaMEDMEM::MEDCouplingFieldDouble::applyFunc3() "applyFunc3()".
+The expression \b func is applied to components of each vector of the \b field. We want
+the \b field to have 3 components computed as follows. (In \b func, we refer to the
+first component of a field value using the variable "a", and to the second component, using
+the variable "b", as we define it by \b varNamesVec).
+- Component #0 = the second vector component hence "IVec * b" in \b func.
+- Component #1 = the first vector component hence "JVec * a".
+- Component #2 = a vector magnitude hence "KVec * sqrt( a*a + b*b )".
+
+In addition we want to add 10.0 to each component computed as described above, hence
+"10" in \b func.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_applyFunc3_1
+Now we ascertain that the result field is as we expect. We check the second vector of
+the \b field.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_applyFunc3_2
+
+
+\subsubsection cpp_mcfielddouble_applyFunc2 Changing a field using an expression
+
+We create a 2D vector field with 2 values (vectors) and then we transform this
+field into a 3D vector field by applying an expression to values of the 2D field
+using
+\ref ParaMEDMEM::MEDCouplingFieldDouble::applyFunc2(int nbOfComp, const char *func) "applyFunc2()".
+Note that we set component info the \b array ("a" and "b" ) which will be used to refer to
+corresponding components within a function.
+The expression \b func is applied to components of each vector of the \b field. We want
+the \b field to have 3 components computed as follows. (In \b func, we refer to the
+first component of a field value using the variable "a", and to the second component, using
+the variable "b").
+- Component #0 = the second vector component hence "IVec * b" in \b func.
+- Component #1 = the first vector component hence "JVec * a".
+- Component #2 = a vector magnitude hence "KVec * sqrt( a*a + b*b )".
+
+In addition we want to add 10.0 to each component computed as described above, hence
+"10" in \b func.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_applyFunc2_1
+Now we ascertain that the result field is as we expect. We check the second vector of
+the \b field.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_applyFunc2_2
+
+
+\subsubsection cpp_mcfielddouble_applyFunc Changing a field using an expression
+
+We create a 2D vector field with 2 values (vectors) and then we transform this
+field into a 3D vector field by applying an expression to values of the 2D field
+using
+\ref ParaMEDMEM::MEDCouplingFieldDouble::applyFunc(int nbOfComp, const char *func) "applyFunc()".
+The expression \b func is applied to components of each vector of the \b field. We want
+the \b field to have 3 components computed as follows. (In \b func, we refer to the
+first component of a field value using the variable "a", and to the second component, using
+the variable "b").
+- Component #0 = the second vector component hence "IVec * b" in \b func.
+- Component #1 = the first vector component hence "JVec * a".
+- Component #2 = a vector magnitude hence "KVec * sqrt( a*a + b*b )".
+
+In addition we want to add 10.0 to each component computed as described above, hence
+"10" in \b func.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_applyFunc_1
+Now we ascertain that the result field is as we expect. We check the second vector of
+the \b field.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_applyFunc_2
+
+
+\subsubsection cpp_mcfielddouble_applyFunc_val Filling a field with a value
+
+We want to transform a 2D vector field to a 3D vector field so that all values to be
+equal to a certain value. First, we create the 2D mesh and the vector field on it.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_applyFunc_val_1
+Finally we use
+\ref ParaMEDMEM::MEDCouplingFieldDouble::applyFunc(int nbOfComp, double val) "applyFunc()"
+to change the number of components and all field values.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_applyFunc_val_2
+As a result, number of tuples in the field equals to the number of cells in the mesh,
+and number of components becomes equal to 3 as required.
+
+
+\subsubsection cpp_mcfielddouble_fillFromAnalytic3 Filling a field using an expression
+
+First, we create a 2D Cartesian mesh constituted by 2 cells.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_fillFromAnalytic3_1
+Now we create a field on cells and use
+\ref ParaMEDMEM::MEDCouplingFieldDouble::fillFromAnalytic2 "fillFromAnalytic2()"
+to fill it
+with values computed using an expression \b func. This expression is applied to coordinates of
+each point (barycenter) for which the field value is computed. We want the \b field
+to have 3 components computed as follows. (In \b func, we refer to the
+first component of a point using the variable "a", and to the second component, using
+the variable "b").
+- Component #0 = the second coordinate of the point hence "IVec * b" in \b func.
+- Component #1 = the first coordinate of the point hence "JVec * a".
+- Component #2 = distance between the point and SC origin (0.,0.) hence
+"KVec * sqrt( a*a + b*b )".
+
+In addition we want to add 10.0 to each component computed as described above, hence
+"10" in \b func.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_fillFromAnalytic3_2
+Now we ascertain that the result field is as we expect. We check the second tuple of
+the \b field. We get barycenter of the cell #1 and checks that values of the second
+tuple are computed as we want.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_fillFromAnalytic3_3
+
+
+\subsubsection cpp_mcfielddouble_fillFromAnalytic2 Filling a field using an expression
+
+First, we create a 2D Cartesian mesh constituted by 2 cells.
+Note that we set names to coordinates arrays ("a" and "b" ) which will be used to refer to
+corresponding coordinates within a function.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_fillFromAnalytic2_1
+Now we create a field on cells and use
+\ref ParaMEDMEM::MEDCouplingFieldDouble::fillFromAnalytic2 "fillFromAnalytic2()"
+to fill it
+with values computed using an expression \b func. This expression is applied to coordinates of
+each point (barycenter) for which the field value is computed. We want the \b field
+to have 3 components computed as follows. (In \b func, we refer to the
+first component of a point using the variable "a", and to the second component, using
+the variable "b").
+- Component #0 = the second coordinate of the point hence "IVec * b" in \b func.
+- Component #1 = the first coordinate of the point hence "JVec * a".
+- Component #2 = distance between the point and SC origin (0.,0.) hence
+"KVec * sqrt( a*a + b*b )".
+
+In addition we want to add 10.0 to each component computed as described above, hence
+"10" in \b func.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_fillFromAnalytic2_2
+Now we ascertain that the result field is as we expect. We check the second tuple of
+the \b field. We get barycenter of the cell #1 and checks that values of the second
+tuple are computed as we want.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_fillFromAnalytic2_3
+
+
+\subsubsection cpp_mcfielddouble_fillFromAnalytic Filling a field using an expression
+
+First, we create a 2D Cartesian mesh constituted by 2 cells.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_fillFromAnalytic_1
+Now we create a field on cells and use
+\ref ParaMEDMEM::MEDCouplingFieldDouble::fillFromAnalytic(int nbOfComp, const char *func) "fillFromAnalytic()"
+to fill it
+with values computed using an expression \b func. This expression is applied to coordinates of
+each point (barycenter) for which the field value is computed. We want the \b field to have
+ 3 components computed as follows. (In \b func, we refer to the
+first component of a point using the variable "a", and to the second component, using
+the variable "b").
+- Component #0 = the second coordinate of the point hence "IVec * b" in \b func.
+- Component #1 = the first coordinate of the point hence "JVec * a".
+- Component #2 = distance between the point and SC origin (0.,0.) hence
+"KVec * sqrt( a*a + b*b )".
+
+In addition we want to add 10.0 to each component computed as described above, hence
+"10" in \b func.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_fillFromAnalytic_2
+Now we ascertain that the result field is as we expect. We check the second tuple of
+the \b field. We get barycenter of the cell #1 to check that values of the second
+tuple (#1) are computed as we want.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_fillFromAnalytic_3
+
+
+\subsubsection medcouplingcppexamplesFieldDoubleBuild5 Some operations that can be carried out on fields on cells
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippetFieldDoubleBuild1_2
+
+\anchor BEGIN_CPP_ONLY
+The decrementation of ref counter should be carried out in CPlusPlus only ...
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippetFieldDoubleBuild1_3
+\anchor END_CPP_ONLY
+
+
+\subsubsection cpp_mcfielddouble_renumberNodes Permuting a field on nodes
+
+First, we create a supporting 2D mesh constituted by 4 cells. We create a 2x2
+Cartesian mesh and then convert it to an unstructured one, since the Cartesian mesh
+is not suitable for
+\ref ParaMEDMEM::MEDCouplingFieldDouble::renumberNodes "renumberNodes()" as its
+ nature does not imply node renumbering.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_renumberNodes_1
+Then we create a field on nodes using
+\ref ParaMEDMEM::MEDCouplingFieldDouble::fillFromAnalytic "fillFromAnalytic()",
+such that its values to coincide with coordinates of field location points that are
+ nodes in our case (as our field is \ref ParaMEDMEM::ON_NODES "ON_NODES").
+At last we ascertain that field values are equal to node coordinates.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_renumberNodes_2
+Now, we are going to reverse order of nodes using
+\ref ParaMEDMEM::MEDCouplingFieldDouble::renumberNodes "renumberNodes()".
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_renumberNodes_3
+As a result, the underlying mesh of \b field is changed and its nodes are also
+ renumbered.
+And the field values are still equal to node coordinates of the renumbered \b mesh2.
+
+
+\subsubsection cpp_mcfielddouble_renumberCells Permuting a field on cells
+
+First, we create a supporting 2D mesh constituted by 4 cells. We create a 2x2
+Cartesian mesh and then convert it to an unstructured one, since the Cartesian mesh
+is not suitable for
+\ref ParaMEDMEM::MEDCouplingFieldDouble::renumberCells "renumberCells()" as its
+ nature does not imply cell renumbering.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_renumberCells_1
+Then we create a field on cells using
+\ref ParaMEDMEM::MEDCouplingFieldDouble::fillFromAnalytic "fillFromAnalytic()",
+such that its values to coincide with coordinates of field location points that are
+ cell barycenters in our case (as our field is \ref ParaMEDMEM::ON_CELLS "ON_CELLS").
+At last we ascertain that field values are equal to cell barycenters.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_renumberCells_2
+Now, we are going to reverse order of cells using
+\ref ParaMEDMEM::MEDCouplingFieldDouble::renumberCells "renumberCells()".
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_renumberCells_3
+As a result, the underlying mesh of \b field is changed and its cells are also
+ renumbered.
+And the field values are still equal to cell barycenters of the renumbered \b mesh2.
+
+
+\anchor BEGIN_CPP_ONLY
+\subsubsection cpp_mcfielddouble_fillFromAnalytic_c_func Filling a field using a C function
+
+We want to create a 3D vector field lying on a 2D mesh using a C function as a value
+generator. For that, first, we define the function that computes 3 values basing on 2
+coordinates of a 2D point.
+\snippet MEDCouplingExamplesTest.cxx Snippet_MEDCouplingFieldDouble_fillFromAnalytic_c_func_0
+Then we create the 2D mesh and the field on it, and finally we use
+\ref ParaMEDMEM::MEDCouplingFieldDouble::fillFromAnalytic(int nbOfComp, FunctionToEvaluate func) "fillFromAnalytic()"
+to fill the field with values each composed of 3 components.
+\snippet MEDCouplingExamplesTest.cxx Snippet_MEDCouplingFieldDouble_fillFromAnalytic_c_func_1
+As a result, number of tuples in the field equals to the number of cells in the mesh,
+and number of components equals to 3 as required.
+\anchor END_CPP_ONLY
+
+
+\anchor BEGIN_CPP_ONLY
+\subsubsection cpp_mcfielddouble_applyFunc_c_func Changing a field by applying a C function
+
+We want to transform a 2D vector field to a 3D vector field by
+applying a C function to each vector value. For that, first, we define the function
+that computes 3 values basing on 2 components of a 2D vector.
+\snippet MEDCouplingExamplesTest.cxx Snippet_MEDCouplingFieldDouble_fillFromAnalytic_c_func_0
+Then we create the 2D mesh and the vector field on it.
+\snippet MEDCouplingExamplesTest.cxx Snippet_MEDCouplingFieldDouble_applyFunc_c_func_1
+Finally we use
+\ref ParaMEDMEM::MEDCouplingFieldDouble::applyFunc(int nbOfComp, FunctionToEvaluate func) "applyFunc()"
+to change the field values.
+\snippet MEDCouplingExamplesTest.cxx Snippet_MEDCouplingFieldDouble_applyFunc_c_func_2
+As a result, number of tuples in the field equals to the number of cells in the mesh,
+and number of components becomes equal to 3 as required.
+\anchor END_CPP_ONLY
+
+
+\anchor BEGIN_CPP_ONLY
+
+\subsubsection cpp_mcfield_remapper_highlevel Using interpolation tools - High level usage
+
+\code
+...
+const char sourceFileName[]="source.med"
+MEDCouplingFieldDouble *sourceField=MEDLoader::ReadFieldCell(sourceFileName,"Source_Mesh",0,"Density",/*iteration*/0,/*order*/0)
+const char targetFileName[]="target.med"
+MEDCouplingUMesh *med_target_mesh=MEDLoader::ReadUMeshFromFile(targetFileName,"Target_Mesh",0)
+//
+sourceField->setNature(ConservativeVolumic)//Specify which formula to use in case of non overlapping meshes
+MEDCouplingRemapper remapper
+remapper.setPrecision(1e-12)
+remapper.setIntersectionType(INTERP_KERNEL::Triangulation)
+remapper.prepare(sourceField->getMesh(),med_target_mesh,"P0P0")
+MEDCouplingFieldDouble *targetField=remapper.transferField(sourceField,/*default_value*/4.57)//Any target cell not intercepted by any source cell will have value set to 4.57.
+...
+// clean-up
+targetField->decrRef()
+sourceField->decrRef()
+med_target_mesh->decrRef()
+\endcode
+
+\anchor END_CPP_ONLY
+
+
+\anchor BEGIN_CPP_ONLY
+
+\subsubsection cpp_mcfield_remapper_middlelevel Using interpolation tools - Middle level usage
+
+- The simplest way to use the interpolator with \ref medcoupling data struture is illustrated in the following example.
+
+\code
+...
+MEDCouplingUMesh *med_source_mesh=MEDLoader::ReadUMeshFromFile("source.med","Source_mesh",0)
+MEDCouplingUMesh *med_target_mesh=MEDLoader::ReadUMeshFromFile("target.med","Target_mesh",0)
+MEDCouplingNormalizedUnstructuredMesh<2,2> wrap_source_mesh(med_source_mesh)
+MEDCouplingNormalizedUnstructuredMesh<2,2> wrap_target_mesh(med_target_mesh)
+// Go for interpolation...
+INTERP_KERNEL::Interpolation2D myInterpolator
+myInterpolator.setPrecision(1e-7)
+myInterpolator.setIntersectionType(INTERP_KERNEL::Geometric2D)
+std::vector<std::map<int,double> > resultMatrix
+INTERP_KERNEL::Matrix<double,ALL_C_MODE> resultMatrix2
+// here the interpolation is performed twice for this code to illustrate the possibility of storing data the interpolation matrix in 2 different data structures.
+myInterpolator.interpolateMeshes(wrap_source_mesh,wrap_target_mesh,resultMatrix,"P0P0")
+myInterpolator.interpolateMeshes(wrap_source_mesh,wrap_target_mesh,resultMatrix2,"P0P0")
+//Ok resultMatrix and resultMatrix2 contain matrix now
+...
+\endcode
+
+
+- Same with VTK data structure :
+
+\code
+...
+vtkXMLUnstructuredGridReader *readerSource=vtkXMLUnstructuredGridReader::New()
+readerSource->SetFileName("source.vtu")
+vtkUnstructuredGrid *vtk_source_mesh=readerSource->GetOutput()
+readerSource->Update()
+vtkXMLUnstructuredGridReader *readerTarget=vtkXMLUnstructuredGridReader::New()
+readerTarget->SetFileName("target.vtu")
+vtkUnstructuredGrid *vtk_target_mesh=readerTarget->GetOutput()
+readerTarget->Update()
+// Ok at this point we have our mesh in VTK format.
+// Go to wrap vtk_source_mesh and vtk_target_mesh.
+VTKNormalizedUnstructuredMesh<2> wrap_source_mesh(vtk_source_mesh)
+VTKNormalizedUnstructuredMesh<2> wrap_target_mesh(vtk_target_mesh)
+// Go for interpolation...
+INTERP_KERNEL::Interpolation2D myInterpolator
+//optional call to parametrize your interpolation. First precision, tracelevel, intersector wanted.
+myInterpolator.setOptions(1e-7,0,Geometric2D)
+INTERP_KERNEL::Matrix<double,ALL_C_MODE> resultMatrix
+myInterpolator.interpolateMeshes(wrap_source_mesh,wrap_target_mesh,resultMatrix,"P0P0")
+//Ok let's multiply resultMatrix by source field to interpolate to target field.
+resultMatrix.multiply(...)
+//clean-up
+readerSource->Delete()
+readerTarget->Delete()
+...
+\endcode
+
+\anchor END_CPP_ONLY
+
+
+\subsection ExamplesFieldsAccess Access
+
+\subsubsection cpp_mcfielddouble_getValueOn_time Getting a field value at some point at certain time
+
+First, we create a supporting structured mesh. We create a 2x2 Cartesian mesh
+constituted by 4 cells.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_getValueOn_time_1
+Then we create a scalar field on cells, whose values vary linearly in time.
+We set all field values at a start time to be equal 10.0 using
+\ref ParaMEDMEM::MEDCouplingFieldDouble::fillFromAnalytic "fillFromAnalytic()".
+And we set all field values at an end time to be equal 20.0 by doubling the start
+time array.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_getValueOn_time_2
+Now, we want to get a field value at a point [0,0] at a middle time between the start
+and end times. We expect the returned value to be equal to an average of 10. and 20.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_getValueOn_time_3
+
+
+\subsubsection cpp_mcfielddouble_getValueOnMulti Getting field values at some points
+
+First, we create a supporting structured mesh. We create a 2x2 Cartesian mesh
+constituted by 4 cells. Then we create a scalar field on cells using
+\ref ParaMEDMEM::MEDCouplingFieldDouble::fillFromAnalytic "fillFromAnalytic()".
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_getValueOnMulti_1
+Now, we want to retrieve all field values using
+\ref ParaMEDMEM::MEDCouplingFieldDouble::getValueOnMulti "getValueOnMulti()".
+The field values relate to cells, hence we will use cell barycenters as a parameter of
+\ref ParaMEDMEM::MEDCouplingFieldDouble::getValueOnMulti "getValueOnMulti()".
+We expect that the double array returned
+\ref ParaMEDMEM::MEDCouplingFieldDouble::getValueOnMulti "getValueOnMulti()"
+is equal to that stored by \b field.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_getValueOnMulti_2
+
+
+\subsubsection cpp_mcfielddouble_getValueOn Getting a field value at a point
+
+First, we create a supporting structured mesh. We create a 2x2 Cartesian mesh
+constituted by 4 cells. Then we create a scalar field on cells using
+\ref ParaMEDMEM::MEDCouplingFieldDouble::fillFromAnalytic "fillFromAnalytic()".
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_getValueOn_1
+Now, we want to retrieve all field values using
+\ref ParaMEDMEM::MEDCouplingFieldDouble::getValueOn "getValueOn()".
+The field values relate to cells, hence we will use cell barycenters to get a field
+value at each cell.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_getValueOn_2
+We collected all values returned by
+\ref ParaMEDMEM::MEDCouplingFieldDouble::getValueOn "getValueOn()" in an array, so
+that we can ascertain that the array of returned values is same as that stored by \b
+field.
+
+
+\subsubsection cpp_mcfielddouble_getValueOnPos Getting a value of field lying on a structured mesh
+
+First, we create a supporting structured mesh. We create a 2x2 Cartesian mesh
+constituted by 4 cells. Then we create a scalar field on cells using
+\ref ParaMEDMEM::MEDCouplingFieldDouble::fillFromAnalytic "fillFromAnalytic()".
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_getValueOnPos_1
+Now, we retrieve a field value relating to the cell #3 (this cell has a structured indexed
+(1,1)). For that we use
+\ref ParaMEDMEM::MEDCouplingFieldDouble::getValueOnPos "getValueOnPos()" where we
+pass the structured indexed of the cell: 1,1,-1 (the last index is meaningless as the
+mesh is 2D).
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_getValueOnPos_2
+After all we ascertain that the returned value corresponds to the expression used for
+the field creation. Namely that the value equals to the sum of components of
+barycenter of cell #3.
+
+\section ExamplesMeshes Meshes
+
+\subsection ExamplesMeshesCreate Create
+
+\subsubsection medcouplingcppexamplesUmeshStdBuild1 Standard build of an unstructured mesh from scratch
+
+Firstly retrieve basic data in full interlace mode for coordinates, and nodal connectivity cell per cell.
+\snippet MEDCouplingExamplesTest.cxx CppSnippetUMeshStdBuild1_1
+
+Then create ParaMEDMEM::MEDCouplingUMesh instance giving its mesh dimension (2 here) and a name.
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippetUMeshStdBuild1_2
+
+Gives an upper bound of the number of cells to be inserted into the unstructured mesh.
+\n Then enter nodal connectivity of all cells, cell per cell using ParaMEDMEM::MEDCouplingUMesh::insertNextCell method.
+\n When the nodal connectivity cell per cell has been finished, call ParaMEDMEM::MEDCouplingUMesh::finishInsertingCells method in order to restore \b mesh instance.
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippetUMeshStdBuild1_3
+
+At this level the connectivity part of the mesh \b mesh as been defined. Now let's set the coordinates using array \b coords defined above.
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippetUMeshStdBuild1_4
+
+At this level mesh is usable. When this mesh is no more needed simply call decrRef to decrement its reference counter.
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippetUMeshStdBuild1_5
+
+
+\subsubsection medcouplingcppexamplesUmeshAdvBuild1 Advanced build of an unstructured mesh from scratch
+
+Firstly retrieve basic data in full interlace mode for coordinates, and nodal connectivity cell per cell, cell type \b included (3 for INTERP_KERNEL::NORM_TRI3 and 4 for INTERP_KERNEL::QUAD4).
+\snippet MEDCouplingExamplesTest.cxx CppSnippetUMeshAdvBuild1_1
+
+Then create ParaMEDMEM::MEDCouplingUMesh instance giving its mesh dimension (2 here) and a name.
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippetUMeshAdvBuild1_2
+
+Then enter nodal connectivity at once.
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippetUMeshAdvBuild1_3
+
+At this level the connectivity part of the mesh \b mesh as been defined. Now let's set the coordinates using array \b coords defined above.
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippetUMeshAdvBuild1_4
+
+At this level mesh is usable. When this mesh is no more needed simply call decrRef() to decrement its reference counter.
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippetUMeshAdvBuild1_5
+
+
+\subsubsection medcouplingcppexamplesCmeshStdBuild1 Standard build of an cartesian mesh from scratch
+
+We are going to build a 2D cartesian mesh, constituted from 9 nodes along X axis, and 7 nodes along Y axis.
+
+Firstly retrieve for each direction the discretization and build a \ref ParaMEDMEM::DataArrayDouble "DataArrayDouble instance" on the corresponding direction.
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippetCMeshStdBuild1_1
+
+Then create ParaMEDMEM::MEDCouplingCMesh instance giving the 2 instances of \ref ParaMEDMEM::DataArrayDouble "DataArrayDouble" obtained above.
+
+There are 2 techniques to get it.
+
+Either :
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippetCMeshStdBuild1_2
+
+Or :
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippetCMeshStdBuild1_2bis
+
+\c mesh is now available for use :
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippetCMeshStdBuild1_3
+
+When this mesh is no more needed simply call decrRef to decrement its reference counter.
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippetCMeshStdBuild1_4
+
+
+\subsubsection cpp_mcumesh_buildBoundaryMesh Getting a bounding mesh
+
+First, we create a 2D mesh with 3 QUAD4 and 2 TRI3 cells.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_buildBoundaryMesh_1
+Now we use
+\ref ParaMEDMEM::MEDCouplingUMesh::buildBoundaryMesh "buildBoundaryMesh()" to get a mesh
+of lower dimension bounding \b mesh.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_buildBoundaryMesh_2
+Depending on the value of a parameter,
+\ref ParaMEDMEM::MEDCouplingUMesh::buildBoundaryMesh "buildBoundaryMesh()"
+creates the mesh sharing the node coordinates array with \b mesh or not.
+
+
+\subsubsection cpp_mcumesh_buildFacePartOfMySelfNode Retrieving a lower dimension mesh based on given nodes
+
+First, we create a 2D mesh with 3 QUAD4 and 2 TRI3 cells.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_buildFacePartOfMySelfNode_1
+In the following code we retrieve nodes of the cell #0 an then we call
+\ref ParaMEDMEM::MEDCouplingUMesh::buildFacePartOfMySelfNode "buildFacePartOfMySelfNode()"
+twice with these nodes and with varying last parameter \b allNodes as input.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_buildFacePartOfMySelfNode_2
+<br>If the last parameter is \c true
+\ref ParaMEDMEM::MEDCouplingUMesh::buildFacePartOfMySelfNode "buildFacePartOfMySelfNode()" looks
+for segements whose all nodes are given to it, hence it finds segments bounding the cell #0 only.
+<br>If the last parameter is \c false
+\ref ParaMEDMEM::MEDCouplingUMesh::buildFacePartOfMySelfNode "buildFacePartOfMySelfNode()" looks
+for any segment whose nodes are given to it, hence it adds more segments to \b mesh2.
+
+
+\subsubsection cpp_mcumesh_buildPartOfMySelfNode Copying cells selected by nodes
+
+First, we create a 2D mesh with 3 QUAD4 and 2 TRI3 cells.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_buildPartOfMySelfNode_1
+In the following code we retrieve nodes of the cell #0 an then we call
+\ref ParaMEDMEM::MEDCouplingUMesh::buildPartOfMySelfNode "buildPartOfMySelfNode()"
+twice with these nodes and with varying last parameter \b allNodes as input.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_buildPartOfMySelfNode_2
+<br>If the last parameter is \c true
+\ref ParaMEDMEM::MEDCouplingUMesh::buildPartOfMySelfNode "buildPartOfMySelfNode()" looks
+for cells whose all nodes are given to it, hence it finds the cell #0 only.
+<br>If the last parameter is \c false
+\ref ParaMEDMEM::MEDCouplingUMesh::buildPartOfMySelfNode "buildPartOfMySelfNode()" looks
+for any cell whose nodes are given to it, hence it finds all cells of \b mesh because all
+cells share the node #4.
+
+
+\subsubsection cpp_mcumesh_buildPartOfMySelf Getting a part of mesh
+
+First, we create a 2D mesh with 3 QUAD4 and 2 TRI3 cells.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_buildPartOfMySelf_1
+Now we use
+\ref ParaMEDMEM::MEDCouplingUMesh::buildPartOfMySelf "buildPartOfMySelf()" to get a mesh
+containing only two cells of \b mesh.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_buildPartOfMySelf_2
+
+
+\subsection ExamplesMeshesModify Modify
+
+\subsubsection cpp_mcumesh_findAndCorrectBadOriented3DExtrudedCells Fixing orientation of "extruded" volumes
+
+First, we create a mesh with 2 incorrectly oriented "extruded" volumes.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_findAndCorrectBadOriented3DExtrudedCells_1
+Now we check that
+\ref ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells "findAndCorrectBadOriented3DExtrudedCells()"
+finds and fixes the reversed cells.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_findAndCorrectBadOriented3DExtrudedCells_2
+
+
+\subsubsection cpp_mcumesh_arePolyhedronsNotCorrectlyOriented Fixing orientation of polyhedra
+
+First, we create a mesh with 2 polyhedra, one of which is incorrectly oriented. We create
+two "extruded" polyhedra and then convert them to correctly defined polyhedra.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_arePolyhedronsNotCorrectlyOriented_1
+Now we check that
+\ref ParaMEDMEM::MEDCouplingUMesh::arePolyhedronsNotCorrectlyOriented "arePolyhedronsNotCorrectlyOriented()"
+finds one reversed cell. After that we fix it using
+\ref ParaMEDMEM::MEDCouplingUMesh::orientCorrectlyPolyhedrons "orientCorrectlyPolyhedrons()" and
+re-check the orientation of polyhedra.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_arePolyhedronsNotCorrectlyOriented_2
+
+
+\subsubsection cpp_mcumesh_are2DCellsNotCorrectlyOriented Fixing orientation of faces
+
+First, we create a 2D mesh in 3D space with 3 QUAD4 and 2 TRI3 cells. Orientation of the cell #1 is
+reversed comparing with others.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_are2DCellsNotCorrectlyOriented_1
+Now we check that
+\ref ParaMEDMEM::MEDCouplingUMesh::are2DCellsNotCorrectlyOriented "are2DCellsNotCorrectlyOriented()"
+finds one reversed face. After that we fix the incorrectly oriented cell using
+\ref ParaMEDMEM::MEDCouplingUMesh::orientCorrectly2DCells "orientCorrectly2DCells()" and
+re-check the orientation of cells.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_are2DCellsNotCorrectlyOriented_2
+
+
+\subsubsection cpp_mcumesh_renumberNodesInConn Renumbering nodes in the connectivity array
+
+First, we create a 2D mesh with 1 QUAD4 cell and with undefined coordinates of nodes.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_renumberNodesInConn_1
+Now we use
+\ref ParaMEDMEM::MEDCouplingUMesh::renumberNodesInConn "renumberNodesInConn()"
+to get the following nodal connectivity of a sole cell: 0,1,2,3.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_renumberNodesInConn_2
+\b old2newIds array defines how node ids are changed:
+- new id of node #0 is -1,
+- new id of node #1 is 3,
+- new id of node #2 is 4,
+- new id of node #3 is 1,
+- new id of node #4 is 0.
+
+
+\subsubsection cpp_mcumesh_renumberNodes Renumbering nodes
+
+First, we create a 2D mesh with 4 nodes and no cells.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_renumberNodes_1
+Next, we use
+\ref ParaMEDMEM::MEDCouplingUMesh::renumberNodes "renumberNodes()"
+to permute nodes so that
+- old node #0 becomes #2,
+- old node #1 remains #1,
+- old node #2 becomes #0,
+- old node #3 is removed.
+
+Number of nodes becomes 3.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_renumberNodes_2
+
+Next we compare behavior of
+\ref ParaMEDMEM::MEDCouplingUMesh::renumberNodes "renumberNodes()" and that of
+\ref ParaMEDMEM::MEDCouplingUMesh::renumberNodes2 "renumberNodes2()" which, in contrast to
+\ref ParaMEDMEM::MEDCouplingUMesh::renumberNodes "renumberNodes()",
+moves merged nodes to their barycenter.<br>
+We set #2 as new id of old node #3 and expect that
+\ref ParaMEDMEM::MEDCouplingUMesh::renumberNodes2 "renumberNodes2()" moves old nodes #0
+and #3 to their barycenter (-0.3,0.0) which becomes position of node #2.<br>
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_renumberNodes_3
+
+
+\subsubsection cpp_mcumesh_mergeNodes Merging equal nodes
+
+First, we create a 2D mesh with 1 QUAD4 and 2 TRI3 cells. The cells are based on 6 nodes
+of which 2 nodes fully coincide (#3 and #4) and 3 nodes are equal with precision 0.003.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_mergeNodes_1
+Now we merge node duplicates using
+\ref ParaMEDMEM::MEDCouplingUMesh::mergeNodes "mergeNodes()" and check values it returns.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_mergeNodes_2
+Contents of \b arr shows ids of old nodes after the merging. The nodes considered equal
+one to the other have the same id in \b arr.
+
+Next we compare behavior of
+\ref ParaMEDMEM::MEDCouplingUMesh::mergeNodes "mergeNodes()" and that of
+\ref ParaMEDMEM::MEDCouplingUMesh::mergeNodes2 "mergeNodes2()" which, in contrast to
+\ref ParaMEDMEM::MEDCouplingUMesh::mergeNodes "mergeNodes()",
+moves merged nodes to their barycenter.<br> We expect that
+\ref ParaMEDMEM::MEDCouplingUMesh::mergeNodes2 "mergeNodes2()" moves old nodes #0, #2
+and #5 to their barycenter equal to position of node #2.<br>
+First we check that
+\ref ParaMEDMEM::MEDCouplingUMesh::mergeNodes "mergeNodes()" does not move nodes
+coincident with the node #2 to the position of node #2, and then we check that
+\ref ParaMEDMEM::MEDCouplingUMesh::mergeNodes "mergeNodes2()" does move.
+(We check only the second (Y) component of node coordinates since the first component of
+these nodes is exactly same.)
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_mergeNodes_3
+
+
+\subsubsection cpp_mcumesh_zipConnectivityTraducer Removing cell duplicates
+
+First, we create a 2D mesh with 3 QUAD4 and 2 TRI3 cells, so that
+- the cell #2 has the same nodal connectivity as the cell #1 does,
+- the cell #3 has the same nodal connectivity as the cell #0 does,
+- the cell #4 is based on the same nodes as the cell #0 but nodes order is different.
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_zipConnectivityTraducer_1
+Now we use
+\ref ParaMEDMEM::MEDCouplingUMesh::zipConnectivityTraducer "zipConnectivityTraducer()"
+to remove duplicate cells. Then we check that two cells, having exactly same nodal
+connectivity with other cells, have been removed.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_zipConnectivityTraducer_2
+Contents of \b arr shows ids of cells after duplicates removal. If a value (cell id)
+equals to its index in \b arr, this means that the cell is not a duplicate of any cell
+with lower id. Else, the value gives a cell id to which this cell is equal. <br>
+Thus, the cells #0 and #1 have no preceding equal cell since \b arr[i] == i.<br>
+The cell #2 equals to the cell #1 (== \b arr[2] ).<br>
+The cell #3 equals to the cell #0 (== \b arr[3] ).<br>
+The cell #4 has no equal cell. This is because the cell comparison technique specified
+when we called
+\ref ParaMEDMEM::MEDCouplingUMesh::zipConnectivityTraducer "zipConnectivityTraducer()"
+was 0 ("exact"), if we had used the technique 2 ("nodal"), \b arr[4] would be 0.
+
+
+\subsubsection cpp_mcumesh_zipCoordsTraducer Removing unused nodes
+
+First, we create a 2D mesh with 3 QUAD4 and 2 TRI3 cells.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_zipCoordsTraducer_1
+Now we create \b mesh2 including all nodes but only two cells of \b mesh, and we use \ref
+ParaMEDMEM::MEDCouplingUMesh::zipCoordsTraducer "zipCoordsTraducer()" to remove unused
+nodes from \b mesh2.
+\ref ParaMEDMEM::MEDCouplingUMesh::zipCoordsTraducer "zipCoordsTraducer()" returns an array
+with -1 for unused nodes and new ids for used ones.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_zipCoordsTraducer_2
+
+
+\subsubsection cpp_mcumesh_getNodeIdsInUse Retrieving unused nodes
+
+First, we create a 2D mesh with 3 QUAD4 and 2 TRI3 cells.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_getNodeIdsInUse_1
+Now we create \b mesh2 including all nodes but only two cells of \b mesh, and we use \ref
+ParaMEDMEM::MEDCouplingUMesh::getNodeIdsInUse "getNodeIdsInUse()" to get nodes of \b mesh2
+used in its two cells.
+\ref ParaMEDMEM::MEDCouplingUMesh::getNodeIdsInUse "getNodeIdsInUse()" returns an array
+with -1 for unused nodes and new ids for used ones.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_getNodeIdsInUse_2
+Now we use \b newNbOfNodes returned by
+\ref ParaMEDMEM::MEDCouplingUMesh::getNodeIdsInUse "getNodeIdsInUse()" to convert \b arr
+to "New to Old" mode.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_getNodeIdsInUse_3
+
+
+\subsubsection cpp_mcumesh_convertToPolyTypes Conversion of cells to "poly" types
+
+First, we create a 2D mesh with 3 QUAD4 and 2 TRI3 cells.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_convertToPolyTypes_1
+Now we convert cells #1 and #3 to type POLYGON and check the result
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_convertToPolyTypes_2
+
+
+\subsubsection cpp_mcpointset_scale Scaling the mesh
+
+First, we create a 2D mesh with 4 nodes and no cells.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_scale_1
+Then we scale it by a factor of 2 with a center (0.,0.).
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_scale_2
+Finally we check that all node coordinates have changed by more than 0.9.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_scale_3
+
+
+\subsubsection cpp_mcpointset_translate Translating the mesh
+
+First, we create a 2D mesh with 4 nodes and no cells.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_translate_1
+Then we translate it by a vector (1.,1.).
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_translate_2
+Finally we check that all node coordinates have changed by more than 0.9.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_translate_3
+
+
+\subsubsection cpp_mcpointset_rotate Rotating the mesh
+
+First, we create a 2D mesh with 4 nodes and no cells.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_rotate_1
+Then we rotate it around a point (0.,0.) by 90 degrees clockwise.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_rotate_2
+Next, we make a 3D mesh from the 2D one and rotate it around the Z axis by 90 degrees
+counter-clockwise.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_rotate_3
+Finally we transform the mesh back to 2D space and check that all nodes get back to the
+initial location.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_rotate_4
+
+
+\subsection ExamplesMeshesAccess Access
+
+\subsubsection cpp_mccmesh_getCoordsAt Getting node coordinates along an axis
+
+We create an 1D Cartesian mesh and retrieves node coordinates using
+\ref ParaMEDMEM::MEDCouplingCMesh::getCoordsAt "getCoordsAt()".
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingCMesh_getCoordsAt_1
+
+
+\subsubsection cpp_mcpointset_getcoordinatesofnode Getting coordinates of a node
+
+The following code creates a 2D \ref ParaMEDMEM::MEDCouplingUMesh
+"MEDCouplingUMesh" with 3 nodes and no cells.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_getCoordinatesOfNode_1
+Here we get coordinates of the second node and check its two coordinates.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_getCoordinatesOfNode_2
+
+
+\subsubsection cpp_mcumesh_areCellsIncludedIn Cells correspondence in two meshes
+
+First, we create a 2D \b mesh1 with 3 QUAD4 and 2 TRI3 cells.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_areCellsIncludedIn_1
+Then we create a \b mesh2 which includes cells #4, #2 and #0 of \b mesh1. The two meshes
+share the same node coordinates array.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_areCellsIncludedIn_2
+Now we ascertain that
+- \ref ParaMEDMEM::MEDCouplingUMesh::areCellsIncludedIn "areCellsIncludedIn()"
+detects that all cells of \b mesh2 are present in \b mesh1,
+- the correspondence array \b corr2to1, which gives cell ids of \b mesh2 within
+\b mesh1, is equal to the array \b cells2 which selected cells from \b mesh1 for creation
+of \b mesh2.
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_areCellsIncludedIn_3
+Now we apply
+\ref ParaMEDMEM::MEDCouplingUMesh::areCellsIncludedIn "areCellsIncludedIn()"
+in a reverse direction and ascertain that it returns \c false.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_areCellsIncludedIn_4
+The contents of the correspondence
+array \b corr1to2 [2, 3, 1, 4, 0] means the following.
+- The cell #0 of \b mesh1 is equal to the cell #2 (== \b corr1to2[ 0 ]) of \b mesh2.
+- The cell #1 of \b mesh1 is missing from \b mesh2 (as \b corr1to2[ 1 ] >= \b mesh2->getNumberOfCells()).
+- The cell #2 of \b mesh1 is equal to the cell #1 (== \b corr1to2[ 2 ]) of \b mesh2.
+- The cell #3 of \b mesh1 is missing from \b mesh2 (as \b corr1to2[ 3 ] >= \b mesh2->getNumberOfCells()).
+- The cell #4 of \b mesh1 is equal to the cell #0 (== \b corr1to2[ 4 ]) of \b mesh2.
+
+
+\subsubsection cpp_mcumesh_checkDeepEquivalWith Deep comparison of meshes
+
+First, we create two 2D meshes with two triangles, so that
+- their nodes are almost same but permuted,
+- the first triangle is based exactly on the same nodes (taking the permutation into account),
+- an order of nodes in the second triangle is changed.
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_checkDeepEquivalWith_1
+Then we check that
+- \ref ParaMEDMEM::MEDCouplingUMesh::checkDeepEquivalWith "checkDeepEquivalWith()"
+considers the meshes equal (i.e. it does not throw any exception) if it is called with a cell
+comparison policy \b cellCompPol == 1
+- mapping from \b mesh1 to \b mesh2 for both nodes and cells is as expected.
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_checkDeepEquivalWith_2
+Next we ascertain that
+\ref ParaMEDMEM::MEDCouplingUMesh::checkDeepEquivalOnSameNodesWith "checkDeepEquivalOnSameNodesWith()"
+consider \b mesh1 and \b mesh2 different as they do not share the same nodal connectivity
+array. <br>
+After that we make the meshes share the node coordinates array and insert new
+triangles based on the same nodes but in different order. This is to ascertain that
+\ref ParaMEDMEM::MEDCouplingUMesh::checkDeepEquivalOnSameNodesWith "checkDeepEquivalOnSameNodesWith()"
+called with the weakest cell comparison policy considers the meshes equal.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_checkDeepEquivalWith_3
+
+
+\subsubsection cpp_mcumesh_getPartBarycenterAndOwner Getting barycenters of cells
+
+First, we create a 2D mesh with 3 QUAD4 and 2 TRI3 cells.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_getPartMeasureField_1
+Now we use
+\ref ParaMEDMEM::MEDCouplingUMesh::getPartBarycenterAndOwner "getPartBarycenterAndOwner()" to get
+barycenters of all but the first cell.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_getPartMeasureField_3
+The returned array contains 4 tuples per 2 components.
+
+
+\subsubsection cpp_mcumesh_getCellsContainingPoints Finding cells containing a point (multi-point case)
+
+First, we create a 2D mesh with 3 QUAD4 and 2 TRI3 cells.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_getCellsContainingPoints_1
+Then we use
+\ref ParaMEDMEM::MEDCouplingUMesh::getCellsContainingPoints "getCellsContainingPoints()" to
+get cells in contact with tree points. Two of them are in contact with some cells and one is not.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_getCellsContainingPoints_2
+The contents of the result arrays \b cells ([4, 0, 1]) and \b cellsIndex ([0, 0, 1, 3])
+mean the following.
+- Point #0 is in contact with none (== \b cellsIndx[1] - \b cellsIndx[0]) cell.
+- Point #1 is in contact with 1 (== \b cellsIndx[2] - \b cellsIndx[1]) cell whose id is #4
+ (== \b cells[ \b cellsIndx[ 1 ]]).
+- Point #2 is in contact with 2 (== \b cellsIndx[3] - \b cellsIndx[2]) cells whose ids are #0
+ (== \b cells[ \b cellsIndx[ 2 ]]) and #1 (== \b cells[ \b cellsIndx[ 2 ] + 1 ]).
+
+
+\subsubsection cpp_mcumesh_getCellsContainingPoint Finding cells containing a point
+
+First, we create a 2D mesh with 3 QUAD4 and 2 TRI3 cells.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_getCellsContainingPoint_1
+Then we use
+\ref ParaMEDMEM::MEDCouplingUMesh::getCellsContainingPoint "getCellsContainingPoint()" to
+get cells in contact with a small ball (point with precision) located near the node #4 and
+shifted from this node by its radius \b eps.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_getCellsContainingPoint_2
+Since the node #4 is shared by all cells, size of the vector \b cellIds must be equal to
+the number of cells in \b mesh.
+
+
+\subsubsection cpp_mcumesh_buildPartOrthogonalField Getting normals of cells
+
+First, we create a 2D mesh with 3 QUAD4 and 2 TRI3 cells. Orientation of the cell #1 is
+reversed.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_buildPartOrthogonalField_1
+Now we use
+\ref ParaMEDMEM::MEDCouplingUMesh::buildPartOrthogonalField "buildPartOrthogonalField()" to get
+normal vectors to the cells.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_buildPartOrthogonalField_2
+
+
+\subsubsection cpp_mcumesh_getPartMeasureField Getting volumes of cells
+
+First, we create a 2D mesh with 3 QUAD4 and 2 TRI3 cells. Orientation of the cell #1 is
+reversed.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_getPartMeasureField_1
+Now we use
+\ref ParaMEDMEM::MEDCouplingUMesh::getPartMeasureField "getPartMeasureField()" to get
+volumes of all but the first cell. If we call
+\ref ParaMEDMEM::MEDCouplingUMesh::getPartMeasureField "getPartMeasureField()" with \b
+isAbs == \c true, the area of the cell #1 is returned positive, else, negative that
+reflects its inverse orientation.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_getPartMeasureField_2
+
+
+\subsubsection cpp_mcumesh_getCellsInBoundingBox Getting cells using the bounding box
+
+First, we create a 2D mesh with 1 TRI3 cell. Bounding box of this cell is [0.,0., 1.,1].
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_getCellsInBoundingBox_1
+Now we check how
+\ref ParaMEDMEM::MEDCouplingUMesh::getCellsInBoundingBox "getCellsInBoundingBox()"
+searches for cells using the bounding box. We use a bounding box touching the bounding box
+of the sole cell at one point (1.,1.).
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_getCellsInBoundingBox_2
+If \ref ParaMEDMEM::MEDCouplingUMesh::getCellsInBoundingBox "getCellsInBoundingBox()" is
+called with parameter \b eps == 0.0, the cell is not found because the two bounding boxes
+(one of the cell and the one passed as parameter) do not overlap. <br>
+If \ref ParaMEDMEM::MEDCouplingUMesh::getCellsInBoundingBox "getCellsInBoundingBox()" is
+called with parameter \b eps == 0.1, the cell is found because \b eps is used to increase
+the bounding box of the cell and thus the two bounding boxes intersect each other. <br>
+
+
+\subsubsection cpp_mcumesh_findBoundaryNodes Getting boundary nodes
+
+First, we create a 2D mesh with 3 QUAD4 and 2 TRI3 cells.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_findBoundaryNodes_1
+Now we use
+\ref ParaMEDMEM::MEDCouplingUMesh::findBoundaryNodes "findBoundaryNodes()" to get ids
+of boundary nodes.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_findBoundaryNodes_2
+\ref ParaMEDMEM::MEDCouplingUMesh::findBoundaryNodes "findBoundaryNodes()" returns all
+node ids except the node #4 which is in the middle of \b mesh.
+
+
+\subsubsection cpp_mcumesh_getCellIdsLyingOnNodes Getting cells by nodes
+
+First, we create a 2D mesh with 3 QUAD4 and 2 TRI3 cells.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_getCellIdsLyingOnNodes_1
+In the following code we retrieve nodes of the cell #0 an then we call
+\ref ParaMEDMEM::MEDCouplingUMesh::getCellIdsLyingOnNodes "getCellIdsLyingOnNodes()"
+twice with these nodes and with varying last parameter \b allNodes as input.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_getCellIdsLyingOnNodes_2
+<br>If the last parameter is \c true
+\ref ParaMEDMEM::MEDCouplingUMesh::getCellIdsLyingOnNodes "getCellIdsLyingOnNodes()" looks
+for cells whose all nodes are given to it, hence it finds the cell #0 only.
+<br>If the last parameter is \c false
+\ref ParaMEDMEM::MEDCouplingUMesh::getCellIdsLyingOnNodes "getCellIdsLyingOnNodes()" looks
+for any cell whose nodes are given to it, hence it finds all cells of \b mesh because all
+cells share the node #4.
+
+
+\subsubsection cpp_mcumesh_getCellIdsFullyIncludedInNodeIds Getting cells by nodes
+
+First, we create a 2D mesh with 3 QUAD4 and 2 TRI3 cells.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_getCellIdsFullyIncludedInNodeIds_1
+In the following code we retrieve nodes of two cells an then we use
+\ref ParaMEDMEM::MEDCouplingUMesh::getCellIdsFullyIncludedInNodeIds
+"getCellIdsFullyIncludedInNodeIds()" to find these cells by their nodes.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_getCellIdsFullyIncludedInNodeIds_2
+
+
+\subsubsection cpp_mcumesh_buildDescendingConnectivity2 Retrieving the descending connectivity with orientation
+
+First, we create a 2D mesh with 3 QUAD4 and 2 TRI3 cells.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_buildDescendingConnectivity2_1
+Now we get and check the descending connectivity.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_buildDescendingConnectivity2_2
+Here we get connectivity of the cell #2 (#3 in FORTRAN mode) of \b mesh2 to see how
+mutual orientation of cells in \b mesh and \b mesh2 is defined.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_buildDescendingConnectivity2_3
+The contents of the result arrays \b desc and \b descIndx mean the following.
+- The cell #0 of \b mesh (QUAD4) is bound by 4 (== \b descIndx[1] - \b descIndx[0])
+ segments (SEG2) of \b mesh2 whose ids in FORTRAN mode are
+ - #1 (== \b desc[ \b descIndx[ 0 ]]),
+ - #2 (== \b desc[ \b descIndx[ 0 ] + 1 ]),
+ - #3 (== \b desc[ \b descIndx[ 0 ] + 2 ]) and
+ - #4 (== \b desc[ \b descIndx[ 0 ] + 3 ]).
+ <br>Ids are positive since order of nodes in the corresponding cells of \b mesh and \b mesh2
+ are same. For example nodes of SEG2 #3 are [4,1] and nodes of QUAD4 #0 are [0,3,\b 4,\b 1].
+- The cell #1 of \b mesh (TRI3) is bound by 3 (== \b descIndx[2] - \b descIndx[1]) segements of
+ \b mesh2 whose ids in FORTRAN mode are:
+ - #-3 (== \b desc[ \b descIndx[ 1 ]]),
+ - #5 (== \b desc[ \b descIndx[ 1 ] + 1 ]) and
+ - #6 (== \b desc[ \b descIndx[ 1 ] + 2 ]).
+ <br>The id -3 means that order of nodes in SEG2 #3 ([4,1]) is different from the order of
+ these nodes in TRI3 #1: [\b 1,\b 4,2].
+- etc.
+
+The contents of the result arrays \b revDesc and \b revDescIndx mean the following.
+- The cell #0 of \b mesh2 (SEG2) bounds 1 (== \b revDescIndx[1] - \b revDescIndx[0]) cell of \b
+ mesh whose id is:
+ - # 0 (== \b revDesc[ \b revDescIndx[ 0 ]]).
+- The cell #1 of \b mesh2 bounds 2 (== \b revDescIndx[2] - \b revDescIndx[1]) cells of \b
+ mesh whose ids are:
+ - # 0 (== \b revDesc[ \b revDescIndx[ 1 ]]) and
+ - # 1 (== \b revDesc[ \b revDescIndx[ 1 ] + 1 ]).
+- etc.
+
+
+\subsubsection cpp_mcumesh_buildDescendingConnectivity Retrieving the descending connectivity
+
+First, we create a 2D mesh with 3 QUAD4 and 2 TRI3 cells.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_buildDescendingConnectivity_1
+Now we get and check the descending connectivity.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_buildDescendingConnectivity_2
+The contents of the result arrays \b desc and \b descIndx mean the following.
+- The cell #0 of \b mesh (QUAD4) is bound by 4 (== \b descIndx[1] - \b descIndx[0])
+ segments (SEG2) of \b mesh2 whose ids are
+ - #0 (== \b desc[ \b descIndx[ 0 ]]),
+ - #1 (== \b desc[ \b descIndx[ 0 ] + 1 ]),
+ - #2 (== \b desc[ \b descIndx[ 0 ] + 2 ]) and
+ - #3 (== \b desc[ \b descIndx[ 0 ] + 3 ]).
+- The cell #1 of \b mesh (TRI3) is bound by 3 (== \b descIndx[2] - \b descIndx[1]) segements of
+ \b mesh2 whose ids are:
+ - #2 (== \b desc[ \b descIndx[ 1 ]]),
+ - #4 (== \b desc[ \b descIndx[ 1 ] + 1 ]) and
+ - #5 (== \b desc[ \b descIndx[ 1 ] + 2 ]).
+- etc.
+
+The contents of the result arrays \b revDesc and \b revDescIndx mean the following.
+- The cell #0 of \b mesh2 (SEG2) bounds 1 (== \b revDescIndx[1] - \b revDescIndx[0]) cell of \b
+ mesh whose id is:
+ - # 0 (== \b revDesc[ \b revDescIndx[ 0 ]]).
+- The cell #1 of \b mesh2 bounds 2 (== \b revDescIndx[2] - \b revDescIndx[1]) cells of \b
+ mesh whose ids are:
+ - # 0 (== \b revDesc[ \b revDescIndx[ 1 ]]) and
+ - # 1 (== \b revDesc[ \b revDescIndx[ 1 ] + 1 ]).
+- etc.
+
+
+\subsubsection cpp_mcumesh_getReverseNodalConnectivity Getting the reverse nodal connectivity
+
+First, we create a 2D mesh with 3 QUAD4 and 2 TRI3 cells.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_getReverseNodalConnectivity_1
+Now we get and check its reverse nodal connectivity.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_getReverseNodalConnectivity_2
+The contents of the result arrays mean the following.
+- Node #0 is shared by 1 (== \b revNodalIndx[1] - \b revNodalIndx[0]) cell whose id is #0
+ (== \b revNodal[ \b revNodalIndx[ 0 ]]).
+- Node #1 is shared by 2 (== \b revNodalIndx[2] - \b revNodalIndx[1]) cells whose ids are #0
+ (== \b revNodal[ \b revNodalIndx[ 1 ]]) and #1 (== \b revNodal[ \b revNodalIndx[ 1 ] + 1 ]).
+- etc.
+
+
+\subsubsection cpp_mcpointset_getBoundingBox Getting a minimum box bounding nodes
+
+First, we create a 3D mesh with 2 nodes, so that the first one has minimal coordinates and
+the second one has maximal coordinates.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_getBoundingBox_1
+Now we get a bounding box enclosing these nodes. This bounding box should contain
+coordinates of our two nodes (but in "no interlace" mode), as the nodes coincide with
+points returned by the bounding box.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_getBoundingBox_2
+
+
+\subsubsection cpp_mcpointset_getnodeidsnearpoint Getting nodes close to a point
+
+The following code creates a 2D \ref ParaMEDMEM::MEDCouplingUMesh
+"MEDCouplingUMesh" with 5 nodes and no cells.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_getNodeIdsNearPoint_1
+Now we define an array of coordinates of a point close to nodes #0, #2 and #4.
+
+Thus we expect that
+\ref ParaMEDMEM::MEDCouplingPointSet::getNodeIdsNearPoint "getNodeIdsNearPoint()" that
+we are going to use,
+if called with \b eps = 0.003, would return ids of nodes #0, #2 and #4.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_getNodeIdsNearPoint_2
+
+
+\subsubsection cpp_mcpointset_getnodeidsnearpoints Getting nodes close to some points
+
+The following code creates a 2D \ref ParaMEDMEM::MEDCouplingUMesh
+"MEDCouplingUMesh" with 7 nodes and no cells.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_getNodeIdsNearPoints_1
+Now we define an array of coordinates of 3 points near which we want to find nodes of the mesh.
+- Point #0 is at distance 0.001 from the node #1.
+- Point #1 is rather far from all nodes.
+- Point #2 is close to nodes #3, #4 and #5.
+
+Thus we expect that
+\ref ParaMEDMEM::MEDCouplingPointSet::getNodeIdsNearPoints "getNodeIdsNearPoints()" that
+we are going to use,
+if called with \b eps = 0.003, would return ids of close nodes #1, #3, #4 and #5.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_getNodeIdsNearPoints_2
+\b idsIndex returns [0, 1, 1, 4] which means that:
+- Point #0 is close to 1 (== \b idsIndex[1] - \b idsIndex[0]) node whose id is
+\b ids[ \b idsIndex[ 0 ]].
+- Point #1 is close to 0 (== \b idsIndex[2] - \b idsIndex[1]) nodes.
+- Point #2 is close to 3 (== \b idsIndex[3] - \b idsIndex[2]) nodes whose ids are
+\b ids[ \b idsIndex[ 2 ]], \b ids[ \b idsIndex[ 2 ] + 1 ] and \b ids[ \b idsIndex[ 2 ] + 2 ].
+
+
+\subsubsection cpp_mcpointset_findcommonnodes Finding coincident nodes
+
+First, we create a mesh with 6 nodes, of which two nodes (#3 and #4) are fully coincident
+and 3 nodes (#0, #2 and #5) have distance less than 0.004 between them.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_findCommonNodes_1
+Then, we use \ref ParaMEDMEM::MEDCouplingPointSet::findCommonNodes() "findCommonNodes()" to find
+coincident nodes, and check that (1) calling
+\ref ParaMEDMEM::MEDCouplingPointSet::findCommonNodes() "findCommonNodes()" with \b prec
+== 1e-13 finds the two fully coincident nodes only and (2)
+\ref ParaMEDMEM::MEDCouplingPointSet::findCommonNodes() "findCommonNodes"(0.004) finds 5
+equal nodes.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_findCommonNodes_2
+
+\section ExamplesArrays Arrays
+
+\subsection ExamplesArraysCreate Create
+
+\anchor BEGIN_PYTHON_ONLY
+\subsubsection MEDCouplingArraySteps0 Building an array from scratch in Python
+\anchor MEDCouplingArraySteps0Double
+<h3>Building a double array from scratch in Python</h3>
+
+Let's consider a list of floats \c dataDouble.
+
+\snippet MEDCouplingExamplesTest.py PySnippetDataArrayBuild1_0
+
+The easiest way to build the \ref ParaMEDMEM::DataArrayDouble "DataArrayDouble instance" called \c arrayDouble simply call :
+
+\snippet MEDCouplingExamplesTest.py PySnippetDataArrayBuild1_1bis
+
+An another way is to do that :
+
+\snippet MEDCouplingExamplesTest.py PySnippetDataArrayBuild1_1
+
+\anchor MEDCouplingArraySteps0Int
+<h3>Building an int array from scratch in Python</h3>
+
+Let's consider a list of ints \c dataInt.
+
+\snippet MEDCouplingExamplesTest.py PySnippetDataArrayBuild1_2
+
+The easiest way to build the \ref ParaMEDMEM::DataArrayInt "DataArrayInt instance" called \c arrayInt simply call :
+
+\snippet MEDCouplingExamplesTest.py PySnippetDataArrayBuild1_3bis
+
+An another way is to do that :
+
+\snippet MEDCouplingExamplesTest.py PySnippetDataArrayBuild1_3
+\anchor END_PYTHON_ONLY
+
+
+\anchor BEGIN_CPP_ONLY
+\subsubsection MEDCouplingArraySteps1 Building an array from scratch in C++
+
+In this example we will create arrays with 12 tuples constituted each
+of 3 components. These arrays will be created using different ways.\n
+
+The following code is only based using \ref ParaMEDMEM::DataArrayDouble "DataArrayDouble"
+but the use of \ref ParaMEDMEM::DataArrayInt "DataArrayInt" is strictly equivalent.
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippetDataArrayBuild1_0
+
+\anchor MEDCouplingArraySteps1NCNO
+<h3>Building an array from scratch in C++, no copy no ownership</h3>
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippetDataArrayBuild1_1
+
+\anchor MEDCouplingArraySteps1NCWCPPO
+<h3>Building an array from scratch in C++, no copy with C++ ownership</h3>
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippetDataArrayBuild1_2
+
+\anchor MEDCouplingArraySteps1NCWCO
+<h3>Building an array from scratch in C++, no copy with C ownership</h3>
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippetDataArrayBuild1_3
+
+\anchor MEDCouplingArraySteps1WC
+<h3>Building an array from scratch in C++, with copy</h3>
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippetDataArrayBuild1_4
+\anchor END_CPP_ONLY
+
+\anchor BEGIN_CPP_ONLY
+\subsubsection cpp_mcdataarray_copy Copy DataArrays
+
+\anchor cpp_mcdataarray_deepcopy
+<h3>Deep copy</h3>
+
+To perform a deep copy of a DataArray instance simply invoke :
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippetDataArrayBuild1_5
+
+or :
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippetDataArrayBuild1_5bis
+
+\c coordsArrCpy is the deep copy of \c coordsArr so they are independent and their *raw data* has been deeply copied.
+
+So it leads to the following behaviour :
+\anchor MEDCouplingArrayBasicsCopyDeepTestEqual
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippetDataArrayBuild1_6
+
+As \c coordsArrCpy is a copy object it needs to be deallocated in C++ like \c coordsArr.
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippetDataArrayBuild1_7
+
+\anchor cpp_mcdataarray_shallowcopy
+<h3>Shallow copy</h3>
+
+To perform a shallow copy of a DataArray instance simply invoke :
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippetDataArrayBuild1_8
+
+\c coordsArrCpy is the shallow copy of \c coordsArr so they share the same *raw data*. In reality they are the same object.
+So it leads to the following behaviour to compare with the deep copy :
+
+\anchor MEDCouplingArrayBasicsCopyShallowTestEqual
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippetDataArrayBuild1_9
+
+So here the content of \c coordsArr and \c coordsArrCpy are linked, contrary to the deep copy case.
+
+As \c coordsArrCpy is a copy object, in C++, it needs to be deallocated.
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippetDataArrayBuild1_10
+
+\anchor MEDCouplingArrayBasicsCopyDeepAssign
+<h3>Assignation by deep copy of DataArray</h3>
+
+We start by building a instance of ParaMEDMEM::DataArrayDouble allocated or not. Here, instance is not allocated, only built empty.
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippetDataArrayBuild1_11
+
+Then, \c coordsArrCpy is assigned with the content of \c coordsArr.
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippetDataArrayBuild1_12
+
+Then \c coordsArrCpy is a deep copy of \c coordsArr except that the instance of ParaMEDMEM::DataArrayDouble is those specified.
+But the behaviour is the same than those seen for \ref MEDCouplingArrayBasicsCopyDeepTestEqual "deep copy".
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippetDataArrayBuild1_13
+
+As always, in C++, \c coordsArrCpy is an object whose life cycle is fully independent from \c coordsArr so decrement is needed.
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippetDataArrayBuild1_14
+
+\anchor END_CPP_ONLY
+
+
+\subsubsection cpp_mcdataarrayint_buildpermutationarr Building a permutation array
+
+Here we create two arrays containing same values but in different order and then we use
+\ref ParaMEDMEM::DataArrayInt::buildPermutationArr "DataArrayInt::buildPermutationArr()" to get
+an array showing in what places the values of \b b array are located in \b a array.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_DataArrayInt_buildPermutationArr_1
+The result array \b c contains [1,0,4,2,3].
+
+
+\subsection ExamplesArraysModify Modify
+
+\subsubsection cpp_mcdataarrayint_invertarray Inverting renumbering maps
+
+\anchor cpp_mcdataarrayint_invertarrayo2n2n2o
+<h3> invertArrayO2N2N2O() </h3>
+
+In this example we create a DataArrayInt containing a renumbering map in
+"Old to New" mode, convert it into the renumbering map in "New to Old" mode and check the
+result.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_DataArrayInt_invertArrayO2N2N2O_1
+
+\anchor cpp_mcdataarrayint_invertarrayn2o2o2n
+<br><h3> invertArrayN2O2O2N() </h3>
+
+In this example we create a DataArrayInt containing a renumbering map in
+"New to Old" mode, convert it into the renumbering map in "Old to New" mode and check the
+result.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_DataArrayInt_invertArrayN2O2O2N_1
+
+
+\subsubsection py_mcdataarraydouble_setpartofvalues Set part of values of DataArrayDouble
+
+\anchor py_mcdataarraydouble_setselectedcomponents
+<h3> setSelectedComponents() </h3>
+First, we create a 'source' array.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setSelectedComponents1
+Now we create a larger zero array and assign the array \b da into it.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setSelectedComponents2
+As result contents of the array \b dv are as follows.
+<pre>
+Info of components : "a2" "a1" "v3" "v4"
+ Tuple #0 : 2 1 0 0
+ Tuple #1 : 4 3 0 0
+ Tuple #2 : 6 5 0 0
+ Tuple #3 : 0 0 0 0
+</pre>
+The same result can be achieved other way (except that component info
+is not copied):
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setSelectedComponents3
+
+\anchor py_mcdataarraydouble_setpartofvalues1
+<br><h3> setPartOfValues1() </h3>
+We create two arrays:
+- a "large" (4x4) zero array \b da to assign to and
+- a smaller (2x2) array \b dv filled with values [7.,8.,9.,10].
+
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValues1_1
+Now we copy \b dv to the middle of \b da.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValues1_2
+As result contents of the array \b da are as follows.
+<pre>
+ Info of components :"v1" "v2" "v3" "v4"
+ Tuple #0 : 0 0 0 0
+ Tuple #1 : 0 7 8 0
+ Tuple #2 : 0 9 10 0
+ Tuple #3 : 0 0 0 0
+</pre>
+
+Here we re-fill \b da with zeros and copy \b dv into a component of \b da.
+
+Note that the last parameter \b strictCompoCompare should be \c False
+in this case, else \ref ParaMEDMEM::DataArrayDouble::setPartOfValues1()
+throws an exception because \b da has 2 components but only one target
+component is specified.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValues1_3
+<pre>
+ Tuple #0 : 0 7 0 0
+ Tuple #1 : 0 8 0 0
+ Tuple #2 : 0 9 0 0
+ Tuple #3 : 0 10 0 0
+</pre>
+Below more two variants of location of target values are shown.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValues1_4
+<pre>
+ Tuple #0 : 0 0 0 0
+ Tuple #1 : 7 8 9 10
+ Tuple #2 : 0 0 0 0
+ Tuple #3 : 0 0 0 0
+</pre>
+
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValues1_5
+<pre>
+ Tuple #0 : 0 7 0 8
+ Tuple #1 : 0 0 0 0
+ Tuple #2 : 0 9 0 10
+ Tuple #3 : 0 0 0 0
+</pre>
+The same result can be achieved other way:
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValues1_6
+
+
+\anchor py_mcdataarraydouble_setpartofvaluessimple1
+<br><h3> setPartOfValuesSimple1() </h3>
+We create an array (4x4) \b da to assign to and define a value \b dv to assign.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValuesSimple1_1
+Now we assign \b dv to the middle of \b da.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValuesSimple1_2
+As result contents of the array \b da are as follows.
+<pre>
+ Tuple #0 : 0 0 0 0
+ Tuple #1 : 0 7 7 0
+ Tuple #2 : 0 7 7 0
+ Tuple #3 : 0 0 0 0
+</pre>
+
+Here we re-fill \b da with zeros and assign \b dv to a component of \b da.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValuesSimple1_3
+<pre>
+ Tuple #0 : 0 7 0 0
+ Tuple #1 : 0 7 0 0
+ Tuple #2 : 0 7 0 0
+ Tuple #3 : 0 7 0 0
+</pre>
+Below more two variants of location of target values are shown.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValuesSimple1_4
+<pre>
+ Tuple #0 : 0 0 0 0
+ Tuple #1 : 7 7 7 7
+ Tuple #2 : 0 0 0 0
+ Tuple #3 : 0 0 0 0
+</pre>
+
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValuesSimple1_5
+<pre>
+ Tuple #0 : 0 7 0 7
+ Tuple #1 : 0 0 0 0
+ Tuple #2 : 0 7 0 7
+ Tuple #3 : 0 0 0 0
+</pre>
+The same result can be achieved other way:
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValuesSimple1_6
+
+
+\anchor py_mcdataarraydouble_setpartofvaluessimple2
+<br><h3> setPartOfValuesSimple2() </h3>
+We create an array (4x4) \b da to assign to and define a value \b dv to assign.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValuesSimple2_1
+Now we assign \b dv to the middle of \b da.
+We explicitly specify tuples and component to assign to by a list [1,2].
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValuesSimple2_2
+As result contents of the array \b da are as follows.
+<pre>
+ Tuple #0 : 0 0 0 0
+ Tuple #1 : 0 7 7 0
+ Tuple #2 : 0 7 7 0
+ Tuple #3 : 0 0 0 0
+</pre>
+
+Here we re-fill \b da with zeros and assign \b dv to a component of \b da.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValuesSimple2_3
+<pre>
+ Tuple #0 : 0 7 0 0
+ Tuple #1 : 0 7 0 0
+ Tuple #2 : 0 7 0 0
+ Tuple #3 : 0 7 0 0
+</pre>
+Below more two variants of location of target values are shown.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValuesSimple2_4
+<pre>
+ Tuple #0 : 0 0 0 0
+ Tuple #1 : 7 7 7 7
+ Tuple #2 : 0 0 0 0
+ Tuple #3 : 0 0 0 0
+</pre>
+
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValuesSimple2_5
+<pre>
+ Tuple #0 : 0 7 0 7
+ Tuple #1 : 0 0 0 0
+ Tuple #2 : 0 7 0 7
+ Tuple #3 : 0 0 0 0
+</pre>
+\note \ref ParaMEDMEM::DataArrayDouble::setPartOfValuesSimple2() can't
+be explicitly called in Python.
+
+
+\anchor py_mcdataarraydouble_setpartofvaluessimple3
+<br><h3> setPartOfValuesSimple3() </h3>
+We create an array (4x4) \b da to assign to and define a value \b dv to assign.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValuesSimple3_1
+Now we assign \b dv to the middle of \b da.
+We explicitly specify tuples to assign to by a list [1,2]. And we specify
+components to assign to using slicing: 1:3.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValuesSimple3_2
+As result contents of the array \b da are as follows.
+<pre>
+ Tuple #0 : 0 0 0 0
+ Tuple #1 : 0 7 7 0
+ Tuple #2 : 0 7 7 0
+ Tuple #3 : 0 0 0 0
+</pre>
+
+Here we re-fill \b da with zeros and assign \b dv to a component of \b da.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValuesSimple3_3
+<pre>
+ Tuple #0 : 0 7 0 0
+ Tuple #1 : 0 7 0 0
+ Tuple #2 : 0 7 0 0
+ Tuple #3 : 0 7 0 0
+</pre>
+Below more two variants of location of target values are shown.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValuesSimple3_4
+<pre>
+ Tuple #0 : 0 0 0 0
+ Tuple #1 : 7 7 7 7
+ Tuple #2 : 0 0 0 0
+ Tuple #3 : 0 0 0 0
+</pre>
+
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValuesSimple3_5
+<pre>
+ Tuple #0 : 0 7 0 7
+ Tuple #1 : 0 0 0 0
+ Tuple #2 : 0 7 0 7
+ Tuple #3 : 0 0 0 0
+</pre>
+\note \ref ParaMEDMEM::DataArrayDouble::setPartOfValuesSimple3() can't
+be explicitly called in Python.
+
+
+\anchor py_mcdataarraydouble_setpartofvalues2
+<br><h3> setPartOfValues2() </h3>
+We create two arrays:
+- a "large" (4x7) zero array \b da to assign to,
+- a smaller (3x2) array \b dv filled with values [7.,8.,9.,10.,11.,12.].
+
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValues2_1
+Now we assign the two components of \b dv to the components of \b da
+with indices [1,3], and the 3 tuples of \b dv to the 3 tuples of \b da with
+ indices [0,1,2]. This is the first mode of usage.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValues2_2
+As result contents of the array \b da are as follows.
+<pre>
+ Tuple #0 : 0 7 0 8 0 0 0
+ Tuple #1 : 0 9 0 10 0 0 0
+ Tuple #2 : 0 11 0 12 0 0 0
+ Tuple #3 : 0 0 0 0 0 0 0
+</pre>
+Every value of \b dv has been assigned to its own location within \b da.
+
+Now we re-fill \b da with zeros and rearrange \b dv to have 6 components.
+And we assign \b dv to the tuples of \b da with indices [0,2,3] .
+This is the second mode of usage.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValues2_3
+The contents of \b dv have been assigned to each of specified tuples of \b da.
+Every value of \b dv is repeated in the 3 specified tuples within \b da.
+<pre>
+ Tuple #0 : 7 0 8 9 10 11 12
+ Tuple #1 : 0 0 0 0 0 0 0
+ Tuple #2 : 7 0 8 9 10 11 12
+ Tuple #3 : 7 0 8 9 10 11 12
+</pre>
+\note \ref ParaMEDMEM::DataArrayDouble::setPartOfValues2() can't
+be explicitly called in Python.
+
+
+\anchor py_mcdataarraydouble_setpartofvalues3
+<br><h3> setPartOfValues3() </h3>
+We create two arrays:
+- a "large" (4x7) zero array \b da to assign to,
+- a smaller (3x2) array \b dv filled with values [7.,8.,9.,10.,11.,12.].
+
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValues3_1
+Now we assign the two components of \b dv to the components of \b da
+with indices [1,3], and the 3 tuples of \b dv to the 3 tuples of \b da with
+indices [0,1,2] which are specified using slicing: "0:3".
+This is the first mode of usage.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValues3_2
+As result contents of the array \b da are as follows.
+<pre>
+ Tuple #0 : 0 7 0 8 0 0 0
+ Tuple #1 : 0 9 0 10 0 0 0
+ Tuple #2 : 0 11 0 12 0 0 0
+ Tuple #3 : 0 0 0 0 0 0 0
+</pre>
+Every value of \b dv has been assigned to its own location within \b da.
+
+Now we re-fill \b da with zeros and rearrange \b dv to have 6 components.
+And we assign \b dv to the tuples of \b da with indices [0,2] using \a
+slice notation "0:4:2". This is the second mode of usage.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValues3_3
+The contents of \b dv have been assigned to each of specified tuples of \b da.
+Every value of \b dv is repeated in the 3 specified tuples within \b da.
+<pre>
+ Tuple #0 : 7 0 8 9 10 11 12
+ Tuple #1 : 0 0 0 0 0 0 0
+ Tuple #2 : 7 0 8 9 10 11 12
+ Tuple #3 : 0 0 0 0 0 0 0
+</pre>
+\note \ref ParaMEDMEM::DataArrayDouble::setPartOfValues3() can't
+be explicitly called in Python.
+
+
+\subsubsection py_mcdataarrayint_setpartofvalues Set part of values of DataArrayInt
+
+\anchor py_mcdataarrayint_setselectedcomponents
+<h3> setSelectedComponents() </h3>
+First, we create a 'source' array.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setSelectedComponents1
+Now we create a larger zero array and assign the array \b da to it.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setSelectedComponents2
+As result contents of the array \b dv are as follows.
+<pre>
+Info of components : "a2" "a1" "v3" "v4"
+ Tuple #0 : 2 1 0 0
+ Tuple #1 : 4 3 0 0
+ Tuple #2 : 6 5 0 0
+ Tuple #3 : 0 0 0 0
+</pre>
+The same result can be achieved other way (except that component info
+is not copied):
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setSelectedComponents3
+
+\anchor py_mcdataarrayint_setpartofvalues1
+<br><h3> setPartOfValues1() </h3>
+We create two arrays:
+- a "large" (4x4) zero array \b da to assign to, and
+- a smaller (2x2) array \b dv filled with values [7,8,9,10].
+
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValues1_1
+Now we copy \b dv to the middle of \b da.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValues1_2
+As result contents of the array \b da are as follows.
+<pre>
+ Info of components :"v1" "v2" "v3" "v4"
+ Tuple #0 : 0 0 0 0
+ Tuple #1 : 0 7 8 0
+ Tuple #2 : 0 9 10 0
+ Tuple #3 : 0 0 0 0
+</pre>
+
+Here we re-fill \b da with zeros and copy \b dv into a component of \b da.
+
+Note that the last parameter \b strictCompoCompare should be \c False
+in this case, else \ref ParaMEDMEM::DataArrayInt::setPartOfValues1()
+throws an exception because \b da has 2 components but only one target
+component is specified.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValues1_3
+<pre>
+ Tuple #0 : 0 7 0 0
+ Tuple #1 : 0 8 0 0
+ Tuple #2 : 0 9 0 0
+ Tuple #3 : 0 10 0 0
+</pre>
+Below more two variants of location of target values are shown.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValues1_4
+<pre>
+ Tuple #0 : 0 0 0 0
+ Tuple #1 : 7 8 9 10
+ Tuple #2 : 0 0 0 0
+ Tuple #3 : 0 0 0 0
+</pre>
+
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValues1_5
+<pre>
+ Tuple #0 : 0 7 0 8
+ Tuple #1 : 0 0 0 0
+ Tuple #2 : 0 9 0 10
+ Tuple #3 : 0 0 0 0
+</pre>
+The same result can be achieved other way:
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValues1_6
+
+
+
+\anchor py_mcdataarrayint_setpartofvaluessimple1
+<br><h3> setPartOfValuesSimple1() </h3>
+We create an array (4x4) \b da to assign to and define a value \b dv to assign.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValuesSimple1_1
+Now we assign \b dv to the middle of \b da.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValuesSimple1_2
+As result contents of the array \b da are as follows.
+<pre>
+ Tuple #0 : 0 0 0 0
+ Tuple #1 : 0 7 7 0
+ Tuple #2 : 0 7 7 0
+ Tuple #3 : 0 0 0 0
+</pre>
+
+Here we re-fill \b da with zeros and assign \b dv to a component of \b da.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValuesSimple1_3
+<pre>
+ Tuple #0 : 0 7 0 0
+ Tuple #1 : 0 7 0 0
+ Tuple #2 : 0 7 0 0
+ Tuple #3 : 0 7 0 0
+</pre>
+Below more two variants of location of target values are shown.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValuesSimple1_4
+<pre>
+ Tuple #0 : 0 0 0 0
+ Tuple #1 : 7 7 7 7
+ Tuple #2 : 0 0 0 0
+ Tuple #3 : 0 0 0 0
+</pre>
+
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValuesSimple1_5
+<pre>
+ Tuple #0 : 0 7 0 7
+ Tuple #1 : 0 0 0 0
+ Tuple #2 : 0 7 0 7
+ Tuple #3 : 0 0 0 0
+</pre>
+The same result can be achieved other way:
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValuesSimple1_6
+
+
+\anchor py_mcdataarrayint_setpartofvaluessimple2
+<br><h3> setPartOfValuesSimple2() </h3>
+We create an array (4x4) \b da to assign to and define a value \b dv to assign.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValuesSimple2_1
+Now we assign \b dv to the middle of \b da.
+We explicitly specify tuples and component to assign to by a list [1,2].
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValuesSimple2_2
+As result contents of the array \b da are as follows.
+<pre>
+ Tuple #0 : 0 0 0 0
+ Tuple #1 : 0 7 7 0
+ Tuple #2 : 0 7 7 0
+ Tuple #3 : 0 0 0 0
+</pre>
+
+Here we re-fill \b da with zeros and assign \b dv to a component of \b da.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValuesSimple2_3
+<pre>
+ Tuple #0 : 0 7 0 0
+ Tuple #1 : 0 7 0 0
+ Tuple #2 : 0 7 0 0
+ Tuple #3 : 0 7 0 0
+</pre>
+Below more two variants of location of target values are shown.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValuesSimple2_4
+<pre>
+ Tuple #0 : 0 0 0 0
+ Tuple #1 : 7 7 7 7
+ Tuple #2 : 0 0 0 0
+ Tuple #3 : 0 0 0 0
+</pre>
+
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValuesSimple2_5
+<pre>
+ Tuple #0 : 0 7 0 7
+ Tuple #1 : 0 0 0 0
+ Tuple #2 : 0 7 0 7
+ Tuple #3 : 0 0 0 0
+</pre>
+\note \ref ParaMEDMEM::DataArrayInt::setPartOfValuesSimple2() can't
+be explicitly called in Python.
+
+
+\anchor py_mcdataarrayint_setpartofvaluessimple3
+<br><h3> setPartOfValuesSimple3() </h3>
+We create an array (4x4) \b da to assign to and define a value \b dv to assign.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValuesSimple3_1
+Now we assign \b dv to the middle of \b da.
+We explicitly specify tuples to assign to by a list [1,2]. And we specify
+components to assign to using slicing: 1:3.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValuesSimple3_2
+As result contents of the array \b da are as follows.
+<pre>
+ Tuple #0 : 0 0 0 0
+ Tuple #1 : 0 7 7 0
+ Tuple #2 : 0 7 7 0
+ Tuple #3 : 0 0 0 0
+</pre>
+
+Here we re-fill \b da with zeros and assign \b dv to a component of \b da.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValuesSimple3_3
+<pre>
+ Tuple #0 : 0 7 0 0
+ Tuple #1 : 0 7 0 0
+ Tuple #2 : 0 7 0 0
+ Tuple #3 : 0 7 0 0
+</pre>
+Below more two variants of location of target values are shown.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValuesSimple3_4
+<pre>
+ Tuple #0 : 0 0 0 0
+ Tuple #1 : 7 7 7 7
+ Tuple #2 : 0 0 0 0
+ Tuple #3 : 0 0 0 0
+</pre>
+
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValuesSimple3_5
+<pre>
+ Tuple #0 : 0 7 0 7
+ Tuple #1 : 0 0 0 0
+ Tuple #2 : 0 7 0 7
+ Tuple #3 : 0 0 0 0
+</pre>
+\note \ref ParaMEDMEM::DataArrayInt::setPartOfValuesSimple3() can't
+be explicitly called in Python.
+
+
+\anchor py_mcdataarrayint_setpartofvalues2
+<br><h3> setPartOfValues2() </h3>
+We create two arrays:
+- a "large" (4x7) zero array \b da to assign to,
+- a smaller (3x2) array \b dv filled with values [7,8,9,10,11,12].
+
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValues2_1
+Now we assign the two components of \b dv to the components of \b da
+with indices [1,3], and the 3 tuples of \b dv to the 3 tuples of \b da with
+ indices [0,1,2]. This is the first mode of usage.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValues2_2
+As result contents of the array \b da are as follows.
+<pre>
+ Tuple #0 : 0 7 0 8 0 0 0
+ Tuple #1 : 0 9 0 10 0 0 0
+ Tuple #2 : 0 11 0 12 0 0 0
+ Tuple #3 : 0 0 0 0 0 0 0
+</pre>
+Every value of \b dv has been assigned to its own location within \b da.
+
+Now we re-fill \b da with zeros and rearrange \b dv to have 6 components.
+And we assign \b dv to the tuples of \b da with indices [0,2,3] .
+This is the second mode of usage.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValues2_3
+The contents of \b dv have been assigned to each of specified tuples of \b da.
+Every value of \b dv is repeated in the 3 specified tuples within \b da.
+<pre>
+ Tuple #0 : 7 0 8 9 10 11 12
+ Tuple #1 : 0 0 0 0 0 0 0
+ Tuple #2 : 7 0 8 9 10 11 12
+ Tuple #3 : 7 0 8 9 10 11 12
+</pre>
+\note \ref ParaMEDMEM::DataArrayInt::setPartOfValues2() can't
+be explicitly called in Python.
+
+
+\anchor py_mcdataarrayint_setpartofvalues3
+<br><h3> setPartOfValues3() </h3>
+We create two arrays:
+- a "large" (4x7) zero array \b da to assign to,
+- a smaller (3x2) array \b dv filled with values [7,8,9,10,11,12].
+
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValues3_1
+Now we assign the two components of \b dv to the components of \b da
+with indices [1,3], and the 3 tuples of \b dv to the 3 tuples of \b da with
+indices [0,1,2] which are specified using slicing: "0:3".
+This is the first mode of usage.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValues3_2
+As result contents of the array \b da are as follows.
+<pre>
+ Tuple #0 : 0 7 0 8 0 0 0
+ Tuple #1 : 0 9 0 10 0 0 0
+ Tuple #2 : 0 11 0 12 0 0 0
+ Tuple #3 : 0 0 0 0 0 0 0
+</pre>
+Every value of \b dv has been assigned to its own location within \b da.
+
+Now we re-fill \b da with zeros and rearrange \b dv to have 6 components.
+And we assign \b dv to the tuples of \b da with indices [0,2] using \a
+slice notation "0:4:2". This is the second mode of usage.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValues3_3
+The contents of \b dv have been assigned to each of specified tuples of \b da.
+Every value of \b dv is repeated in the 3 specified tuples within \b da.
+<pre>
+ Tuple #0 : 7 0 8 9 10 11 12
+ Tuple #1 : 0 0 0 0 0 0 0
+ Tuple #2 : 7 0 8 9 10 11 12
+ Tuple #3 : 0 0 0 0 0 0 0
+</pre>
+\note \ref ParaMEDMEM::DataArrayInt::setPartOfValues3() can't
+be explicitly called in Python.
+
+
+\subsubsection py_mcdataarraydouble_getdifferentvalues Excluding coincident tuples from DataArrayDouble
+
+The code below creates an array of real values and than an array of
+ unique values, not closer one to another than 0.2, is retrieved from it.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_getDifferentValues1
+
+
+\subsubsection cpp_mcdataarraydouble_meldwith Concatenating DataArrayDouble's by appending components
+
+In this example we create two data arrays including \b same number of
+tuples and then we concatenate them using \ref
+ParaMEDMEM::DataArrayDouble::meldWith "meldWith()".
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_DataArrayDouble_Meld1_1
+Now the array \b da1 includes 7 tuples (as before) of 3 components
+each. Its components are: "c0da1","c1da1","c0da2".
+
+
+\subsubsection cpp_mcdataarrayint_meldwith Concatenating DataArrayInt's by appending components
+
+In this example we create two data arrays including \b same number of
+tuples and then we concatenate them using \ref
+ParaMEDMEM::DataArrayInt::meldWith "meldWith()".
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_DataArrayInt_Meld1_1
+Now the array \b da1 includes 7 tuples (as before) of 3 components
+each. Its components are: "c0da1","c1da1","c0da2".
+
+
+\subsection ExamplesArraysAccess Access
+
+\subsubsection cpp_mcdataarrayint_getTuple Getting a tuple of DataArrayInt
+
+In this simple example we create an array of integers arranged into 3
+tuples per 2 components, and finally print the second tuple.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_getTuple_1
+The output is
+<pre> [9, 10] </pre>
+Note that we can traverse all tuples in the array by simply iterating
+over it as the code below does.
+\snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_getTuple_2
+Its output follows.
+<pre>
+(7, 8)
+(9, 10)
+(11, 12)
+</pre>
+
+
+\subsubsection cpp_mcdataarraydouble_getidsinrange Finding values in range in DataArrayDouble
+
+In this example we create an array \b da containing same values as ones returned by
+\c range( \c 10 ). Then we get an array of indices of values of \b da being in
+range [ 2.5, 6 ].
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_DataArrayDouble_getIdsInRange_1
+As result contents of the array \b da2 are as follows.
+<pre>
+ Tuple #0 : 3
+ Tuple #1 : 4
+ Tuple #2 : 5
+ Tuple #3 : 6
+</pre>
+
+
+\subsubsection cpp_mcdataarraydouble_findcommontuples Finding coincident tuples in DataArrayDouble
+
+Let's create an array of 6 tuples and 2 components that can be
+ considered as coordinates of 6 points in 2D space.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_DataArrayDouble_findCommonTuples1
+Now we find points that are not far each from other than 1e-1.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_DataArrayDouble_findCommonTuples2
+As we can realize from the above code, a hardcoded array \b expected3 is equal
+ to the raw data of a DataArrayInt \b c and a hardcoded array \b expected4 is equal
+ to the raw data of the DataArrayInt \b cI.
+
+The array \b c contains indices of 5 coincident points. The array \b
+ cI shows us boundaries of (cI->getNumberOfTuples()-1) = 2 groups of coincident points:
+- The first group starts at index 0 and includes (3 - 0) = 3 points: 0,3,4.
+- The second group starts at index 3 and includes (5 - 3) = 2 points: 1,2.
+
+
+\subsubsection py_mcdataarraydouble_KeepSelectedComponents Creation of a sub-part of the DataArrayDouble by selecting components
+
+\snippet MEDCouplingExamplesTest.py SnippeDataArrayDoubleKeepSelectedComponents1_1
+We created an array \b a1 containing 5 tuples of 4 components each (20
+values). Now we are going to create an array \b a2 containing some
+components of \b a1.
+\snippet MEDCouplingExamplesTest.py SnippeDataArrayDoubleKeepSelectedComponents1_2
+Now each tuple of \b a2 includes components named "b","c","b","c","a","a". Thus
+the result array \b a2 includes 30 elements (5 tuples per 6 components).
+
+
+\subsubsection py_mcdataarrayint_keepselectedcomponents Creation of a sub-part of the DataArrayInt by selecting components
+
+\snippet MEDCouplingExamplesTest.py SnippeDataArrayIntKeepSelectedComponents1_1
+We created an array \b a1 containing 5 tuples of 4 components each (20
+values). Now we are going to create an array \b a2 containing some
+components of \b a1.
+\snippet MEDCouplingExamplesTest.py SnippeDataArrayIntKeepSelectedComponents1_2
+Now each tuple of \b a2 includes components named "b","c","b","c","a","a". Thus
+the result array \b a2 includes 30 elements (5 tuples per 6 components).
+
+Note that
+\ref ParaMEDMEM::DataArrayInt::keepSelectedComponents() "DataArrayInt::keepSelectedComponents()"
+is called, providing the same result, by the following python code:
+\snippet MEDCouplingExamplesTest.py SnippeDataArrayIntKeepSelectedComponents1_3
+
+\section ExamplesOther Other
+
+\subsection ExamplesOtherInputOutput Input/Output
+
+\subsubsection cpp_mcfielddouble_WriteVTK Writing fields in a VTK file
+
+In this example we
+- create an 2D mesh and 3 fields on it,
+- use
+\ref ParaMEDMEM::MEDCouplingFieldDouble::WriteVTK "WriteVTK()"
+to write all the fields and the mesh to a VTK file.
+
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_WriteVTK_1
+
+
+\anchor BEGIN_PYTHON_ONLY
+\subsubsection MEDLoaderExample2 Loading a mesh using basic API
+
+Consider a mesh called "Example2" in file "file2.med"
+containing MED_POLYHEDRA, MED_TETRA4, MED_QUAD8, MED_TRI6, MED_SEG2
+and MED_POINT1. In this case you will have :
+
+\snippet MEDLoaderExamplesTest.py PySnippetMeshAdvAPI1_8
+
+To get 3D cells (MED_POLYHEDRA and MED_TETRA4) you should type :
+
+\snippet MEDLoaderExamplesTest.py PySnippetMeshAdvAPI1_7
+
+To get 2D cells (MED_TRI6 and MED_QUAD8) you should type :
+
+\snippet MEDLoaderExamplesTest.py PySnippetMeshAdvAPI1_4
+
+To get 1D cells (MED_SEG2) you should type :
+
+\snippet MEDLoaderExamplesTest.py PySnippetMeshAdvAPI1_5
+
+And finally for 0D cells (MED_POINT1) you will write :
+
+\snippet MEDLoaderExamplesTest.py PySnippetMeshAdvAPI1_6
+
+\anchor END_PYTHON_ONLY
+
+
+\anchor BEGIN_PYTHON_ONLY
+\subsubsection py_mcumesh_writefile_onemesh_basic Writing one mesh using basic API
+
+To write one mesh \b myMesh with name \b "myMeshName" in a MED file \b "wfile1.med" the following code should be typed :
+
+\snippet MEDLoaderExamplesTest.py PySnippetMeshAdvAPI1_1
+
+With the previous code, if "wFile1.med" file exists the file is
+crashed and will contain after the call only the contents of myMesh
+instance.
+
+If you want to append a mesh in "wFile1.med" you should type :
+
+\snippet MEDLoaderExamplesTest.py PySnippetMeshAdvAPI1_2
+
+With the previous code, if the "wFile1.med" has already a mesh called "myMeshName" an
+INTERP_KERNEL::Exception will be thrown.
+\anchor END_PYTHON_ONLY
+
+
+\anchor BEGIN_CPP_ONLY
+\subsubsection cpp_mcumesh_loadfile Loading a mesh using advanced API
+
+\code
+
+const char fileName[]=...
+const char meshName[]=...
+MEDFileUMesh *medmesh=MEDFileUMesh::New(fileName,meshName)
+std::vector<int> nel=medmesh->getNonEmptyLevels()
+if(nel.size()<1)
+ throw INTERP_KERNEL::Exception("The test is not good for my file ! Expecting a multi level mesh to play with !")
+MEDCouplingUMesh *m0=medmesh->getMeshAtLevel(nel[1],false)
+MEDCouplingUMesh *g1=medmesh->getGroup(nel[1],"mesh2",false)
+DataArrayInt *dag1=medmesh->getGroupArr(nel[1],"mesh2",false)
+MEDCouplingUMesh *g1bis=m0->buildPartOfMySelf(dag1->getConstPointer(),dag1->getConstPointer()+dag1->getNbOfElems())
+g1bis->setName(dag1->getName())
+if(!g1->isEqual(g1bis,1e-12))
+ throw INTERP_KERNEL::Exception("hmmmm :g1 and g1bis should be equal...")
+//
+dag1->decrRef()
+g1->decrRef()
+m0->decrRef()
+medmesh->decrRef()
+
+\endcode
+\anchor END_CPP_ONLY
+
+\anchor BEGIN_CPP_ONLY
+\subsubsection cpp_mcumesh_writefile Writing a mesh using advanced API
+
+\code
+
+MEDCouplingUMesh *m=... //m is a mesh with meshDim=2 spaceDim=2
+MEDCouplingUMesh *m1=... //m1 is a mesh with meshDim=1 spaceDim=2 same coords than m
+MEDCouplingUMesh *m2=... //m2 is a mesh with meshDim=0 spaceDim=2 same coords than m
+MEDFileUMesh *mm=MEDFileUMesh::New()
+mm->setName("mm")//name needed to be non empty
+mm->setDescription("Description mm")
+mm->setCoords(m1->getCoords())
+mm->setMeshAtLevel(-1,m1,false)
+mm->setMeshAtLevel(0,m,false)
+mm->setMeshAtLevel(-2,m2,false)
+DataArrayInt *g1=DataArrayInt::New()
+g1->alloc(2,1)
+g1->setName("G1")
+const int val1[2]={1,3}
+std::copy(val1,val1+2,g1->getPointer())
+DataArrayInt *g2=DataArrayInt::New()
+g2->alloc(3,1)
+g2->setName("G2")
+const int val2[3]={1,2,3}
+std::copy(val2,val2+3,g2->getPointer())
+//
+std::vector<const DataArrayInt *> grps(2)
+grps[0]=g1 grps[1]=g2
+mm->setGroupsAtLevel(0,grps,false)
+//
+g2->decrRef()
+g1->decrRef()
+//
+mm->write(2)
+
+\endcode
+\anchor END_CPP_ONLY
+
+
+\anchor BEGIN_PYTHON_ONLY
+\subsubsection py_mcfield_loadfile_onetimestep_basic Reading a field at one time step using basic API
+So to retrieve a field on 3D cell called "F1Cell" in example file
+"file2.med" on a mesh "Example2" (\ref MEDLoaderExample2 "as defined here") on time
+step defined by iteration number 2 and iteration 3 the request will be :
+
+\snippet MEDLoaderExamplesTest.py PySnippetMeshAdvAPI1_12
+
+To retrieve the same field (same iteration) on 2D cells only the call will be :
+
+\snippet MEDLoaderExamplesTest.py PySnippetMeshAdvAPI1_13
+\anchor END_PYTHON_ONLY
+
+
+\anchor BEGIN_PYTHON_ONLY
+\subsubsection py_mcfield_loadfile_alltimesteps_basic Reading a field at all time steps using basic API
+
+It is typically recommended to use the following
+code when you want to load all time steps of a field on cell "myField" lying on
+same mesh "mesh1" in one shot :
+
+\snippet MEDLoaderExamplesTest.py PySnippetMeshAdvAPI1_11
+
+\anchor END_PYTHON_ONLY
+
+
+
+\anchor BEGIN_PYTHON_ONLY
+\subsubsection py_mcfield_loadfile_allentities Reading a field on all entities using advanced API
+
+Let's read a field on all entity called \a fieldName lying on a mesh called \a meshName in a MED file called \a fname at a iteration defined on time step defined
+by \a iteration and \a order.
+
+\snippet MEDLoaderExamplesTest.py PySnippetReadFieldOnAllEntity1_1
+
+To read it there are 3 main approaches :
+
+- Use ParaMEDMEM::MEDFileField1TS class :
+
+\snippet MEDLoaderExamplesTest.py PySnippetReadFieldOnAllEntity1_3
+
+- Use ParaMEDMEM::MEDFileFieldMultiTS class :
+
+\snippet MEDLoaderExamplesTest.py PySnippetReadFieldOnAllEntity1_4
+
+- Use iteration ParaMEDMEM::MEDFileFieldMultiTS class :
+
+\snippet MEDLoaderExamplesTest.py PySnippetReadFieldOnAllEntity1_5
+
+\anchor END_PYTHON_ONLY
+
+
+
+\anchor BEGIN_PYTHON_ONLY
+\subsubsection py_mcfield_loadfile_partial Reading a partial field using advanced API
+
+Let's read a partial field called \a fieldName lying on a mesh called \a meshName in a MED file called \a fname at a iteration defined on time step defined
+by \a iteration and \a order.
+
+\snippet MEDLoaderExamplesTest.py PySnippetReadFieldPartial1_1
+
+Fields defined partially on a meshes can been read using 2 main approaches :
+
+- Either the user wants to retrieve it's field in %MEDCoupling sense, that is to say for interpolation, to evaluate such field on different points...
+\n In this mode the link with the whole mesh is not useful for the user
+
+\snippet MEDLoaderExamplesTest.py PySnippetReadFieldPartial1_3
+
+- Or the user wants to retrieve the binding (cell ids or node ids) with the whole mesh on which the partial field lies partially on.
+
+\snippet MEDLoaderExamplesTest.py PySnippetReadFieldPartial1_4
+
+\ref medcoupling "MEDCoupling" allows to make bridges between the approaches. For example \a pfl \ref ParaMEDMEM::DataArrayInt "DataArrayInt instance" retrieved directly
+from the file in the second approach can be retrieved starting from first approach.
+
+Starting from mesh \a firstApproachMesh of read field in first approach \a fread, whith the whole mesh \a wholeMesh the profile \a pflComputed can be computed :
+
+\snippet MEDLoaderExamplesTest.py PySnippetReadFieldPartial1_5
+
+Inversely, it is possible to rebuild field obtained in first approach starting from second approach :
+
+\snippet MEDLoaderExamplesTest.py PySnippetReadFieldPartial1_6
+
+\anchor END_PYTHON_ONLY
+
+
+\anchor BEGIN_PYTHON_ONLY
+\subsubsection py_mcfield_writefile_severaltimesteps_basic Writing several time steps of a field using basic API
+
+To write a serie of time steps in a "file3.med" file lying on the same
+unstructured mesh the typical code
+to write is the following :
+
+\snippet MEDLoaderExamplesTest.py PySnippetMeshAdvAPI1_3
+
+In the above code, it is important to note that the values of pairs
+(iteration,order) should be different between two calls to avoid that
+a call to MEDLoader::WriteFieldUsingAlreadyWrittenMesh overwrites a
+previous call.
+Another important thing is the fact that \c f.getMesh() is not modified.
+This write method presents the big advantage to be fast, because
+neither check nor read is performed. That's why the parameter of \b writeFromScratch
+is not needed here, contrary
+to other MEDLoader::Write* methods.
+
+\anchor END_PYTHON_ONLY
+
+
+\anchor BEGIN_PYTHON_ONLY
+\subsubsection py_mcfield_writefile_allentities Writing a field defined on all entities using advanced API
+
+Let's write a cell field on all entities called \a fieldName lying on a mesh called \a meshName in a MED file called \a fname at a iteration defined on time step defined
+by \a iteration and \a order.
+
+\snippet MEDLoaderExamplesTest.py PySnippetWriteFieldOnAllEntity1_2
+
+We can see here that the necessity to deal with both mesh and field to write a field is exposed by the API. The mesh write mode is 2 to tell to MED file that is file already exists to scratch it.
+The mode of write is 0 to simply add to the file the field specific part.
+
+\anchor END_PYTHON_ONLY
+
+
+\anchor BEGIN_PYTHON_ONLY
+\subsubsection py_mcfield_writefile_partial Writing a partial field using advanced API
+
+\snippet MEDLoaderExamplesTest.py PySnippetWriteFieldPartial1_2
+
+To write a partial field \a f can have a **null mesh**, because the link with mesh is made given the entry of \a mm MEDFileField1TS::setFieldProfile method.
+
+\anchor END_PYTHON_ONLY
+
+*/
{
}
-ExprParser::ExprParser(const char *expr, ExprParser *father):_father(father),_is_parsed(false),_leaf(0),_is_parsing_ok(false),_expr(expr)
+ExprParser::ExprParser(const std::string& expr, ExprParser *father):_father(father),_is_parsed(false),_leaf(0),_is_parsing_ok(false),_expr(expr)
{
_expr=deleteWhiteSpaces(_expr);
}
class ExprParser
{
public:
- INTERPKERNEL_EXPORT ExprParser(const char *expr, ExprParser *father=0);
+ INTERPKERNEL_EXPORT ExprParser(const std::string& expr, ExprParser *father=0);
INTERPKERNEL_EXPORT ExprParser(const char *expr, int lgth, ExprParser *father=0);
INTERPKERNEL_EXPORT ~ExprParser();
INTERPKERNEL_EXPORT void parse();
int interpolateMeshes(const MyMeshType& meshS, const MyMeshType& meshT, MatrixType& result)
{ return asLeaf().interpolateMeshes(meshS,meshT,result); }
template<class MyMeshType, class MatrixType>
- int fromIntegralUniform(const MyMeshType& meshT, MatrixType& result, const char *method) { return fromToIntegralUniform(false,meshT,result,method); }
+ int fromIntegralUniform(const MyMeshType& meshT, MatrixType& result, const std::string& method) { return fromToIntegralUniform(false,meshT,result,method); }
template<class MyMeshType, class MatrixType>
- int toIntegralUniform(const MyMeshType& meshS, MatrixType& result, const char *method) { return fromToIntegralUniform(true,meshS,result,method); }
+ int toIntegralUniform(const MyMeshType& meshS, MatrixType& result, const std::string& method) { return fromToIntegralUniform(true,meshS,result,method); }
template<class MyMeshType>
static double CalculateCharacteristicSizeOfMeshes(const MyMeshType& myMeshS, const MyMeshType& myMeshT, const int printLevel);
protected:
template<class MyMeshType, class MatrixType>
- int fromToIntegralUniform(bool fromTo, const MyMeshType& mesh, MatrixType& result, const char *method);
+ int fromToIntegralUniform(bool fromTo, const MyMeshType& mesh, MatrixType& result, const std::string& method);
protected:
TrueMainInterpolator& asLeaf() { return static_cast<TrueMainInterpolator&>(*this); }
};
{
template<class TrueMainInterpolator>
template<class MyMeshType, class MatrixType>
- int Interpolation<TrueMainInterpolator>::fromToIntegralUniform(bool fromTo, const MyMeshType& mesh, MatrixType& result, const char *method)
+ int Interpolation<TrueMainInterpolator>::fromToIntegralUniform(bool fromTo, const MyMeshType& mesh, MatrixType& result, const std::string& method)
{
typedef typename MyMeshType::MyConnType ConnType;
- std::string methodCPP(method);
int ret=-1;
- if(methodCPP=="P0")
+ if(method=="P0")
{
IntegralUniformIntersectorP0<MyMeshType,MatrixType> intersector(mesh,InterpolationOptions::getMeasureAbsStatus());
intersector.setFromTo(fromTo);
intersector.intersectCells(0,tmp,result);
ret=intersector.getNumberOfColsOfResMatrix();
}
- else if(methodCPP=="P1")
+ else if(method=="P1")
{
IntegralUniformIntersectorP1<MyMeshType,MatrixType> intersector(mesh,InterpolationOptions::getMeasureAbsStatus());
intersector.setFromTo(fromTo);
// Main function to interpolate triangular and quadratic meshes
template<class MyMeshType, class MatrixType>
- int interpolateMeshes(const MyMeshType& meshS, const MyMeshType& meshT, MatrixType& result, const char *method);
+ int interpolateMeshes(const MyMeshType& meshS, const MyMeshType& meshT, MatrixType& result, const std::string& method);
DuplicateFacesType retrieveDuplicateFaces() const
{
return _duplicate_faces;
*
*/
template<class MyMeshType, class MatrixType>
- int Interpolation2D1D::interpolateMeshes(const MyMeshType& myMeshS, const MyMeshType& myMeshT, MatrixType& result, const char *method)
+ int Interpolation2D1D::interpolateMeshes(const MyMeshType& myMeshS, const MyMeshType& myMeshT, MatrixType& result, const std::string& method)
{
static const int SPACEDIM=MyMeshType::MY_SPACEDIM;
typedef typename MyMeshType::MyConnType ConnType;
Interpolation3D();
Interpolation3D(const InterpolationOptions& io);
template<class MyMeshType, class MatrixType>
- int interpolateMeshes(const MyMeshType& srcMesh, const MyMeshType& targetMesh, MatrixType& result, const char *method);
+ int interpolateMeshes(const MyMeshType& srcMesh, const MyMeshType& targetMesh, MatrixType& result, const std::string& method);
private:
SplittingPolicy _splitting_policy;
};
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// Author : Anthony Geay (CEA/DEN)
+
#ifndef __INTERPOLATION3D_TXX__
#define __INTERPOLATION3D_TXX__
*
*/
template<class MyMeshType, class MatrixType>
- int Interpolation3D::interpolateMeshes(const MyMeshType& srcMesh, const MyMeshType& targetMesh, MatrixType& result, const char *method)
+ int Interpolation3D::interpolateMeshes(const MyMeshType& srcMesh, const MyMeshType& targetMesh, MatrixType& result, const std::string& method)
{
typedef typename MyMeshType::MyConnType ConnType;
// create MeshElement objects corresponding to each element of the two meshes
int interpolateMeshes(const MyMeshType& srcMesh,
const MyMeshType& targetMesh,
MyMatrixType& matrix,
- const char *method);
+ const std::string& method);
INTERPKERNEL_EXPORT DuplicateFacesType retrieveDuplicateFaces() const { return _duplicate_faces; }
private:
SplittingPolicy _splitting_policy;
int Interpolation3D2D::interpolateMeshes(const MyMeshType& srcMesh,
const MyMeshType& targetMesh,
MyMatrixType& matrix,
- const char *method)
+ const std::string& method)
{
typedef typename MyMeshType::MyConnType ConnType;
// create MeshElement objects corresponding to each element of the two meshes
// Main function to interpolate
template<class MyMeshType, class MatrixType>
int interpolateMeshes(const MyMeshType& meshS, const MyMeshType& meshT,
- MatrixType& result, const char *method);
+ MatrixType& result, const std::string& method);
};
}
*/
template<class RealCurve>
template<class MyMeshType, class MatrixType>
- int InterpolationCurve<RealCurve>::interpolateMeshes (const MyMeshType& myMeshS,
- const MyMeshType& myMeshT,
- MatrixType& result,
- const char * method)
+ int InterpolationCurve<RealCurve>::interpolateMeshes (const MyMeshType& myMeshS,
+ const MyMeshType& myMeshT,
+ MatrixType& result,
+ const std::string& method)
{
static const int SPACEDIM=MyMeshType::MY_SPACEDIM;
typedef typename MyMeshType::MyConnType ConnType;
long nbMailleT = myMeshT.getNumberOfElements();
CurveIntersector<MyMeshType,MatrixType>* intersector=0;
- std::string meth(method);
- if(meth=="P0P0")
+ if(method=="P0P0")
{
intersector = new CurveIntersectorP0P0<MyMeshType,MatrixType>
(myMeshT, myMeshS,
InterpolationOptions::getMedianPlane(),
InterpolationOptions::getPrintLevel());
}
- else if(meth=="P0P1")
+ else if(method=="P0P1")
{
intersector = new CurveIntersectorP0P1<MyMeshType,MatrixType>
(myMeshT, myMeshS,
InterpolationOptions::getMedianPlane(),
InterpolationOptions::getPrintLevel());
}
- else if(meth=="P1P0")
+ else if(method=="P1P0")
{
intersector = new CurveIntersectorP1P0<MyMeshType,MatrixType>
(myMeshT, myMeshS,
InterpolationOptions::getMedianPlane(),
InterpolationOptions::getPrintLevel());
}
- else if(meth=="P1P1")
+ else if(method=="P1P1")
{
intersector = new CurveIntersectorP1P1<MyMeshType,MatrixType>
(myMeshT, myMeshS,
return oss.str();
}
-void INTERP_KERNEL::InterpolationOptions::CheckAndSplitInterpolationMethod(const char *method, std::string& srcMeth, std::string& trgMeth)
+void INTERP_KERNEL::InterpolationOptions::CheckAndSplitInterpolationMethod(const std::string& method, std::string& srcMeth, std::string& trgMeth)
{
const int NB_OF_METH_MANAGED=4;
const char *METH_MANAGED[NB_OF_METH_MANAGED]={"P0P0","P0P1","P1P0","P1P1"};
- std::string methodC(method);
bool found=false;
for(int i=0;i<NB_OF_METH_MANAGED && !found;i++)
- found=(methodC==METH_MANAGED[i]);
+ found=(method==METH_MANAGED[i]);
if(!found)
{
std::string msg("The interpolation method : \'"); msg+=method; msg+="\' not managed by INTERP_KERNEL interpolators ! Supported are \"P0P0\", \"P0P1\", \"P1P0\" and \"P1P1\".";
throw INTERP_KERNEL::Exception(msg.c_str());
}
- srcMeth=methodC.substr(0,2);
- trgMeth=methodC.substr(2);
+ srcMeth=method.substr(0,2);
+ trgMeth=method.substr(2);
}
bool setOptionString(const std::string& key, const std::string& value);
std::string printOptions() const;
public:
- static void CheckAndSplitInterpolationMethod(const char *method, std::string& srcMeth, std::string& trgMeth);
+ static void CheckAndSplitInterpolationMethod(const std::string& method, std::string& srcMeth, std::string& trgMeth);
private:
static const double DFT_MEDIAN_PLANE;
static const double DFT_SURF3D_ADJ_EPS;
// Main function to interpolate triangular and quadratic meshes
template<class MyMeshType, class MatrixType>
- int interpolateMeshes(const MyMeshType& meshS, const MyMeshType& meshT, MatrixType& result, const char *method);
+ int interpolateMeshes(const MyMeshType& meshS, const MyMeshType& meshT, MatrixType& result, const std::string& method);
public:
bool doRotate() const { return asLeafInterpPlanar().doRotate(); }
double medianPlane() const { return asLeafInterpPlanar().medianPlane(); }
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// Author : Anthony Geay (CEA/DEN)
+
#ifndef __INTERPOLATIONPLANAR_TXX__
#define __INTERPOLATIONPLANAR_TXX__
*/
template<class RealPlanar>
template<class MyMeshType, class MatrixType>
- int InterpolationPlanar<RealPlanar>::interpolateMeshes(const MyMeshType& myMeshS, const MyMeshType& myMeshT, MatrixType& result, const char *method)
+ int InterpolationPlanar<RealPlanar>::interpolateMeshes(const MyMeshType& myMeshS, const MyMeshType& myMeshT, MatrixType& result, const std::string& method)
{
static const int SPACEDIM=MyMeshType::MY_SPACEDIM;
typedef typename MyMeshType::MyConnType ConnType;
{
}
-MEDCoupling1GTUMesh::MEDCoupling1GTUMesh(const char *name, const INTERP_KERNEL::CellModel& cm):_cm(&cm)
+MEDCoupling1GTUMesh::MEDCoupling1GTUMesh(const std::string& name, const INTERP_KERNEL::CellModel& cm):_cm(&cm)
{
setName(name);
}
{
}
-MEDCoupling1GTUMesh *MEDCoupling1GTUMesh::New(const char *name, INTERP_KERNEL::NormalizedCellType type)
+MEDCoupling1GTUMesh *MEDCoupling1GTUMesh::New(const std::string& name, INTERP_KERNEL::NormalizedCellType type)
{
if(type==INTERP_KERNEL::NORM_ERROR)
throw INTERP_KERNEL::Exception("MEDCoupling1GTUMesh::New : NORM_ERROR is not a valid type to be used as base geometric type for a mesh !");
throw INTERP_KERNEL::Exception("MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh : the first instance in input parts is null !");
const DataArrayDouble *coords(firstPart->getCoords());
int meshDim(firstPart->getMeshDimension());
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret(MEDCouplingUMesh::New(firstPart->getName().c_str(),meshDim)); ret->setDescription(firstPart->getDescription().c_str());
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret(MEDCouplingUMesh::New(firstPart->getName(),meshDim)); ret->setDescription(firstPart->getDescription());
ret->setCoords(coords);
int nbOfCells(0),connSize(0);
for(std::vector< const MEDCoupling1GTUMesh *>::const_iterator it=parts.begin();it!=parts.end();it++)
}
}
-MEDCoupling1SGTUMesh::MEDCoupling1SGTUMesh(const char *name, const INTERP_KERNEL::CellModel& cm):MEDCoupling1GTUMesh(name,cm)
+MEDCoupling1SGTUMesh::MEDCoupling1SGTUMesh(const std::string& name, const INTERP_KERNEL::CellModel& cm):MEDCoupling1GTUMesh(name,cm)
{
}
return new MEDCoupling1SGTUMesh;
}
-MEDCoupling1SGTUMesh *MEDCoupling1SGTUMesh::New(const char *name, INTERP_KERNEL::NormalizedCellType type)
+MEDCoupling1SGTUMesh *MEDCoupling1SGTUMesh::New(const std::string& name, INTERP_KERNEL::NormalizedCellType type)
{
if(type==INTERP_KERNEL::NORM_ERROR)
throw INTERP_KERNEL::Exception("MEDCoupling1SGTUMesh::New : NORM_ERROR is not a valid type to be used as base geometric type for a mesh !");
if(gts.size()!=1)
throw INTERP_KERNEL::Exception("MEDCoupling1SGTUMesh::New : input mesh must have exactly one geometric type !");
int geoType((int)*gts.begin());
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> ret(MEDCoupling1SGTUMesh::New(m->getName().c_str(),*gts.begin()));
- ret->setCoords(m->getCoords()); ret->setDescription(m->getDescription().c_str());
+ MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> ret(MEDCoupling1SGTUMesh::New(m->getName(),*gts.begin()));
+ ret->setCoords(m->getCoords()); ret->setDescription(m->getDescription());
int nbCells(m->getNumberOfCells());
int nbOfNodesPerCell(ret->getNumberOfNodesPerCell());
MEDCouplingAutoRefCountObjectPtr<DataArrayInt> conn(DataArrayInt::New()); conn->alloc(nbCells*nbOfNodesPerCell,1);
MEDCouplingUMesh *MEDCoupling1SGTUMesh::buildUnstructured() const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=MEDCouplingUMesh::New(getName().c_str(),getMeshDimension());
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=MEDCouplingUMesh::New(getName(),getMeshDimension());
ret->setCoords(getCoords());
const int *nodalConn=_conn->begin();
int nbCells=getNumberOfCells();
MEDCouplingPointSet *MEDCoupling1SGTUMesh::buildPartOfMySelfKeepCoords(const int *begin, const int *end) const
{
int ncell=getNumberOfCells();
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> ret(new MEDCoupling1SGTUMesh(getName().c_str(),*_cm));
+ MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> ret(new MEDCoupling1SGTUMesh(getName(),*_cm));
ret->setCoords(_coords);
std::size_t nbOfElemsRet=std::distance(begin,end);
const int *inConn=_conn->getConstPointer();
{
int ncell=getNumberOfCells();
int nbOfElemsRet=DataArray::GetNumberOfItemGivenBESRelative(start,end,step,"MEDCoupling1SGTUMesh::buildPartOfMySelfKeepCoords2 : ");
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> ret(new MEDCoupling1SGTUMesh(getName().c_str(),*_cm));
+ MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> ret(new MEDCoupling1SGTUMesh(getName(),*_cm));
ret->setCoords(_coords);
const int *inConn=_conn->getConstPointer();
int sz=getNumberOfNodesPerCell();
MEDCoupling1SGTUMesh *MEDCoupling1SGTUMesh::buildSetInstanceFromThis(int spaceDim) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> ret(new MEDCoupling1SGTUMesh(getName().c_str(),*_cm));
+ MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> ret(new MEDCoupling1SGTUMesh(getName(),*_cm));
MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp1;
const DataArrayInt *nodalConn(_conn);
if(!nodalConn)
{
INTERP_KERNEL::NormalizedCellType gt((INTERP_KERNEL::NormalizedCellType)tinyInfo[0]);
_cm=&INTERP_KERNEL::CellModel::GetCellModel(gt);
- setName(littleStrings[0].c_str());
- setDescription(littleStrings[1].c_str());
- setTimeUnit(littleStrings[2].c_str());
+ setName(littleStrings[0]);
+ setDescription(littleStrings[1]);
+ setTimeUnit(littleStrings[2]);
setTime(tinyInfoD[0],tinyInfo[1],tinyInfo[2]);
int sz0(tinyInfo[3]),sz1(tinyInfo[4]),sz2(tinyInfo[5]),sz3(tinyInfo[6]);
//
throw INTERP_KERNEL::Exception("MEDCoupling1SGTUMesh::explodeEachHexa8To6Quad4 : this method can be applied only on HEXA8 mesh !");
int nbHexa8(getNumberOfCells());
const int *inConnPtr(getNodalConnectivity()->begin());
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> ret(MEDCoupling1SGTUMesh::New(getName().c_str(),INTERP_KERNEL::NORM_QUAD4));
+ MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> ret(MEDCoupling1SGTUMesh::New(getName(),INTERP_KERNEL::NORM_QUAD4));
MEDCouplingAutoRefCountObjectPtr<DataArrayInt> c(DataArrayInt::New()); c->alloc(nbHexa8*6*4,1);
int *cPtr(c->getPointer());
for(int i=0;i<nbHexa8;i++,inConnPtr+=8)
std::vector<const DataArrayDouble *> v(4); v[0]=getCoords(); v[1]=facesBaryArr; v[2]=edgesBaryArr; v[3]=baryArr;
MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> zeArr(DataArrayDouble::Aggregate(v)); baryArr=0; edgesBaryArr=0; facesBaryArr=0;
std::string name("DualOf_"); name+=getName();
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1DGTUMesh> ret(MEDCoupling1DGTUMesh::New(name.c_str(),INTERP_KERNEL::NORM_POLYHED)); ret->setCoords(zeArr);
+ MEDCouplingAutoRefCountObjectPtr<MEDCoupling1DGTUMesh> ret(MEDCoupling1DGTUMesh::New(name,INTERP_KERNEL::NORM_POLYHED)); ret->setCoords(zeArr);
MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cArr(DataArrayInt::New()),ciArr(DataArrayInt::New()); ciArr->alloc(nbOfNodes+1,1); ciArr->setIJ(0,0,0); cArr->alloc(0,1);
for(int i=0;i<nbOfNodes;i++,revNodI++)
{
std::vector<const DataArrayDouble *> v(3); v[0]=getCoords(); v[1]=edgesBaryArr; v[2]=baryArr;
MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> zeArr(DataArrayDouble::Aggregate(v)); baryArr=0; edgesBaryArr=0;
std::string name("DualOf_"); name+=getName();
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1DGTUMesh> ret(MEDCoupling1DGTUMesh::New(name.c_str(),INTERP_KERNEL::NORM_POLYGON)); ret->setCoords(zeArr);
+ MEDCouplingAutoRefCountObjectPtr<MEDCoupling1DGTUMesh> ret(MEDCoupling1DGTUMesh::New(name,INTERP_KERNEL::NORM_POLYGON)); ret->setCoords(zeArr);
MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cArr(DataArrayInt::New()),ciArr(DataArrayInt::New()); ciArr->alloc(nbOfNodes+1,1); ciArr->setIJ(0,0,0); cArr->alloc(0,1);
for(int i=0;i<nbOfNodes;i++,revNodI++)
{
return new MEDCoupling1DGTUMesh;
}
-MEDCoupling1DGTUMesh *MEDCoupling1DGTUMesh::New(const char *name, INTERP_KERNEL::NormalizedCellType type)
+MEDCoupling1DGTUMesh *MEDCoupling1DGTUMesh::New(const std::string& name, INTERP_KERNEL::NormalizedCellType type)
{
if(type==INTERP_KERNEL::NORM_ERROR)
throw INTERP_KERNEL::Exception("MEDCoupling1DGTUMesh::New : NORM_ERROR is not a valid type to be used as base geometric type for a mesh !");
{
}
-MEDCoupling1DGTUMesh::MEDCoupling1DGTUMesh(const char *name, const INTERP_KERNEL::CellModel& cm):MEDCoupling1GTUMesh(name,cm)
+MEDCoupling1DGTUMesh::MEDCoupling1DGTUMesh(const std::string& name, const INTERP_KERNEL::CellModel& cm):MEDCoupling1GTUMesh(name,cm)
{
}
MEDCouplingUMesh *MEDCoupling1DGTUMesh::buildUnstructured() const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=MEDCouplingUMesh::New(getName().c_str(),getMeshDimension());
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=MEDCouplingUMesh::New(getName(),getMeshDimension());
ret->setCoords(getCoords());
const int *nodalConn=_conn->begin(),*nodalConnI=_conn_indx->begin();
int nbCells=getNumberOfCells();//checkCoherency
MEDCouplingPointSet *MEDCoupling1DGTUMesh::buildPartOfMySelfKeepCoords(const int *begin, const int *end) const
{
checkCoherency();
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1DGTUMesh> ret(new MEDCoupling1DGTUMesh(getName().c_str(),*_cm));
+ MEDCouplingAutoRefCountObjectPtr<MEDCoupling1DGTUMesh> ret(new MEDCoupling1DGTUMesh(getName(),*_cm));
ret->setCoords(_coords);
DataArrayInt *c=0,*ci=0;
MEDCouplingUMesh::ExtractFromIndexedArrays(begin,end,_conn,_conn_indx,c,ci);
MEDCouplingPointSet *MEDCoupling1DGTUMesh::buildPartOfMySelfKeepCoords2(int start, int end, int step) const
{
checkCoherency();
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1DGTUMesh> ret(new MEDCoupling1DGTUMesh(getName().c_str(),*_cm));
+ MEDCouplingAutoRefCountObjectPtr<MEDCoupling1DGTUMesh> ret(new MEDCoupling1DGTUMesh(getName(),*_cm));
ret->setCoords(_coords);
DataArrayInt *c=0,*ci=0;
MEDCouplingUMesh::ExtractFromIndexedArrays2(start,end,step,_conn,_conn_indx,c,ci);
{
INTERP_KERNEL::NormalizedCellType gt((INTERP_KERNEL::NormalizedCellType)tinyInfo[0]);
_cm=&INTERP_KERNEL::CellModel::GetCellModel(gt);
- setName(littleStrings[0].c_str());
- setDescription(littleStrings[1].c_str());
- setTimeUnit(littleStrings[2].c_str());
+ setName(littleStrings[0]);
+ setDescription(littleStrings[1]);
+ setTimeUnit(littleStrings[2]);
setTime(tinyInfoD[0],tinyInfo[1],tinyInfo[2]);
int sz0(tinyInfo[3]),sz1(tinyInfo[4]),sz2(tinyInfo[5]),sz3(tinyInfo[6]),sz4(tinyInfo[7]),sz5(tinyInfo[8]);
//
*/
MEDCoupling1DGTUMesh *MEDCoupling1DGTUMesh::copyWithNodalConnectivityPacked(bool& isShallowCpyOfNodalConnn) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1DGTUMesh> ret(new MEDCoupling1DGTUMesh(getName().c_str(),*_cm));
+ MEDCouplingAutoRefCountObjectPtr<MEDCoupling1DGTUMesh> ret(new MEDCoupling1DGTUMesh(getName(),*_cm));
DataArrayInt *nc=0,*nci=0;
isShallowCpyOfNodalConnn=retrievePackedNodalConnectivity(nc,nci);
MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ncs(nc),ncis(nci);
MEDCoupling1DGTUMesh *MEDCoupling1DGTUMesh::buildSetInstanceFromThis(int spaceDim) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1DGTUMesh> ret(new MEDCoupling1DGTUMesh(getName().c_str(),*_cm));
+ MEDCouplingAutoRefCountObjectPtr<MEDCoupling1DGTUMesh> ret(new MEDCoupling1DGTUMesh(getName(),*_cm));
MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp1,tmp2;
const DataArrayInt *nodalConn(_conn),*nodalConnI(_conn_indx);
if(!nodalConn)
if(gts.size()!=1)
throw INTERP_KERNEL::Exception("MEDCoupling1DGTUMesh::New : input mesh must have exactly one geometric type !");
int geoType((int)*gts.begin());
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1DGTUMesh> ret(MEDCoupling1DGTUMesh::New(m->getName().c_str(),*gts.begin()));
- ret->setCoords(m->getCoords()); ret->setDescription(m->getDescription().c_str());
+ MEDCouplingAutoRefCountObjectPtr<MEDCoupling1DGTUMesh> ret(MEDCoupling1DGTUMesh::New(m->getName(),*gts.begin()));
+ ret->setCoords(m->getCoords()); ret->setDescription(m->getDescription());
int nbCells(m->getNumberOfCells());
MEDCouplingAutoRefCountObjectPtr<DataArrayInt> conn(DataArrayInt::New()),connI(DataArrayInt::New());
conn->alloc(m->getMeshLength()-nbCells,1); connI->alloc(nbCells+1,1);
class MEDCoupling1GTUMesh : public MEDCouplingPointSet
{
public:
- MEDCOUPLING_EXPORT static MEDCoupling1GTUMesh *New(const char *name, INTERP_KERNEL::NormalizedCellType type);
+ MEDCOUPLING_EXPORT static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type);
MEDCOUPLING_EXPORT static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m);
MEDCOUPLING_EXPORT const INTERP_KERNEL::CellModel& getCellModel() const;
MEDCOUPLING_EXPORT INTERP_KERNEL::NormalizedCellType getCellModelEnum() const;
MEDCOUPLING_EXPORT virtual DataArrayInt *getNodalConnectivity() const = 0;
MEDCOUPLING_EXPORT virtual void checkCoherencyOfConnectivity() const = 0;
protected:
- MEDCoupling1GTUMesh(const char *name, const INTERP_KERNEL::CellModel& cm);
+ MEDCoupling1GTUMesh(const std::string& name, const INTERP_KERNEL::CellModel& cm);
MEDCoupling1GTUMesh(const MEDCoupling1GTUMesh& other, bool recDeepCpy);
MEDCoupling1GTUMesh();
protected:
class MEDCoupling1SGTUMesh : public MEDCoupling1GTUMesh
{
public:
- MEDCOUPLING_EXPORT static MEDCoupling1SGTUMesh *New(const char *name, INTERP_KERNEL::NormalizedCellType type);
+ MEDCOUPLING_EXPORT static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type);
MEDCOUPLING_EXPORT static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m);
//! useless constructor only for CORBA -> not swigged
MEDCOUPLING_EXPORT static MEDCoupling1SGTUMesh *New();
MEDCOUPLING_EXPORT void unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2,
const std::vector<std::string>& littleStrings);
private:
- MEDCoupling1SGTUMesh(const char *name, const INTERP_KERNEL::CellModel& cm);
+ MEDCoupling1SGTUMesh(const std::string& name, const INTERP_KERNEL::CellModel& cm);
MEDCoupling1SGTUMesh(const MEDCoupling1SGTUMesh& other, bool recDeepCpy);
MEDCoupling1SGTUMesh();
private:
class MEDCoupling1DGTUMesh : public MEDCoupling1GTUMesh
{
public:
- MEDCOUPLING_EXPORT static MEDCoupling1DGTUMesh *New(const char *name, INTERP_KERNEL::NormalizedCellType type);
+ MEDCOUPLING_EXPORT static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type);
MEDCOUPLING_EXPORT static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m);
//! useless constructor only for CORBA -> not swigged
MEDCOUPLING_EXPORT static MEDCoupling1DGTUMesh *New();
MEDCOUPLING_EXPORT void unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2,
const std::vector<std::string>& littleStrings);
private:
- MEDCoupling1DGTUMesh(const char *name, const INTERP_KERNEL::CellModel& cm);
+ MEDCoupling1DGTUMesh(const std::string& name, const INTERP_KERNEL::CellModel& cm);
MEDCoupling1DGTUMesh(const MEDCoupling1DGTUMesh& other, bool recDeepCpy);
MEDCoupling1DGTUMesh();
private:
return new MEDCouplingCMesh;
}
-MEDCouplingCMesh *MEDCouplingCMesh::New(const char *meshName)
+MEDCouplingCMesh *MEDCouplingCMesh::New(const std::string& meshName)
{
MEDCouplingCMesh *ret=new MEDCouplingCMesh;
ret->setName(meshName);
name+=getName();
int nbelem=getNumberOfCells();
MEDCouplingFieldDouble *field=MEDCouplingFieldDouble::New(ON_CELLS,ONE_TIME);
- field->setName(name.c_str());
+ field->setName(name);
DataArrayDouble* array=DataArrayDouble::New();
array->alloc(nbelem,1);
double *area_vol=array->getPointer();
for(int j=0;j<spaceDim;j++)
{
tabsPtr[j]=tabs[j]->getConstPointer();
- ret->setInfoOnComponent(j,tabs[j]->getInfoOnComponent(0).c_str());
+ ret->setInfoOnComponent(j,tabs[j]->getInfoOnComponent(0));
}
int tmp2[3];
for(int i=0;i<nbNodes;i++)
for(int j=0;j<spaceDim;j++)
{
int sz=tabs[j]->getNbOfElems()-1;
- ret->setInfoOnComponent(j,tabs[j]->getInfoOnComponent(0).c_str());
+ ret->setInfoOnComponent(j,tabs[j]->getInfoOnComponent(0));
const double *srcPtr=tabs[j]->getConstPointer();
tabsPtr[j].insert(tabsPtr[j].end(),srcPtr,srcPtr+sz);
std::transform(tabsPtr[j].begin(),tabsPtr[j].end(),srcPtr+1,tabsPtr[j].begin(),std::plus<double>());
void MEDCouplingCMesh::unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2,
const std::vector<std::string>& littleStrings)
{
- setName(littleStrings[0].c_str());
- setDescription(littleStrings[1].c_str());
- setTimeUnit(littleStrings[2].c_str());
+ setName(littleStrings[0]);
+ setDescription(littleStrings[1]);
+ setTimeUnit(littleStrings[2]);
DataArrayDouble **thisArr[3]={&_x_array,&_y_array,&_z_array};
const double *data=a2->getConstPointer();
for(int i=0;i<3;i++)
{
(*(thisArr[i]))=DataArrayDouble::New();
(*(thisArr[i]))->alloc(tinyInfo[i],1);
- (*(thisArr[i]))->setInfoOnComponent(0,littleStrings[i+3].c_str());
+ (*(thisArr[i]))->setInfoOnComponent(0,littleStrings[i+3]);
std::copy(data,data+tinyInfo[i],(*(thisArr[i]))->getPointer());
data+=tinyInfo[i];
}
{
public:
MEDCOUPLING_EXPORT static MEDCouplingCMesh *New();
- MEDCOUPLING_EXPORT static MEDCouplingCMesh *New(const char *meshName);
+ MEDCOUPLING_EXPORT static MEDCouplingCMesh *New(const std::string& meshName);
MEDCOUPLING_EXPORT MEDCouplingMesh *deepCpy() const;
MEDCOUPLING_EXPORT MEDCouplingCMesh *clone(bool recDeepCpy) const;
MEDCOUPLING_EXPORT void updateTime() const;
return new MEDCouplingCurveLinearMesh;
}
-MEDCouplingCurveLinearMesh *MEDCouplingCurveLinearMesh::New(const char *meshName)
+MEDCouplingCurveLinearMesh *MEDCouplingCurveLinearMesh::New(const std::string& meshName)
{
MEDCouplingCurveLinearMesh *ret=new MEDCouplingCurveLinearMesh;
ret->setName(meshName);
int meshDim=getMeshDimension();
std::string name="MeasureOfMesh_"; name+=getName();
MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> field=MEDCouplingFieldDouble::New(ON_CELLS,ONE_TIME);
- field->setName(name.c_str()); field->setMesh(const_cast<MEDCouplingCurveLinearMesh *>(this)); field->synchronizeTimeWithMesh();
+ field->setName(name); field->setMesh(const_cast<MEDCouplingCurveLinearMesh *>(this)); field->synchronizeTimeWithMesh();
switch(meshDim)
{
case 3:
void MEDCouplingCurveLinearMesh::unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2,
const std::vector<std::string>& littleStrings)
{
- setName(littleStrings[0].c_str());
- setDescription(littleStrings[1].c_str());
- setTimeUnit(littleStrings[2].c_str());
+ setName(littleStrings[0]);
+ setDescription(littleStrings[1]);
+ setTimeUnit(littleStrings[2]);
setTime(tinyInfoD[0],tinyInfo[0],tinyInfo[1]);
int sz=tinyInfo[2];
_structure.resize(sz);
{
public:
MEDCOUPLING_EXPORT static MEDCouplingCurveLinearMesh *New();
- MEDCOUPLING_EXPORT static MEDCouplingCurveLinearMesh *New(const char *meshName);
+ MEDCOUPLING_EXPORT static MEDCouplingCurveLinearMesh *New(const std::string& meshName);
MEDCOUPLING_EXPORT MEDCouplingMesh *deepCpy() const;
MEDCOUPLING_EXPORT MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const;
MEDCOUPLING_EXPORT void updateTime() const;
if(_mesh2D!=0)
_mesh2D->incrRef();
computeExtrusion(mesh3D);
- setName(mesh3D->getName().c_str());
+ setName(mesh3D->getName());
}
catch(INTERP_KERNEL::Exception& e)
{
MEDCouplingUMesh *ret=_mesh2D->buildExtrudedMesh(_mesh1D,0);
const int *renum=_mesh3D_ids->getConstPointer();
ret->renumberCells(renum,false);
- ret->setName(getName().c_str());
+ ret->setName(getName());
return ret;
}
retPtr[renum[i*nbOf2DCells+j]]=ret2DPtr[j]*ret1DPtr[i];
ret->setArray(da);
da->decrRef();
- ret->setName(name.c_str());
+ ret->setName(name);
ret2D->decrRef();
ret1D->decrRef();
return ret;
void MEDCouplingExtrudedMesh::unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2, const std::vector<std::string>& littleStrings)
{
- setName(littleStrings[littleStrings.size()-2].c_str());
- setDescription(littleStrings.back().c_str());
+ setName(littleStrings[littleStrings.size()-2]);
+ setDescription(littleStrings.back());
std::size_t sz=tinyInfo.size();
int sz1=tinyInfo[sz-2];
_cell_2D_id=tinyInfo[sz-3];
{
if(other)
{
- setName(other->_name.c_str());
- setDescription(other->_desc.c_str());
+ setName(other->_name);
+ setDescription(other->_desc);
}
}
MEDCOUPLING_EXPORT virtual void copyTinyStringsFrom(const MEDCouplingField *other);
MEDCOUPLING_EXPORT void setMesh(const ParaMEDMEM::MEDCouplingMesh *mesh);
MEDCOUPLING_EXPORT const ParaMEDMEM::MEDCouplingMesh *getMesh() const { return _mesh; }
- MEDCOUPLING_EXPORT void setName(const char *name) { _name=name; }
+ MEDCOUPLING_EXPORT void setName(const std::string& name) { _name=name; }
MEDCOUPLING_EXPORT std::string getDescription() const { return _desc; }
- MEDCOUPLING_EXPORT void setDescription(const char *desc) { _desc=desc; }
+ MEDCOUPLING_EXPORT void setDescription(const std::string& desc) { _desc=desc; }
MEDCOUPLING_EXPORT std::string getName() const { return _name; }
MEDCOUPLING_EXPORT TypeOfField getTypeOfField() const;
MEDCOUPLING_EXPORT NatureOfField getNature() const;
}
}
-TypeOfField MEDCouplingFieldDiscretization::GetTypeOfFieldFromStringRepr(const char *repr)
+TypeOfField MEDCouplingFieldDiscretization::GetTypeOfFieldFromStringRepr(const std::string& repr)
{
- std::string reprCpp(repr);
- if(reprCpp==MEDCouplingFieldDiscretizationP0::REPR)
+ if(repr==MEDCouplingFieldDiscretizationP0::REPR)
return MEDCouplingFieldDiscretizationP0::TYPE;
- if(reprCpp==MEDCouplingFieldDiscretizationP1::REPR)
+ if(repr==MEDCouplingFieldDiscretizationP1::REPR)
return MEDCouplingFieldDiscretizationP1::TYPE;
- if(reprCpp==MEDCouplingFieldDiscretizationGauss::REPR)
+ if(repr==MEDCouplingFieldDiscretizationGauss::REPR)
return MEDCouplingFieldDiscretizationGauss::TYPE;
- if(reprCpp==MEDCouplingFieldDiscretizationGaussNE::REPR)
+ if(repr==MEDCouplingFieldDiscretizationGaussNE::REPR)
return MEDCouplingFieldDiscretizationGaussNE::TYPE;
- if(reprCpp==MEDCouplingFieldDiscretizationKriging::REPR)
+ if(repr==MEDCouplingFieldDiscretizationKriging::REPR)
return MEDCouplingFieldDiscretizationKriging::TYPE;
throw INTERP_KERNEL::Exception("Representation does not match with any field discretization !");
}
throw INTERP_KERNEL::Exception("Invalid method for the corresponding field discretization : available only for GaussPoint discretization !");
}
-void MEDCouplingFieldDiscretization::RenumberEntitiesFromO2NArr(double eps, const int *old2NewPtr, int newNbOfEntity, DataArrayDouble *arr, const char *msg)
+void MEDCouplingFieldDiscretization::RenumberEntitiesFromO2NArr(double eps, const int *old2NewPtr, int newNbOfEntity, DataArrayDouble *arr, const std::string& msg)
{
if(!arr)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretization::RenumberEntitiesFromO2NArr : input array is NULL !");
}
}
-void MEDCouplingFieldDiscretization::RenumberEntitiesFromN2OArr(const int *new2OldPtr, int new2OldSz, DataArrayDouble *arr, const char *msg)
+void MEDCouplingFieldDiscretization::RenumberEntitiesFromN2OArr(const int *new2OldPtr, int new2OldSz, DataArrayDouble *arr, const std::string& msg)
{
int nbOfComp=arr->getNumberOfComponents();
MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arrCpy=arr->deepCpy();
MEDCOUPLING_EXPORT void updateTime() const;
MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
- MEDCOUPLING_EXPORT static TypeOfField GetTypeOfFieldFromStringRepr(const char *repr);
+ MEDCOUPLING_EXPORT static TypeOfField GetTypeOfFieldFromStringRepr(const std::string& repr);
MEDCOUPLING_EXPORT virtual TypeOfField getEnum() const = 0;
MEDCOUPLING_EXPORT virtual bool isEqual(const MEDCouplingFieldDiscretization *other, double eps) const;
MEDCOUPLING_EXPORT virtual bool isEqualIfNotWhy(const MEDCouplingFieldDiscretization *other, double eps, std::string& reason) const = 0;
MEDCOUPLING_EXPORT virtual ~MEDCouplingFieldDiscretization();
protected:
MEDCOUPLING_EXPORT MEDCouplingFieldDiscretization();
- MEDCOUPLING_EXPORT static void RenumberEntitiesFromO2NArr(double epsOnVals, const int *old2NewPtr, int newNbOfEntity, DataArrayDouble *arr, const char *msg);
- MEDCOUPLING_EXPORT static void RenumberEntitiesFromN2OArr(const int *new2OldPtr, int new2OldSz, DataArrayDouble *arr, const char *msg);
+ MEDCOUPLING_EXPORT static void RenumberEntitiesFromO2NArr(double epsOnVals, const int *old2NewPtr, int newNbOfEntity, DataArrayDouble *arr, const std::string& msg);
+ MEDCOUPLING_EXPORT static void RenumberEntitiesFromN2OArr(const int *new2OldPtr, int new2OldSz, DataArrayDouble *arr, const std::string& msg);
protected:
double _precision;
static const double DFLT_PRECISION;
* Sets a time \a unit of \a this field. For more info, see \ref MEDCouplingFirstSteps3.
* \param [in] unit \a unit (string) in which time is measured.
*/
-void MEDCouplingFieldDouble::setTimeUnit(const char *unit)
+void MEDCouplingFieldDouble::setTimeUnit(const std::string& unit)
{
_time_discr->setTimeUnit(unit);
}
* Returns a time unit of \a this field.
* \return a string describing units in which time is measured.
*/
-const char *MEDCouplingFieldDouble::getTimeUnit() const
+std::string MEDCouplingFieldDouble::getTimeUnit() const
{
return _time_discr->getTimeUnit();
}
disc=_type->clone();
MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),tdo,disc.retn());
ret->setMesh(getMesh());
- ret->setName(getName().c_str());
- ret->setDescription(getDescription().c_str());
+ ret->setName(getName());
+ ret->setDescription(getDescription());
return ret.retn();
}
return ret.str();
}
-void MEDCouplingFieldDouble::writeVTK(const char *fileName, bool isBinary) const
+void MEDCouplingFieldDouble::writeVTK(const std::string& fileName, bool isBinary) const
{
std::vector<const MEDCouplingFieldDouble *> fs(1,this);
MEDCouplingFieldDouble::WriteVTK(fileName,fs,isBinary);
* \ref cpp_mcfielddouble_fillFromAnalytic "Here is a C++ example".<br>
* \ref py_mcfielddouble_fillFromAnalytic "Here is a Python example".
*/
-void MEDCouplingFieldDouble::fillFromAnalytic(int nbOfComp, const char *func)
+void MEDCouplingFieldDouble::fillFromAnalytic(int nbOfComp, const std::string& func)
{
if(!_mesh)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::fillFromAnalytic : no mesh defined !");
* The function is applied to coordinates of value location points. For example, if
* \a this field is on cells, the function is applied to cell barycenters.<br>
* This method differs from
- * \ref ParaMEDMEM::MEDCouplingFieldDouble::fillFromAnalytic(int nbOfComp, const char *func) "fillFromAnalytic()"
+ * \ref ParaMEDMEM::MEDCouplingFieldDouble::fillFromAnalytic(int nbOfComp, const std::string& func) "fillFromAnalytic()"
* by the way how variable
* names, used in the function, are associated with components of coordinates of field
* location points; here, a variable name corresponding to a component is retrieved from
* \ref cpp_mcfielddouble_fillFromAnalytic2 "Here is a C++ example".<br>
* \ref py_mcfielddouble_fillFromAnalytic2 "Here is a Python example".
*/
-void MEDCouplingFieldDouble::fillFromAnalytic2(int nbOfComp, const char *func)
+void MEDCouplingFieldDouble::fillFromAnalytic2(int nbOfComp, const std::string& func)
{
if(!_mesh)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::fillFromAnalytic2 : no mesh defined !");
* The function is applied to coordinates of value location points. For example, if
* \a this field is on cells, the function is applied to cell barycenters.<br>
* This method differs from
- * \ref ParaMEDMEM::MEDCouplingFieldDouble::fillFromAnalytic(int nbOfComp, const char *func) "fillFromAnalytic()"
+ * \ref ParaMEDMEM::MEDCouplingFieldDouble::fillFromAnalytic(int nbOfComp, const std::string& func) "fillFromAnalytic()"
* by the way how variable
* names, used in the function, are associated with components of coordinates of field
* location points; here, a component index of a variable is defined by a
* \ref cpp_mcfielddouble_fillFromAnalytic3 "Here is a C++ example".<br>
* \ref py_mcfielddouble_fillFromAnalytic3 "Here is a Python example".
*/
-void MEDCouplingFieldDouble::fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func)
+void MEDCouplingFieldDouble::fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func)
{
if(!_mesh)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::fillFromAnalytic2 : no mesh defined !");
* \ref cpp_mcfielddouble_applyFunc "Here is a C++ example".<br>
* \ref py_mcfielddouble_applyFunc "Here is a Python example".
*/
-void MEDCouplingFieldDouble::applyFunc(int nbOfComp, const char *func)
+void MEDCouplingFieldDouble::applyFunc(int nbOfComp, const std::string& func)
{
_time_discr->applyFunc(nbOfComp,func);
}
* For more info on supported expressions that can be used in the function, see \ref
* MEDCouplingArrayApplyFuncExpr. <br>
* This method differs from
- * \ref ParaMEDMEM::MEDCouplingFieldDouble::applyFunc(int nbOfComp, const char *func) "applyFunc()"
+ * \ref ParaMEDMEM::MEDCouplingFieldDouble::applyFunc(int nbOfComp, const std::string& func) "applyFunc()"
* by the way how variable
* names, used in the function, are associated with components of field values;
* here, a variable name corresponding to a component is retrieved from
* \ref cpp_mcfielddouble_applyFunc2 "Here is a C++ example".<br>
* \ref py_mcfielddouble_applyFunc2 "Here is a Python example".
*/
-void MEDCouplingFieldDouble::applyFunc2(int nbOfComp, const char *func)
+void MEDCouplingFieldDouble::applyFunc2(int nbOfComp, const std::string& func)
{
_time_discr->applyFunc2(nbOfComp,func);
}
* Modifies values of \a this field by applying a function to each tuple of all
* data arrays.
* This method differs from
- * \ref ParaMEDMEM::MEDCouplingFieldDouble::applyFunc(int nbOfComp, const char *func) "applyFunc()"
+ * \ref ParaMEDMEM::MEDCouplingFieldDouble::applyFunc(int nbOfComp, const std::string& func) "applyFunc()"
* by the way how variable
* names, used in the function, are associated with components of field values;
* here, a component index of a variable is defined by a
* \ref cpp_mcfielddouble_applyFunc3 "Here is a C++ example".<br>
* \ref py_mcfielddouble_applyFunc3 "Here is a Python example".
*/
-void MEDCouplingFieldDouble::applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func)
+void MEDCouplingFieldDouble::applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func)
{
_time_discr->applyFunc3(nbOfComp,varsOrder,func);
}
* \ref cpp_mcfielddouble_applyFunc_same_nb_comp "Here is a C++ example".<br>
* \ref py_mcfielddouble_applyFunc_same_nb_comp "Here is a Python example".
*/
-void MEDCouplingFieldDouble::applyFunc(const char *func)
+void MEDCouplingFieldDouble::applyFunc(const std::string& func)
{
_time_discr->applyFunc(func);
}
* The field will contain exactly the same number of components after the call.
* Use is not warranted for the moment !
*/
-void MEDCouplingFieldDouble::applyFuncFast32(const char *func)
+void MEDCouplingFieldDouble::applyFuncFast32(const std::string& func)
{
_time_discr->applyFuncFast32(func);
}
* The field will contain exactly the same number of components after the call.
* Use is not warranted for the moment !
*/
-void MEDCouplingFieldDouble::applyFuncFast64(const char *func)
+void MEDCouplingFieldDouble::applyFuncFast64(const std::string& func)
{
_time_discr->applyFuncFast64(func);
}
double val=_mesh->getTime(it,ordr);
std::string timeUnit(_mesh->getTimeUnit());
setTime(val,it,ordr);
- setTimeUnit(timeUnit.c_str());
+ setTimeUnit(timeUnit);
}
/*!
int nbOfElemS=(int)tinyInfoS.size();
_name=tinyInfoS[nbOfElemS-3];
_desc=tinyInfoS[nbOfElemS-2];
- setTimeUnit(tinyInfoS[nbOfElemS-1].c_str());
+ setTimeUnit(tinyInfoS[nbOfElemS-1]);
}
/*!
MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),td,_type->clone());
std::ostringstream oss;
oss << "Max_" << getName();
- ret->setName(oss.str().c_str());
+ ret->setName(oss.str());
ret->setMesh(getMesh());
return ret.retn();
}
MEDCouplingTimeDiscretization *td=_time_discr->keepSelectedComponents(compoIds);
td->copyTinyAttrFrom(*_time_discr);
MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),td,_type->clone());
- ret->setName(getName().c_str());
+ ret->setName(getName());
ret->setMesh(getMesh());
return ret.retn();
}
MEDCouplingTimeDiscretization *td=f1->_time_discr->aggregate(f2->_time_discr);
td->copyTinyAttrFrom(*f1->_time_discr);
MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(f1->getNature(),td,f1->_type->clone());
- ret->setName(f1->getName().c_str());
- ret->setDescription(f1->getDescription().c_str());
+ ret->setName(f1->getName());
+ ret->setDescription(f1->getDescription());
if(m1)
{
MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> m=m1->mergeMyselfWith(m2);
MEDCouplingTimeDiscretization *td=tds[0]->aggregate(tds);
td->copyTinyAttrFrom(*(a[0]->_time_discr));
MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(a[0]->getNature(),td,a[0]->_type->clone());
- ret->setName(a[0]->getName().c_str());
- ret->setDescription(a[0]->getDescription().c_str());
+ ret->setName(a[0]->getName());
+ ret->setDescription(a[0]->getDescription());
if(ms2[0])
{
MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m=MEDCouplingUMesh::MergeUMeshes(ms2);
* \ref cpp_mcfielddouble_WriteVTK "Here is a C++ example".<br>
* \ref py_mcfielddouble_WriteVTK "Here is a Python example".
*/
-void MEDCouplingFieldDouble::WriteVTK(const char *fileName, const std::vector<const MEDCouplingFieldDouble *>& fs, bool isBinary)
+void MEDCouplingFieldDouble::WriteVTK(const std::string& fileName, const std::vector<const MEDCouplingFieldDouble *>& fs, bool isBinary)
{
if(fs.empty())
return;
}
TypeOfField typ=cur->getTypeOfField();
if(typ==ON_CELLS)
- cur->getArray()->writeVTK(coss,8,cur->getName().c_str(),byteArr);
+ cur->getArray()->writeVTK(coss,8,cur->getName(),byteArr);
else if(typ==ON_NODES)
- cur->getArray()->writeVTK(noss,8,cur->getName().c_str(),byteArr);
+ cur->getArray()->writeVTK(noss,8,cur->getName(),byteArr);
else
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::WriteVTK : only node and cell fields supported for the moment !");
}
public:
MEDCOUPLING_EXPORT static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
MEDCOUPLING_EXPORT static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
- MEDCOUPLING_EXPORT void setTimeUnit(const char *unit);
- MEDCOUPLING_EXPORT const char *getTimeUnit() const;
+ MEDCOUPLING_EXPORT void setTimeUnit(const std::string& unit);
+ MEDCOUPLING_EXPORT std::string getTimeUnit() const;
MEDCOUPLING_EXPORT void synchronizeTimeWithSupport();
MEDCOUPLING_EXPORT void copyTinyStringsFrom(const MEDCouplingField *other);
MEDCOUPLING_EXPORT void copyTinyAttrFrom(const MEDCouplingFieldDouble *other);
MEDCOUPLING_EXPORT void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other);
MEDCOUPLING_EXPORT std::string simpleRepr() const;
MEDCOUPLING_EXPORT std::string advancedRepr() const;
- MEDCOUPLING_EXPORT void writeVTK(const char *fileName, bool isBinary=true) const;
+ MEDCOUPLING_EXPORT void writeVTK(const std::string& fileName, bool isBinary=true) const;
MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec, std::string& reason) const;
MEDCOUPLING_EXPORT bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const;
MEDCOUPLING_EXPORT bool areCompatibleForMerge(const MEDCouplingField *other) const;
MEDCOUPLING_EXPORT void applyLin(double a, double b, int compoId);
MEDCOUPLING_EXPORT MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
MEDCOUPLING_EXPORT void fillFromAnalytic(int nbOfComp, FunctionToEvaluate func);
- MEDCOUPLING_EXPORT void fillFromAnalytic(int nbOfComp, const char *func);
- MEDCOUPLING_EXPORT void fillFromAnalytic2(int nbOfComp, const char *func);
- MEDCOUPLING_EXPORT void fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func);
+ MEDCOUPLING_EXPORT void fillFromAnalytic(int nbOfComp, const std::string& func);
+ MEDCOUPLING_EXPORT void fillFromAnalytic2(int nbOfComp, const std::string& func);
+ MEDCOUPLING_EXPORT void fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func);
MEDCOUPLING_EXPORT void applyFunc(int nbOfComp, FunctionToEvaluate func);
MEDCOUPLING_EXPORT void applyFunc(int nbOfComp, double val);
- MEDCOUPLING_EXPORT void applyFunc(int nbOfComp, const char *func);
- MEDCOUPLING_EXPORT void applyFunc2(int nbOfComp, const char *func);
- MEDCOUPLING_EXPORT void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func);
- MEDCOUPLING_EXPORT void applyFunc(const char *func);
- MEDCOUPLING_EXPORT void applyFuncFast32(const char *func);
- MEDCOUPLING_EXPORT void applyFuncFast64(const char *func);
+ MEDCOUPLING_EXPORT void applyFunc(int nbOfComp, const std::string& func);
+ MEDCOUPLING_EXPORT void applyFunc2(int nbOfComp, const std::string& func);
+ MEDCOUPLING_EXPORT void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func);
+ MEDCOUPLING_EXPORT void applyFunc(const std::string& func);
+ MEDCOUPLING_EXPORT void applyFuncFast32(const std::string& func);
+ MEDCOUPLING_EXPORT void applyFuncFast64(const std::string& func);
MEDCOUPLING_EXPORT int getNumberOfComponents() const;
MEDCOUPLING_EXPORT int getNumberOfTuples() const;
MEDCOUPLING_EXPORT int getNumberOfValues() const;
MEDCOUPLING_EXPORT MEDCouplingFieldDouble *operator^(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
MEDCOUPLING_EXPORT const MEDCouplingFieldDouble &operator^=(const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception);
MEDCOUPLING_EXPORT static MEDCouplingFieldDouble *PowFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
- MEDCOUPLING_EXPORT static void WriteVTK(const char *fileName, const std::vector<const MEDCouplingFieldDouble *>& fs, bool isBinary=true);
+ MEDCOUPLING_EXPORT static void WriteVTK(const std::string& fileName, const std::vector<const MEDCouplingFieldDouble *>& fs, bool isBinary=true);
public:
MEDCOUPLING_EXPORT const MEDCouplingTimeDiscretization *getTimeDiscretizationUnderGround() const { return _time_discr; }
MEDCOUPLING_EXPORT MEDCouplingTimeDiscretization *getTimeDiscretizationUnderGround() { return _time_discr; }
* See \ref MEDCouplingArrayBasicsName "DataArrays infos" for more information.
* \param [in] name - new array name
*/
-void DataArray::setName(const char *name)
+void DataArray::setName(const std::string& name)
{
_name=name;
}
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
for(std::size_t i=0;i<newNbOfCompo;i++)
- setInfoOnComponent((int)i,other.getInfoOnComponent(compoIds[i]).c_str());
+ setInfoOnComponent((int)i,other.getInfoOnComponent(compoIds[i]));
}
void DataArray::copyPartOfStringInfoFrom2(const std::vector<int>& compoIds, const DataArray& other)
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
for(std::size_t i=0;i<partOfCompoToSet;i++)
- setInfoOnComponent(compoIds[i],other.getInfoOnComponent((int)i).c_str());
+ setInfoOnComponent(compoIds[i],other.getInfoOnComponent((int)i));
}
bool DataArray::areInfoEqualsIfNotWhy(const DataArray& other, std::string& reason) const
stream << "\n";
}
-std::string DataArray::cppRepr(const char *varName) const
+std::string DataArray::cppRepr(const std::string& varName) const
{
std::ostringstream ret;
reprCppStream(varName,ret);
* \param [in] info - the string containing the information.
* \throw If \a i is not a valid component index.
*/
-void DataArray::setInfoOnComponent(int i, const char *info)
+void DataArray::setInfoOnComponent(int i, const std::string& info)
{
if(i<(int)_info_on_compo.size() && i>=0)
_info_on_compo[i]=info;
_info_on_compo=info;
}
-void DataArray::checkNbOfTuples(int nbOfTuples, const char *msg) const
+void DataArray::checkNbOfTuples(int nbOfTuples, const std::string& msg) const
{
if(getNumberOfTuples()!=nbOfTuples)
{
}
}
-void DataArray::checkNbOfComps(int nbOfCompo, const char *msg) const
+void DataArray::checkNbOfComps(int nbOfCompo, const std::string& msg) const
{
if(getNumberOfComponents()!=nbOfCompo)
{
}
}
-void DataArray::checkNbOfElems(std::size_t nbOfElems, const char *msg) const
+void DataArray::checkNbOfElems(std::size_t nbOfElems, const std::string& msg) const
{
if(getNbOfElems()!=nbOfElems)
{
}
}
-void DataArray::checkNbOfTuplesAndComp(const DataArray& other, const char *msg) const
+void DataArray::checkNbOfTuplesAndComp(const DataArray& other, const std::string& msg) const
{
if(getNumberOfTuples()!=other.getNumberOfTuples())
{
}
}
-void DataArray::checkNbOfTuplesAndComp(int nbOfTuples, int nbOfCompo, const char *msg) const
+void DataArray::checkNbOfTuplesAndComp(int nbOfTuples, int nbOfCompo, const std::string& msg) const
{
checkNbOfTuples(nbOfTuples,msg);
checkNbOfComps(nbOfCompo,msg);
/*!
* Simply this method checks that \b value is in [0,\b ref).
*/
-void DataArray::CheckValueInRange(int ref, int value, const char *msg)
+void DataArray::CheckValueInRange(int ref, int value, const std::string& msg)
{
if(value<0 || value>=ref)
{
* This method checks that [\b start, \b end) is compliant with ref length \b value.
* typicaly start in [0,\b value) and end in [0,\b value). If value==start and start==end, it is supported.
*/
-void DataArray::CheckValueInRangeEx(int value, int start, int end, const char *msg)
+void DataArray::CheckValueInRangeEx(int value, int start, int end, const std::string& msg)
{
if(start<0 || start>=value)
{
}
}
-void DataArray::CheckClosingParInRange(int ref, int value, const char *msg)
+void DataArray::CheckClosingParInRange(int ref, int value, const std::string& msg)
{
if(value<0 || value>ref)
{
stopSlice=stop;
}
-int DataArray::GetNumberOfItemGivenBES(int begin, int end, int step, const char *msg)
+int DataArray::GetNumberOfItemGivenBES(int begin, int end, int step, const std::string& msg)
{
if(end<begin)
{
return (end-1-begin)/step+1;
}
-int DataArray::GetNumberOfItemGivenBESRelative(int begin, int end, int step, const char *msg)
+int DataArray::GetNumberOfItemGivenBESRelative(int begin, int end, int step, const std::string& msg)
{
if(step==0)
throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBES : step=0 is not allowed !");
return ret.str();
}
-void DataArrayDouble::writeVTK(std::ostream& ofs, int indent, const char *nameInFile, DataArrayByte *byteArr) const
+void DataArrayDouble::writeVTK(std::ostream& ofs, int indent, const std::string& nameInFile, DataArrayByte *byteArr) const
{
static const char SPACE[4]={' ',' ',' ',' '};
checkAllocated();
_mem.reprZip(getNumberOfComponents(),stream);
}
-void DataArrayDouble::reprCppStream(const char *varName, std::ostream& stream) const
+void DataArrayDouble::reprCppStream(const std::string& varName, std::ostream& stream) const
{
int nbTuples=getNumberOfTuples(),nbComp=getNumberOfComponents();
const double *data=getConstPointer();
for(;j<newNbOfComp;j++)
nc[newNbOfComp*i+j]=dftValue;
}
- ret->setName(getName().c_str());
+ ret->setName(getName());
for(int i=0;i<dim;i++)
- ret->setInfoOnComponent(i,getInfoOnComponent(i).c_str());
- ret->setName(getName().c_str());
+ ret->setInfoOnComponent(i,getInfoOnComponent(i));
+ ret->setName(getName());
return ret.retn();
}
w[1]=wIn[0]*sin(wIn[1]);
w[2]=wIn[2];
}
- ret->setInfoOnComponent(2,getInfoOnComponent(2).c_str());
+ ret->setInfoOnComponent(2,getInfoOnComponent(2));
return ret;
}
* \throw If \a this is not allocated.
* \throw If computing \a func fails.
*/
-DataArrayDouble *DataArrayDouble::applyFunc(int nbOfComp, const char *func) const
+DataArrayDouble *DataArrayDouble::applyFunc(int nbOfComp, const std::string& func) const
{
checkAllocated();
INTERP_KERNEL::ExprParser expr(func);
* \throw If \a this is not allocated.
* \throw If computing \a func fails.
*/
-DataArrayDouble *DataArrayDouble::applyFunc(const char *func) const
+DataArrayDouble *DataArrayDouble::applyFunc(const std::string& func) const
{
checkAllocated();
INTERP_KERNEL::ExprParser expr(func);
* \throw If \a func contains vars that are not in \a this->getInfoOnComponent().
* \throw If computing \a func fails.
*/
-DataArrayDouble *DataArrayDouble::applyFunc2(int nbOfComp, const char *func) const
+DataArrayDouble *DataArrayDouble::applyFunc2(int nbOfComp, const std::string& func) const
{
checkAllocated();
INTERP_KERNEL::ExprParser expr(func);
* \throw If \a func contains vars not in \a varsOrder.
* \throw If computing \a func fails.
*/
-DataArrayDouble *DataArrayDouble::applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) const
+DataArrayDouble *DataArrayDouble::applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const
{
checkAllocated();
INTERP_KERNEL::ExprParser expr(func);
return newArr;
}
-void DataArrayDouble::applyFuncFast32(const char *func)
+void DataArrayDouble::applyFuncFast32(const std::string& func)
{
checkAllocated();
INTERP_KERNEL::ExprParser expr(func);
declareAsNew();
}
-void DataArrayDouble::applyFuncFast64(const char *func)
+void DataArrayDouble::applyFuncFast64(const std::string& func)
{
checkAllocated();
INTERP_KERNEL::ExprParser expr(func);
int k=0;
for(int i=0;i<(int)a.size();i++)
for(int j=0;j<nbc[i];j++,k++)
- ret->setInfoOnComponent(k,a[i]->getInfoOnComponent(j).c_str());
+ ret->setInfoOnComponent(k,a[i]->getInfoOnComponent(j));
return ret;
}
sum+=a1Ptr[i*nbOfComp+j]*a2Ptr[i*nbOfComp+j];
retPtr[i]=sum;
}
- ret->setInfoOnComponent(0,a1->getInfoOnComponent(0).c_str());
- ret->setName(a1->getName().c_str());
+ ret->setInfoOnComponent(0,a1->getInfoOnComponent(0));
+ ret->setName(a1->getName());
return ret;
}
*/
void DataArrayDouble::finishUnserialization(const std::vector<int>& tinyInfoI, const std::vector<std::string>& tinyInfoS)
{
- setName(tinyInfoS[0].c_str());
+ setName(tinyInfoS[0]);
if(isAllocated())
{
int nbOfCompo=getNumberOfComponents();
for(int i=0;i<nbOfCompo;i++)
- setInfoOnComponent(i,tinyInfoS[i+1].c_str());
+ setInfoOnComponent(i,tinyInfoS[i+1]);
}
}
return ret.str();
}
-void DataArrayInt::writeVTK(std::ostream& ofs, int indent, const char *type, const char *nameInFile, DataArrayByte *byteArr) const
+void DataArrayInt::writeVTK(std::ostream& ofs, int indent, const std::string& type, const std::string& nameInFile, DataArrayByte *byteArr) const
{
static const char SPACE[4]={' ',' ',' ',' '};
checkAllocated();
_mem.reprZip(getNumberOfComponents(),stream);
}
-void DataArrayInt::reprCppStream(const char *varName, std::ostream& stream) const
+void DataArrayInt::reprCppStream(const std::string& varName, std::ostream& stream) const
{
int nbTuples=getNumberOfTuples(),nbComp=getNumberOfComponents();
const int *data=getConstPointer();
for(;j<newNbOfComp;j++)
nc[newNbOfComp*i+j]=dftValue;
}
- ret->setName(getName().c_str());
+ ret->setName(getName());
for(int i=0;i<dim;i++)
- ret->setInfoOnComponent(i,getInfoOnComponent(i).c_str());
- ret->setName(getName().c_str());
+ ret->setInfoOnComponent(i,getInfoOnComponent(i));
+ ret->setName(getName());
return ret.retn();
}
int k=0;
for(int i=0;i<(int)a.size();i++)
for(int j=0;j<nbc[i];j++,k++)
- ret->setInfoOnComponent(k,a[i]->getInfoOnComponent(j).c_str());
+ ret->setInfoOnComponent(k,a[i]->getInfoOnComponent(j));
return ret;
}
*/
void DataArrayInt::finishUnserialization(const std::vector<int>& tinyInfoI, const std::vector<std::string>& tinyInfoS)
{
- setName(tinyInfoS[0].c_str());
+ setName(tinyInfoS[0]);
if(isAllocated())
{
int nbOfCompo=tinyInfoI[1];
for(int i=0;i<nbOfCompo;i++)
- setInfoOnComponent(i,tinyInfoS[i+1].c_str());
+ setInfoOnComponent(i,tinyInfoS[i+1]);
}
}
public:
MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
- MEDCOUPLING_EXPORT void setName(const char *name);
+ MEDCOUPLING_EXPORT void setName(const std::string& name);
MEDCOUPLING_EXPORT void copyStringInfoFrom(const DataArray& other);
MEDCOUPLING_EXPORT void copyPartOfStringInfoFrom(const DataArray& other, const std::vector<int>& compoIds);
MEDCOUPLING_EXPORT void copyPartOfStringInfoFrom2(const std::vector<int>& compoIds, const DataArray& other);
MEDCOUPLING_EXPORT bool areInfoEqualsIfNotWhy(const DataArray& other, std::string& reason) const;
MEDCOUPLING_EXPORT bool areInfoEquals(const DataArray& other) const;
- MEDCOUPLING_EXPORT std::string cppRepr(const char *varName) const;
+ MEDCOUPLING_EXPORT std::string cppRepr(const std::string& varName) const;
MEDCOUPLING_EXPORT std::string getName() const { return _name; }
MEDCOUPLING_EXPORT const std::vector<std::string> &getInfoOnComponents() const { return _info_on_compo; }
MEDCOUPLING_EXPORT std::vector<std::string> &getInfoOnComponents() { return _info_on_compo; }
MEDCOUPLING_EXPORT std::string getInfoOnComponent(int i) const;
MEDCOUPLING_EXPORT std::string getVarOnComponent(int i) const;
MEDCOUPLING_EXPORT std::string getUnitOnComponent(int i) const;
- MEDCOUPLING_EXPORT void setInfoOnComponent(int i, const char *info);
+ MEDCOUPLING_EXPORT void setInfoOnComponent(int i, const std::string& info);
MEDCOUPLING_EXPORT int getNumberOfComponents() const { return (int)_info_on_compo.size(); }
MEDCOUPLING_EXPORT void setPartOfValuesBase3(const DataArray *aBase, const int *bgTuples, const int *endTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true);
MEDCOUPLING_EXPORT virtual DataArray *deepCpy() const = 0;
MEDCOUPLING_EXPORT virtual DataArray *selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const = 0;
MEDCOUPLING_EXPORT virtual DataArray *selectByTupleId2(int bg, int end2, int step) const = 0;
MEDCOUPLING_EXPORT virtual void rearrange(int newNbOfCompo) = 0;
- MEDCOUPLING_EXPORT void checkNbOfTuples(int nbOfTuples, const char *msg) const;
- MEDCOUPLING_EXPORT void checkNbOfComps(int nbOfCompo, const char *msg) const;
- MEDCOUPLING_EXPORT void checkNbOfTuplesAndComp(const DataArray& other, const char *msg) const;
- MEDCOUPLING_EXPORT void checkNbOfTuplesAndComp(int nbOfTuples, int nbOfCompo, const char *msg) const;
- MEDCOUPLING_EXPORT void checkNbOfElems(std::size_t nbOfElems, const char *msg) const;
+ MEDCOUPLING_EXPORT void checkNbOfTuples(int nbOfTuples, const std::string& msg) const;
+ MEDCOUPLING_EXPORT void checkNbOfComps(int nbOfCompo, const std::string& msg) const;
+ MEDCOUPLING_EXPORT void checkNbOfTuplesAndComp(const DataArray& other, const std::string& msg) const;
+ MEDCOUPLING_EXPORT void checkNbOfTuplesAndComp(int nbOfTuples, int nbOfCompo, const std::string& msg) const;
+ MEDCOUPLING_EXPORT void checkNbOfElems(std::size_t nbOfElems, const std::string& msg) const;
MEDCOUPLING_EXPORT static void GetSlice(int start, int stop, int step, int sliceId, int nbOfSlices, int& startSlice, int& stopSlice);
- MEDCOUPLING_EXPORT static int GetNumberOfItemGivenBES(int begin, int end, int step, const char *msg);
- MEDCOUPLING_EXPORT static int GetNumberOfItemGivenBESRelative(int begin, int end, int step, const char *msg);
+ MEDCOUPLING_EXPORT static int GetNumberOfItemGivenBES(int begin, int end, int step, const std::string& msg);
+ MEDCOUPLING_EXPORT static int GetNumberOfItemGivenBESRelative(int begin, int end, int step, const std::string& msg);
MEDCOUPLING_EXPORT static int GetPosOfItemGivenBESRelativeNoThrow(int value, int begin, int end, int step);
MEDCOUPLING_EXPORT static std::string GetVarNameFromInfo(const std::string& info);
MEDCOUPLING_EXPORT static std::string GetUnitFromInfo(const std::string& info);
MEDCOUPLING_EXPORT virtual void reprZipStream(std::ostream& stream) const = 0;
MEDCOUPLING_EXPORT virtual void reprWithoutNameStream(std::ostream& stream) const;
MEDCOUPLING_EXPORT virtual void reprZipWithoutNameStream(std::ostream& stream) const = 0;
- MEDCOUPLING_EXPORT virtual void reprCppStream(const char *varName, std::ostream& stream) const = 0;
+ MEDCOUPLING_EXPORT virtual void reprCppStream(const std::string& varName, std::ostream& stream) const = 0;
MEDCOUPLING_EXPORT virtual void reprQuickOverview(std::ostream& stream) const = 0;
MEDCOUPLING_EXPORT virtual void reprQuickOverviewData(std::ostream& stream, std::size_t maxNbOfByteInRepr) const = 0;
protected:
DataArray() { }
~DataArray() { }
protected:
- static void CheckValueInRange(int ref, int value, const char *msg);
- static void CheckValueInRangeEx(int value, int start, int end, const char *msg);
- static void CheckClosingParInRange(int ref, int value, const char *msg);
+ static void CheckValueInRange(int ref, int value, const std::string& msg);
+ static void CheckValueInRangeEx(int value, int start, int end, const std::string& msg);
+ static void CheckClosingParInRange(int ref, int value, const std::string& msg);
protected:
std::string _name;
std::vector<std::string> _info_on_compo;
MEDCOUPLING_EXPORT bool isMonotonic(bool increasing, double eps) const;
MEDCOUPLING_EXPORT std::string repr() const;
MEDCOUPLING_EXPORT std::string reprZip() const;
- MEDCOUPLING_EXPORT void writeVTK(std::ostream& ofs, int indent, const char *nameInFile, DataArrayByte *byteArr) const;
+ MEDCOUPLING_EXPORT void writeVTK(std::ostream& ofs, int indent, const std::string& nameInFile, DataArrayByte *byteArr) const;
MEDCOUPLING_EXPORT void reprStream(std::ostream& stream) const;
MEDCOUPLING_EXPORT void reprZipStream(std::ostream& stream) const;
MEDCOUPLING_EXPORT void reprWithoutNameStream(std::ostream& stream) const;
MEDCOUPLING_EXPORT void reprZipWithoutNameStream(std::ostream& stream) const;
- MEDCOUPLING_EXPORT void reprCppStream(const char *varName, std::ostream& stream) const;
+ MEDCOUPLING_EXPORT void reprCppStream(const std::string& varName, std::ostream& stream) const;
MEDCOUPLING_EXPORT void reprQuickOverview(std::ostream& stream) const;
MEDCOUPLING_EXPORT void reprQuickOverviewData(std::ostream& stream, std::size_t maxNbOfByteInRepr) const;
MEDCOUPLING_EXPORT bool isEqual(const DataArrayDouble& other, double prec) const;
MEDCOUPLING_EXPORT void applyRPow(double val);
MEDCOUPLING_EXPORT DataArrayDouble *negate() const;
MEDCOUPLING_EXPORT DataArrayDouble *applyFunc(int nbOfComp, FunctionToEvaluate func) const;
- MEDCOUPLING_EXPORT DataArrayDouble *applyFunc(int nbOfComp, const char *func) const;
- MEDCOUPLING_EXPORT DataArrayDouble *applyFunc(const char *func) const;
- MEDCOUPLING_EXPORT DataArrayDouble *applyFunc2(int nbOfComp, const char *func) const;
- MEDCOUPLING_EXPORT DataArrayDouble *applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) const;
- MEDCOUPLING_EXPORT void applyFuncFast32(const char *func);
- MEDCOUPLING_EXPORT void applyFuncFast64(const char *func);
+ MEDCOUPLING_EXPORT DataArrayDouble *applyFunc(int nbOfComp, const std::string& func) const;
+ MEDCOUPLING_EXPORT DataArrayDouble *applyFunc(const std::string& func) const;
+ MEDCOUPLING_EXPORT DataArrayDouble *applyFunc2(int nbOfComp, const std::string& func) const;
+ MEDCOUPLING_EXPORT DataArrayDouble *applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const;
+ MEDCOUPLING_EXPORT void applyFuncFast32(const std::string& func);
+ MEDCOUPLING_EXPORT void applyFuncFast64(const std::string& func);
MEDCOUPLING_EXPORT DataArrayInt *getIdsInRange(double vmin, double vmax) const;
MEDCOUPLING_EXPORT DataArrayInt *getIdsNotInRange(double vmin, double vmax) const;
MEDCOUPLING_EXPORT static DataArrayDouble *Aggregate(const DataArrayDouble *a1, const DataArrayDouble *a2);
MEDCOUPLING_EXPORT void iota(int init=0);
MEDCOUPLING_EXPORT std::string repr() const;
MEDCOUPLING_EXPORT std::string reprZip() const;
- MEDCOUPLING_EXPORT void writeVTK(std::ostream& ofs, int indent, const char *type, const char *nameInFile, DataArrayByte *byteArr) const;
+ MEDCOUPLING_EXPORT void writeVTK(std::ostream& ofs, int indent, const std::string& type, const std::string& nameInFile, DataArrayByte *byteArr) const;
MEDCOUPLING_EXPORT void reprStream(std::ostream& stream) const;
MEDCOUPLING_EXPORT void reprZipStream(std::ostream& stream) const;
MEDCOUPLING_EXPORT void reprWithoutNameStream(std::ostream& stream) const;
MEDCOUPLING_EXPORT void reprZipWithoutNameStream(std::ostream& stream) const;
- MEDCOUPLING_EXPORT void reprCppStream(const char *varName, std::ostream& stream) const;
+ MEDCOUPLING_EXPORT void reprCppStream(const std::string& varName, std::ostream& stream) const;
MEDCOUPLING_EXPORT void reprQuickOverview(std::ostream& stream) const;
MEDCOUPLING_EXPORT void reprQuickOverviewData(std::ostream& stream, std::size_t maxNbOfByteInRepr) const;
MEDCOUPLING_EXPORT void transformWithIndArr(const int *indArrBg, const int *indArrEnd);
MEDCOUPLING_EXPORT void reprZipStream(std::ostream& stream) const;
MEDCOUPLING_EXPORT void reprWithoutNameStream(std::ostream& stream) const;
MEDCOUPLING_EXPORT void reprZipWithoutNameStream(std::ostream& stream) const;
- MEDCOUPLING_EXPORT void reprCppStream(const char *varName, std::ostream& stream) const;
+ MEDCOUPLING_EXPORT void reprCppStream(const std::string& varName, std::ostream& stream) const;
MEDCOUPLING_EXPORT void reprQuickOverview(std::ostream& stream) const;
MEDCOUPLING_EXPORT void reprQuickOverviewData(std::ostream& stream, std::size_t maxNbOfByteInRepr) const;
MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const DataArrayChar& other, std::string& reason) const;
MEDCOUPLING_EXPORT void reprZipStream(std::ostream& stream) const;
MEDCOUPLING_EXPORT void reprWithoutNameStream(std::ostream& stream) const;
MEDCOUPLING_EXPORT void reprZipWithoutNameStream(std::ostream& stream) const;
- MEDCOUPLING_EXPORT void reprCppStream(const char *varName, std::ostream& stream) const;
+ MEDCOUPLING_EXPORT void reprCppStream(const std::string& varName, std::ostream& stream) const;
MEDCOUPLING_EXPORT void reprQuickOverview(std::ostream& stream) const;
MEDCOUPLING_EXPORT void reprQuickOverviewData(std::ostream& stream, std::size_t maxNbOfByteInRepr) const;
MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const DataArrayChar& other, std::string& reason) const;
for(;j<newNbOfComp;j++)
nc[newNbOfComp*i+j]=dftValue;
}
- ret->setName(getName().c_str());
+ ret->setName(getName());
for(int i=0;i<dim;i++)
- ret->setInfoOnComponent(i,getInfoOnComponent(i).c_str());
- ret->setName(getName().c_str());
+ ret->setInfoOnComponent(i,getInfoOnComponent(i));
+ ret->setName(getName());
return ret.retn();
}
int k=0;
for(int i=0;i<(int)a.size();i++)
for(int j=0;j<nbc[i];j++,k++)
- ret->setInfoOnComponent(k,a[i]->getInfoOnComponent(j).c_str());
+ ret->setInfoOnComponent(k,a[i]->getInfoOnComponent(j));
return ret;
}
_mem.reprZip(getNumberOfComponents(),stream);
}
-void DataArrayByte::reprCppStream(const char *varName, std::ostream& stream) const
+void DataArrayByte::reprCppStream(const std::string& varName, std::ostream& stream) const
{
int nbTuples=getNumberOfTuples(),nbComp=getNumberOfComponents();
const char *data=getConstPointer();
reprWithoutNameStream(stream);
}
-void DataArrayAsciiChar::reprCppStream(const char *varName, std::ostream& stream) const
+void DataArrayAsciiChar::reprCppStream(const std::string& varName, std::ostream& stream) const
{
int nbTuples=getNumberOfTuples(),nbComp=getNumberOfComponents();
const char *data=getConstPointer();
* \ref cpp_mcmesh_fillFromAnalytic "Here is a C++ example".<br>
* \ref py_mcmesh_fillFromAnalytic "Here is a Python example".
*/
-MEDCouplingFieldDouble *MEDCouplingMesh::fillFromAnalytic(TypeOfField t, int nbOfComp, const char *func) const
+MEDCouplingFieldDouble *MEDCouplingMesh::fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const
{
MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=MEDCouplingFieldDouble::New(t,ONE_TIME);
ret->setMesh(this);
* function to coordinates of field location points (defined by the given field type).
* For example, if \a t == ParaMEDMEM::ON_CELLS, the function is applied to cell
* barycenters. This method differs from
- * \ref MEDCouplingMesh::fillFromAnalytic(TypeOfField t, int nbOfComp, const char *func) const "fillFromAnalytic()"
+ * \ref MEDCouplingMesh::fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const "fillFromAnalytic()"
* by the way how variable
* names, used in the function, are associated with components of coordinates of field
* location points; here, a variable name corresponding to a component is retrieved from
* \ref cpp_mcmesh_fillFromAnalytic2 "Here is a C++ example".<br>
* \ref py_mcmesh_fillFromAnalytic2 "Here is a Python example".
*/
-MEDCouplingFieldDouble *MEDCouplingMesh::fillFromAnalytic2(TypeOfField t, int nbOfComp, const char *func) const
+MEDCouplingFieldDouble *MEDCouplingMesh::fillFromAnalytic2(TypeOfField t, int nbOfComp, const std::string& func) const
{
MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=MEDCouplingFieldDouble::New(t,ONE_TIME);
ret->setMesh(this);
* \ref cpp_mcmesh_fillFromAnalytic3 "Here is a C++ example".<br>
* \ref py_mcmesh_fillFromAnalytic3 "Here is a Python example".
*/
-MEDCouplingFieldDouble *MEDCouplingMesh::fillFromAnalytic3(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) const
+MEDCouplingFieldDouble *MEDCouplingMesh::fillFromAnalytic3(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const
{
MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=MEDCouplingFieldDouble::New(t,ONE_TIME);
ret->setMesh(this);
* \param [in] fileName - the name of the file to write in.
* \throw If \a fileName is not a writable file.
*/
-void MEDCouplingMesh::writeVTK(const char *fileName, bool isBinary) const
+void MEDCouplingMesh::writeVTK(const std::string& fileName, bool isBinary) const
{
std::string cda,pda;
MEDCouplingAutoRefCountObjectPtr<DataArrayByte> byteArr;
writeVTKAdvanced(fileName,cda,pda,byteArr);
}
-void MEDCouplingMesh::writeVTKAdvanced(const char *fileName, const std::string& cda, const std::string& pda, DataArrayByte *byteData) const
+void MEDCouplingMesh::writeVTKAdvanced(const std::string& fileName, const std::string& cda, const std::string& pda, DataArrayByte *byteData) const
{
- std::ofstream ofs(fileName);
+ std::ofstream ofs(fileName.c_str());
ofs << "<VTKFile type=\"" << getVTKDataSetType() << "\" version=\"0.1\" byte_order=\"" << MEDCouplingByteOrderStr() << "\">\n";
writeVTKLL(ofs,cda,pda,byteData);
if(byteData)
{
ofs << "<AppendedData encoding=\"raw\">\n_1234";
ofs << std::flush; ofs.close();
- std::ofstream ofs2(fileName,std::ios_base::binary | std::ios_base::app);
+ std::ofstream ofs2(fileName.c_str(),std::ios_base::binary | std::ios_base::app);
ofs2.write(byteData->begin(),byteData->getNbOfElems()); ofs2 << std::flush; ofs2.close();
- std::ofstream ofs3(fileName,std::ios_base::app); ofs3 << "\n</AppendedData>\n</VTKFile>\n"; ofs3.close();
+ std::ofstream ofs3(fileName.c_str(),std::ios_base::app); ofs3 << "\n</AppendedData>\n</VTKFile>\n"; ofs3.close();
}
else
{
{
public:
MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
- MEDCOUPLING_EXPORT void setName(const char *name) { _name=name; }
+ MEDCOUPLING_EXPORT void setName(const std::string& name) { _name=name; }
MEDCOUPLING_EXPORT std::string getName() const { return _name; }
- MEDCOUPLING_EXPORT void setDescription(const char *descr) { _description=descr; }
+ MEDCOUPLING_EXPORT void setDescription(const std::string& descr) { _description=descr; }
MEDCOUPLING_EXPORT std::string getDescription() const { return _description; }
MEDCOUPLING_EXPORT double getTime(int& iteration, int& order) const { iteration=_iteration; order=_order; return _time; }
MEDCOUPLING_EXPORT void setTime(double val, int iteration, int order) { _time=val; _iteration=iteration; _order=order; }
- MEDCOUPLING_EXPORT void setTimeUnit(const char *unit) { _time_unit=unit; }
- MEDCOUPLING_EXPORT const char *getTimeUnit() const { return _time_unit.c_str(); }
+ MEDCOUPLING_EXPORT void setTimeUnit(const std::string& unit) { _time_unit=unit; }
+ MEDCOUPLING_EXPORT std::string getTimeUnit() const { return _time_unit; }
MEDCOUPLING_EXPORT virtual MEDCouplingMesh *deepCpy() const = 0;
MEDCOUPLING_EXPORT virtual MEDCouplingMeshType getType() const = 0;
MEDCOUPLING_EXPORT bool isStructured() const;
MEDCOUPLING_EXPORT virtual void getCellsContainingPoint(const double *pos, double eps, std::vector<int>& elts) const;
MEDCOUPLING_EXPORT virtual void getCellsContainingPoints(const double *pos, int nbOfPoints, double eps, MEDCouplingAutoRefCountObjectPtr<DataArrayInt>& elts, MEDCouplingAutoRefCountObjectPtr<DataArrayInt>& eltsIndex) const;
MEDCOUPLING_EXPORT virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, FunctionToEvaluate func) const;
- MEDCOUPLING_EXPORT virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const char *func) const;
- MEDCOUPLING_EXPORT virtual MEDCouplingFieldDouble *fillFromAnalytic2(TypeOfField t, int nbOfComp, const char *func) const;
- MEDCOUPLING_EXPORT virtual MEDCouplingFieldDouble *fillFromAnalytic3(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) const;
+ MEDCOUPLING_EXPORT virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const;
+ MEDCOUPLING_EXPORT virtual MEDCouplingFieldDouble *fillFromAnalytic2(TypeOfField t, int nbOfComp, const std::string& func) const;
+ MEDCOUPLING_EXPORT virtual MEDCouplingFieldDouble *fillFromAnalytic3(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const;
MEDCOUPLING_EXPORT virtual MEDCouplingFieldDouble *buildOrthogonalField() const = 0;
MEDCOUPLING_EXPORT virtual void rotate(const double *center, const double *vector, double angle) = 0;
MEDCOUPLING_EXPORT virtual void translate(const double *vector) = 0;
MEDCOUPLING_EXPORT virtual void serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const = 0;
MEDCOUPLING_EXPORT virtual void unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2,
const std::vector<std::string>& littleStrings) = 0;
- MEDCOUPLING_EXPORT void writeVTK(const char *fileName, bool isBinary=true) const;
+ MEDCOUPLING_EXPORT void writeVTK(const std::string& fileName, bool isBinary=true) const;
/// @cond INTERNAL
- MEDCOUPLING_EXPORT void writeVTKAdvanced(const char *fileName, const std::string& cda, const std::string& pda, DataArrayByte *byteData) const;
+ MEDCOUPLING_EXPORT void writeVTKAdvanced(const std::string& fileName, const std::string& cda, const std::string& pda, DataArrayByte *byteData) const;
/// @endcond
MEDCOUPLING_EXPORT virtual void writeVTKLL(std::ostream& ofs, const std::string& cellData, const std::string& pointData, DataArrayByte *byteData) const = 0;
MEDCOUPLING_EXPORT virtual void reprQuickOverview(std::ostream& stream) const = 0;
if(tinyInfo[2]>=0 && tinyInfo[1]>=1)
{
setCoords(a2);
- setName(littleStrings[0].c_str());
- setDescription(littleStrings[1].c_str());
- a2->setName(littleStrings[2].c_str());
- setTimeUnit(littleStrings[3].c_str());
+ setName(littleStrings[0]);
+ setDescription(littleStrings[1]);
+ a2->setName(littleStrings[2]);
+ setTimeUnit(littleStrings[3]);
for(int i=0;i<tinyInfo[1];i++)
- getCoords()->setInfoOnComponent(i,littleStrings[i+4].c_str());
+ getCoords()->setInfoOnComponent(i,littleStrings[i+4]);
setTime(tinyInfoD[0],tinyInfo[3],tinyInfo[4]);
}
else
{
- setName(littleStrings[0].c_str());
- setDescription(littleStrings[1].c_str());
- setTimeUnit(littleStrings[2].c_str());
+ setName(littleStrings[0]);
+ setDescription(littleStrings[1]);
+ setTimeUnit(littleStrings[2]);
setTime(tinyInfoD[0],tinyInfo[3],tinyInfo[4]);
}
}
{
DataArrayInt *cellIdsKept=0;
fillCellIdsToKeepFromNodeIds(begin,end,fullyIn,cellIdsKept);
- cellIdsKept->setName(getName().c_str());
+ cellIdsKept->setName(getName());
return cellIdsKept;
}
releaseData(false);
}
-int MEDCouplingRemapper::prepare(const MEDCouplingMesh *srcMesh, const MEDCouplingMesh *targetMesh, const char *method)
+int MEDCouplingRemapper::prepare(const MEDCouplingMesh *srcMesh, const MEDCouplingMesh *targetMesh, const std::string& method)
{
if(!srcMesh || !targetMesh)
throw INTERP_KERNEL::Exception("MEDCouplingRemapper::prepare : presence of NULL input pointer !");
std::string srcMethod,targetMethod;
INTERP_KERNEL::Interpolation<INTERP_KERNEL::Interpolation3D>::CheckAndSplitInterpolationMethod(method,srcMethod,targetMethod);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldTemplate> src=MEDCouplingFieldTemplate::New(MEDCouplingFieldDiscretization::GetTypeOfFieldFromStringRepr(srcMethod.c_str()));
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldTemplate> src=MEDCouplingFieldTemplate::New(MEDCouplingFieldDiscretization::GetTypeOfFieldFromStringRepr(srcMethod));
src->setMesh(srcMesh);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldTemplate> target=MEDCouplingFieldTemplate::New(MEDCouplingFieldDiscretization::GetTypeOfFieldFromStringRepr(targetMethod.c_str()));
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldTemplate> target=MEDCouplingFieldTemplate::New(MEDCouplingFieldDiscretization::GetTypeOfFieldFromStringRepr(targetMethod));
target->setMesh(targetMesh);
return prepareEx(src,target);
}
MEDCouplingNormalizedUnstructuredMesh<1,1> source_mesh_wrapper(src_mesh);
MEDCouplingNormalizedUnstructuredMesh<1,1> target_mesh_wrapper(target_mesh);
INTERP_KERNEL::Interpolation1D interpolation(*this);
- nbCols=interpolation.interpolateMeshes(source_mesh_wrapper,target_mesh_wrapper,_matrix,method.c_str());
+ nbCols=interpolation.interpolateMeshes(source_mesh_wrapper,target_mesh_wrapper,_matrix,method);
}
else if(srcMeshDim==1 && trgMeshDim==1 && srcSpaceDim==2)
{
MEDCouplingNormalizedUnstructuredMesh<2,1> source_mesh_wrapper(src_mesh);
MEDCouplingNormalizedUnstructuredMesh<2,1> target_mesh_wrapper(target_mesh);
INTERP_KERNEL::Interpolation2DCurve interpolation(*this);
- nbCols=interpolation.interpolateMeshes(source_mesh_wrapper,target_mesh_wrapper,_matrix,method.c_str());
+ nbCols=interpolation.interpolateMeshes(source_mesh_wrapper,target_mesh_wrapper,_matrix,method);
}
else if(srcMeshDim==2 && trgMeshDim==2 && srcSpaceDim==2)
{
MEDCouplingNormalizedUnstructuredMesh<2,2> source_mesh_wrapper(src_mesh);
MEDCouplingNormalizedUnstructuredMesh<2,2> target_mesh_wrapper(target_mesh);
INTERP_KERNEL::Interpolation2D interpolation(*this);
- nbCols=interpolation.interpolateMeshes(source_mesh_wrapper,target_mesh_wrapper,_matrix,method.c_str());
+ nbCols=interpolation.interpolateMeshes(source_mesh_wrapper,target_mesh_wrapper,_matrix,method);
}
else if(srcMeshDim==3 && trgMeshDim==3 && srcSpaceDim==3)
{
MEDCouplingNormalizedUnstructuredMesh<3,3> source_mesh_wrapper(src_mesh);
MEDCouplingNormalizedUnstructuredMesh<3,3> target_mesh_wrapper(target_mesh);
INTERP_KERNEL::Interpolation3D interpolation(*this);
- nbCols=interpolation.interpolateMeshes(source_mesh_wrapper,target_mesh_wrapper,_matrix,method.c_str());
+ nbCols=interpolation.interpolateMeshes(source_mesh_wrapper,target_mesh_wrapper,_matrix,method);
}
else if(srcMeshDim==2 && trgMeshDim==2 && srcSpaceDim==3)
{
MEDCouplingNormalizedUnstructuredMesh<3,2> source_mesh_wrapper(src_mesh);
MEDCouplingNormalizedUnstructuredMesh<3,2> target_mesh_wrapper(target_mesh);
INTERP_KERNEL::Interpolation3DSurf interpolation(*this);
- nbCols=interpolation.interpolateMeshes(source_mesh_wrapper,target_mesh_wrapper,_matrix,method.c_str());
+ nbCols=interpolation.interpolateMeshes(source_mesh_wrapper,target_mesh_wrapper,_matrix,method);
}
else if(srcMeshDim==3 && trgMeshDim==1 && srcSpaceDim==3)
{
MEDCouplingNormalizedUnstructuredMesh<3,3> source_mesh_wrapper(src_mesh);
MEDCouplingNormalizedUnstructuredMesh<3,3> target_mesh_wrapper(target_mesh);
INTERP_KERNEL::Interpolation3D interpolation(*this);
- nbCols=interpolation.interpolateMeshes(source_mesh_wrapper,target_mesh_wrapper,_matrix,method.c_str());
+ nbCols=interpolation.interpolateMeshes(source_mesh_wrapper,target_mesh_wrapper,_matrix,method);
}
else if(srcMeshDim==1 && trgMeshDim==3 && srcSpaceDim==3)
{
MEDCouplingNormalizedUnstructuredMesh<3,3> target_mesh_wrapper(target_mesh);
INTERP_KERNEL::Interpolation3D interpolation(*this);
std::vector<std::map<int,double> > matrixTmp;
- nbCols=interpolation.interpolateMeshes(target_mesh_wrapper,source_mesh_wrapper,matrixTmp,method.c_str());
+ nbCols=interpolation.interpolateMeshes(target_mesh_wrapper,source_mesh_wrapper,matrixTmp,method);
ReverseMatrix(matrixTmp,nbCols,_matrix);
nbCols=matrixTmp.size();
}
MEDCouplingNormalizedUnstructuredMesh<2,2> source_mesh_wrapper(src_mesh);
MEDCouplingNormalizedUnstructuredMesh<2,2> target_mesh_wrapper(target_mesh);
INTERP_KERNEL::Interpolation2D interpolation(*this);
- nbCols=interpolation.interpolateMeshes(source_mesh_wrapper,target_mesh_wrapper,_matrix,method.c_str());
+ nbCols=interpolation.interpolateMeshes(source_mesh_wrapper,target_mesh_wrapper,_matrix,method);
}
else
{
MEDCouplingNormalizedUnstructuredMesh<2,2> target_mesh_wrapper(target_mesh);
INTERP_KERNEL::Interpolation2D1D interpolation(*this);
std::vector<std::map<int,double> > matrixTmp;
- nbCols=interpolation.interpolateMeshes(target_mesh_wrapper,source_mesh_wrapper,matrixTmp,method.c_str());
+ nbCols=interpolation.interpolateMeshes(target_mesh_wrapper,source_mesh_wrapper,matrixTmp,method);
ReverseMatrix(matrixTmp,nbCols,_matrix);
nbCols=matrixTmp.size();
INTERP_KERNEL::Interpolation2D1D::DuplicateFacesType duplicateFaces=interpolation.retrieveDuplicateFaces();
MEDCouplingNormalizedUnstructuredMesh<2,2> target_mesh_wrapper(target_mesh);
INTERP_KERNEL::Interpolation2D interpolation(*this);
std::vector<std::map<int,double> > matrixTmp;
- nbCols=interpolation.interpolateMeshes(target_mesh_wrapper,source_mesh_wrapper,matrixTmp,method.c_str());
+ nbCols=interpolation.interpolateMeshes(target_mesh_wrapper,source_mesh_wrapper,matrixTmp,method);
ReverseMatrix(matrixTmp,nbCols,_matrix);
nbCols=matrixTmp.size();
}
MEDCouplingNormalizedUnstructuredMesh<2,2> source_mesh_wrapper(src_mesh);
MEDCouplingNormalizedUnstructuredMesh<2,2> target_mesh_wrapper(target_mesh);
INTERP_KERNEL::Interpolation2D1D interpolation(*this);
- nbCols=interpolation.interpolateMeshes(source_mesh_wrapper,target_mesh_wrapper,_matrix,method.c_str());
+ nbCols=interpolation.interpolateMeshes(source_mesh_wrapper,target_mesh_wrapper,_matrix,method);
INTERP_KERNEL::Interpolation2D1D::DuplicateFacesType duplicateFaces=interpolation.retrieveDuplicateFaces();
if(!duplicateFaces.empty())
{
MEDCouplingNormalizedUnstructuredMesh<3,3> source_mesh_wrapper(src_mesh);
MEDCouplingNormalizedUnstructuredMesh<3,3> target_mesh_wrapper(target_mesh);
INTERP_KERNEL::Interpolation3D2D interpolation(*this);
- nbCols=interpolation.interpolateMeshes(source_mesh_wrapper,target_mesh_wrapper,_matrix,method.c_str());
+ nbCols=interpolation.interpolateMeshes(source_mesh_wrapper,target_mesh_wrapper,_matrix,method);
INTERP_KERNEL::Interpolation3D2D::DuplicateFacesType duplicateFaces=interpolation.retrieveDuplicateFaces();
if(!duplicateFaces.empty())
{
MEDCouplingNormalizedUnstructuredMesh<3,3> target_mesh_wrapper(target_mesh);
INTERP_KERNEL::Interpolation3D2D interpolation(*this);
std::vector<std::map<int,double> > matrixTmp;
- nbCols=interpolation.interpolateMeshes(target_mesh_wrapper,source_mesh_wrapper,matrixTmp,method.c_str());
+ nbCols=interpolation.interpolateMeshes(target_mesh_wrapper,source_mesh_wrapper,matrixTmp,method);
ReverseMatrix(matrixTmp,nbCols,_matrix);
nbCols=matrixTmp.size();
INTERP_KERNEL::Interpolation3D2D::DuplicateFacesType duplicateFaces=interpolation.retrieveDuplicateFaces();
{
MEDCouplingNormalizedUnstructuredMesh<2,2> source_mesh_wrapper(src_mesh);
INTERP_KERNEL::Interpolation2D interpolation(*this);
- nbCols=interpolation.toIntegralUniform(source_mesh_wrapper,_matrix,srcMeth.c_str());
+ nbCols=interpolation.toIntegralUniform(source_mesh_wrapper,_matrix,srcMeth);
}
else if(srcMeshDim==3 && srcSpaceDim==3)
{
MEDCouplingNormalizedUnstructuredMesh<3,3> source_mesh_wrapper(src_mesh);
INTERP_KERNEL::Interpolation3D interpolation(*this);
- nbCols=interpolation.toIntegralUniform(source_mesh_wrapper,_matrix,srcMeth.c_str());
+ nbCols=interpolation.toIntegralUniform(source_mesh_wrapper,_matrix,srcMeth);
}
else if(srcMeshDim==2 && srcSpaceDim==3)
{
MEDCouplingNormalizedUnstructuredMesh<3,2> source_mesh_wrapper(src_mesh);
INTERP_KERNEL::Interpolation3DSurf interpolation(*this);
- nbCols=interpolation.toIntegralUniform(source_mesh_wrapper,_matrix,srcMeth.c_str());
+ nbCols=interpolation.toIntegralUniform(source_mesh_wrapper,_matrix,srcMeth);
}
else
throw INTERP_KERNEL::Exception("No interpolation available for the given mesh and space dimension of source mesh to -1D targetMesh");
{
MEDCouplingNormalizedUnstructuredMesh<2,2> source_mesh_wrapper(target_mesh);
INTERP_KERNEL::Interpolation2D interpolation(*this);
- nbCols=interpolation.fromIntegralUniform(source_mesh_wrapper,_matrix,trgMeth.c_str());
+ nbCols=interpolation.fromIntegralUniform(source_mesh_wrapper,_matrix,trgMeth);
}
else if(trgMeshDim==3 && trgSpaceDim==3)
{
MEDCouplingNormalizedUnstructuredMesh<3,3> source_mesh_wrapper(target_mesh);
INTERP_KERNEL::Interpolation3D interpolation(*this);
- nbCols=interpolation.fromIntegralUniform(source_mesh_wrapper,_matrix,trgMeth.c_str());
+ nbCols=interpolation.fromIntegralUniform(source_mesh_wrapper,_matrix,trgMeth);
}
else if(trgMeshDim==2 && trgSpaceDim==3)
{
MEDCouplingNormalizedUnstructuredMesh<3,2> source_mesh_wrapper(target_mesh);
INTERP_KERNEL::Interpolation3DSurf interpolation(*this);
- nbCols=interpolation.fromIntegralUniform(source_mesh_wrapper,_matrix,trgMeth.c_str());
+ nbCols=interpolation.fromIntegralUniform(source_mesh_wrapper,_matrix,trgMeth);
}
else
throw INTERP_KERNEL::Exception("No interpolation available for the given mesh and space dimension of source mesh from -1D sourceMesh");
MEDCouplingNormalizedUnstructuredMesh<3,2> target_mesh_wrapper(target_mesh->getMesh2D());
INTERP_KERNEL::Interpolation3DSurf interpolation2D(*this);
std::vector<std::map<int,double> > matrix2D;
- int nbCols2D=interpolation2D.interpolateMeshes(source_mesh_wrapper,target_mesh_wrapper,matrix2D,methC.c_str());
+ int nbCols2D=interpolation2D.interpolateMeshes(source_mesh_wrapper,target_mesh_wrapper,matrix2D,methC);
MEDCouplingUMesh *s1D,*t1D;
double v[3];
MEDCouplingExtrudedMesh::Project1DMeshes(src_mesh->getMesh1D(),target_mesh->getMesh1D(),getPrecision(),s1D,t1D,v);
MEDCouplingNormalizedUnstructuredMesh<1,1> t1DWrapper(t1D);
std::vector<std::map<int,double> > matrix1D;
INTERP_KERNEL::Interpolation1D interpolation1D(*this);
- int nbCols1D=interpolation1D.interpolateMeshes(s1DWrapper,t1DWrapper,matrix1D,methC.c_str());
+ int nbCols1D=interpolation1D.interpolateMeshes(s1DWrapper,t1DWrapper,matrix1D,methC);
s1D->decrRef();
t1D->decrRef();
buildFinalInterpolationMatrixByConvolution(matrix1D,matrix2D,src_mesh->getMesh3DIds()->getConstPointer(),nbCols2D,nbCols1D,
try
{
std::string tmp1,tmp2;
- INTERP_KERNEL::Interpolation<INTERP_KERNEL::Interpolation3D>::CheckAndSplitInterpolationMethod(method.c_str(),tmp1,tmp2);
+ INTERP_KERNEL::Interpolation<INTERP_KERNEL::Interpolation3D>::CheckAndSplitInterpolationMethod(method,tmp1,tmp2);
return true;
}
catch(INTERP_KERNEL::Exception& /*e*/)
public:
MEDCOUPLINGREMAPPER_EXPORT MEDCouplingRemapper();
MEDCOUPLINGREMAPPER_EXPORT ~MEDCouplingRemapper();
- MEDCOUPLINGREMAPPER_EXPORT int prepare(const MEDCouplingMesh *srcMesh, const MEDCouplingMesh *targetMesh, const char *method);
+ MEDCOUPLINGREMAPPER_EXPORT int prepare(const MEDCouplingMesh *srcMesh, const MEDCouplingMesh *targetMesh, const std::string& method);
MEDCOUPLINGREMAPPER_EXPORT int prepareEx(const MEDCouplingFieldTemplate *src, const MEDCouplingFieldTemplate *target);
MEDCOUPLINGREMAPPER_EXPORT void transfer(const MEDCouplingFieldDouble *srcField, MEDCouplingFieldDouble *targetField, double dftValue);
MEDCOUPLINGREMAPPER_EXPORT void partialTransfer(const MEDCouplingFieldDouble *srcField, MEDCouplingFieldDouble *targetField);
int ns[3];
getNodeGridStructure(ns);
MEDCouplingAutoRefCountObjectPtr<DataArrayInt> conn(Build1GTNodalConnectivity(ns,ns+meshDim));
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> ret(MEDCoupling1SGTUMesh::New(getName().c_str(),GetGeoTypeGivenMeshDimension(meshDim)));
+ MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> ret(MEDCoupling1SGTUMesh::New(getName(),GetGeoTypeGivenMeshDimension(meshDim)));
ret->setNodalConnectivity(conn); ret->setCoords(coords);
return ret.retn();
}
_time_tolerance=tinyInfoD[0];
int nbOfCompo=_array->getNumberOfComponents();
for(int i=0;i<nbOfCompo;i++)
- _array->setInfoOnComponent(i,tinyInfoS[i].c_str());
+ _array->setInfoOnComponent(i,tinyInfoS[i]);
}
void MEDCouplingTimeDiscretization::getTinySerializationDbleInformation(std::vector<double>& tinyInfo) const
setArrays(arrays3,0);
}
-void MEDCouplingTimeDiscretization::applyFunc(int nbOfComp, const char *func)
+void MEDCouplingTimeDiscretization::applyFunc(int nbOfComp, const std::string& func)
{
std::vector<DataArrayDouble *> arrays;
getArrays(arrays);
setArrays(arrays3,0);
}
-void MEDCouplingTimeDiscretization::applyFunc2(int nbOfComp, const char *func)
+void MEDCouplingTimeDiscretization::applyFunc2(int nbOfComp, const std::string& func)
{
std::vector<DataArrayDouble *> arrays;
getArrays(arrays);
setArrays(arrays3,0);
}
-void MEDCouplingTimeDiscretization::applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func)
+void MEDCouplingTimeDiscretization::applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func)
{
std::vector<DataArrayDouble *> arrays;
getArrays(arrays);
setArrays(arrays3,0);
}
-void MEDCouplingTimeDiscretization::applyFunc(const char *func)
+void MEDCouplingTimeDiscretization::applyFunc(const std::string& func)
{
std::vector<DataArrayDouble *> arrays;
getArrays(arrays);
setArrays(arrays3,0);
}
-void MEDCouplingTimeDiscretization::applyFuncFast32(const char *func)
+void MEDCouplingTimeDiscretization::applyFuncFast32(const std::string& func)
{
std::vector<DataArrayDouble *> arrays;
getArrays(arrays);
}
}
-void MEDCouplingTimeDiscretization::applyFuncFast64(const char *func)
+void MEDCouplingTimeDiscretization::applyFuncFast64(const std::string& func)
{
std::vector<DataArrayDouble *> arrays;
getArrays(arrays);
setArrays(arrays3,0);
}
-void MEDCouplingTimeDiscretization::fillFromAnalytic(const DataArrayDouble *loc, int nbOfComp, const char *func)
+void MEDCouplingTimeDiscretization::fillFromAnalytic(const DataArrayDouble *loc, int nbOfComp, const std::string& func)
{
std::vector<DataArrayDouble *> arrays;
getArrays(arrays);
setArrays(arrays3,0);
}
-void MEDCouplingTimeDiscretization::fillFromAnalytic2(const DataArrayDouble *loc, int nbOfComp, const char *func)
+void MEDCouplingTimeDiscretization::fillFromAnalytic2(const DataArrayDouble *loc, int nbOfComp, const std::string& func)
{
std::vector<DataArrayDouble *> arrays;
getArrays(arrays);
setArrays(arrays3,0);
}
-void MEDCouplingTimeDiscretization::fillFromAnalytic3(const DataArrayDouble *loc, int nbOfComp, const std::vector<std::string>& varsOrder, const char *func)
+void MEDCouplingTimeDiscretization::fillFromAnalytic3(const DataArrayDouble *loc, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func)
{
std::vector<DataArrayDouble *> arrays;
getArrays(arrays);
MEDCOUPLING_EXPORT virtual std::size_t getHeapMemorySizeWithoutChildren() const;
MEDCOUPLING_EXPORT virtual std::vector<const BigMemoryObject *> getDirectChildren() const;
MEDCOUPLING_EXPORT static MEDCouplingTimeDiscretization *New(TypeOfTimeDiscretization type);
- MEDCOUPLING_EXPORT void setTimeUnit(const char *unit) { _time_unit=unit; }
- MEDCOUPLING_EXPORT const char *getTimeUnit() const { return _time_unit.c_str(); }
+ MEDCOUPLING_EXPORT void setTimeUnit(const std::string& unit) { _time_unit=unit; }
+ MEDCOUPLING_EXPORT std::string getTimeUnit() const { return _time_unit; }
MEDCOUPLING_EXPORT virtual void copyTinyAttrFrom(const MEDCouplingTimeDiscretization& other);
MEDCOUPLING_EXPORT virtual void copyTinyStringsFrom(const MEDCouplingTimeDiscretization& other);
MEDCOUPLING_EXPORT virtual void checkCoherency() const;
MEDCOUPLING_EXPORT virtual void setOrCreateUniformValueOnAllComponents(int nbOfTuple, double value);
MEDCOUPLING_EXPORT virtual void applyLin(double a, double b, int compoId);
MEDCOUPLING_EXPORT virtual void applyFunc(int nbOfComp, FunctionToEvaluate func);
- MEDCOUPLING_EXPORT virtual void applyFunc(int nbOfComp, const char *func);
- MEDCOUPLING_EXPORT virtual void applyFunc2(int nbOfComp, const char *func);
- MEDCOUPLING_EXPORT virtual void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func);
- MEDCOUPLING_EXPORT virtual void applyFunc(const char *func);
- MEDCOUPLING_EXPORT virtual void applyFuncFast32(const char *func);
- MEDCOUPLING_EXPORT virtual void applyFuncFast64(const char *func);
+ MEDCOUPLING_EXPORT virtual void applyFunc(int nbOfComp, const std::string& func);
+ MEDCOUPLING_EXPORT virtual void applyFunc2(int nbOfComp, const std::string& func);
+ MEDCOUPLING_EXPORT virtual void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func);
+ MEDCOUPLING_EXPORT virtual void applyFunc(const std::string& func);
+ MEDCOUPLING_EXPORT virtual void applyFuncFast32(const std::string& func);
+ MEDCOUPLING_EXPORT virtual void applyFuncFast64(const std::string& func);
MEDCOUPLING_EXPORT virtual void fillFromAnalytic(const DataArrayDouble *loc, int nbOfComp, FunctionToEvaluate func);
- MEDCOUPLING_EXPORT virtual void fillFromAnalytic(const DataArrayDouble *loc, int nbOfComp, const char *func);
- MEDCOUPLING_EXPORT virtual void fillFromAnalytic2(const DataArrayDouble *loc, int nbOfComp, const char *func);
- MEDCOUPLING_EXPORT virtual void fillFromAnalytic3(const DataArrayDouble *loc, int nbOfComp, const std::vector<std::string>& varsOrder, const char *func);
+ MEDCOUPLING_EXPORT virtual void fillFromAnalytic(const DataArrayDouble *loc, int nbOfComp, const std::string& func);
+ MEDCOUPLING_EXPORT virtual void fillFromAnalytic2(const DataArrayDouble *loc, int nbOfComp, const std::string& func);
+ MEDCOUPLING_EXPORT virtual void fillFromAnalytic3(const DataArrayDouble *loc, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func);
//
MEDCOUPLING_EXPORT virtual ~MEDCouplingTimeDiscretization();
protected:
return new MEDCouplingUMesh;
}
-MEDCouplingUMesh *MEDCouplingUMesh::New(const char *meshName, int meshDim)
+MEDCouplingUMesh *MEDCouplingUMesh::New(const std::string& meshName, int meshDim)
{
MEDCouplingUMesh *ret=new MEDCouplingUMesh;
ret->setName(meshName);
const int *conn=_nodal_connec->getConstPointer();
const int *connIndex=_nodal_connec_index->getConstPointer();
std::string name="Mesh constituent of "; name+=getName();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=MEDCouplingUMesh::New(name.c_str(),getMeshDimension()-SonsGenerator::DELTA);
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=MEDCouplingUMesh::New(name,getMeshDimension()-SonsGenerator::DELTA);
ret->setCoords(getCoords());
ret->allocateCells(2*nbOfCells);
descIndx->alloc(nbOfCells+1,1);
}
MEDCouplingAutoRefCountObjectPtr<DataArrayInt> o2n=mesh->zipConnectivityTraducer(compType,nbOfCells);
arr=o2n->substr(nbOfCells);
- arr->setName(other->getName().c_str());
+ arr->setName(other->getName());
int tmp;
if(other->getNumberOfCells()==0)
return true;
}
}
}
- arr2->setName(other->getName().c_str());
+ arr2->setName(other->getName());
if(arr2->presenceOfValue(0))
return false;
arr=arr2.retn();
int mdim=getMeshDimension();
if(mdim<0)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::buildSetInstanceFromThis : invalid mesh dimension ! Should be >= 0 !");
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=MEDCouplingUMesh::New(getName().c_str(),mdim);
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=MEDCouplingUMesh::New(getName(),mdim);
MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp1,tmp2;
bool needToCpyCT=true;
if(!_nodal_connec)
name+=getName();
int nbelem=getNumberOfCells();
MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> field=MEDCouplingFieldDouble::New(ON_CELLS,ONE_TIME);
- field->setName(name.c_str());
+ field->setName(name);
MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> array=DataArrayDouble::New();
array->alloc(nbelem,1);
double *area_vol=array->getPointer();
name+=getName();
int nbelem=(int)std::distance(begin,end);
MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> array=DataArrayDouble::New();
- array->setName(name.c_str());
+ array->setName(name);
array->alloc(nbelem,1);
double *area_vol=array->getPointer();
if(getMeshDimension()!=-1)
if(_types.size()!=1)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertIntoSingleGeoTypeMesh : current mesh does not contain exactly one geometric type !");
INTERP_KERNEL::NormalizedCellType typ=*_types.begin();
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh> ret=MEDCoupling1GTUMesh::New(getName().c_str(),typ);
+ MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh> ret=MEDCoupling1GTUMesh::New(getName(),typ);
ret->setCoords(getCoords());
MEDCoupling1SGTUMesh *retC=dynamic_cast<MEDCoupling1SGTUMesh *>((MEDCoupling1GTUMesh*)ret);
if(retC)
if(!da)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::Build0DMeshFromCoords : instance of DataArrayDouble must be not null !");
da->checkAllocated();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=MEDCouplingUMesh::New(da->getName().c_str(),0);
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=MEDCouplingUMesh::New(da->getName(),0);
ret->setCoords(da);
int nbOfTuples=da->getNumberOfTuples();
MEDCouplingAutoRefCountObjectPtr<DataArrayInt> c=DataArrayInt::New();
tmp->alloc(curNbOfCells,1);
std::copy(o2nPtr+offset,o2nPtr+offset+curNbOfCells,tmp->getPointer());
offset+=curNbOfCells;
- tmp->setName(meshes[i]->getName().c_str());
+ tmp->setName(meshes[i]->getName());
corr[i]=tmp;
}
return ret.retn();
std::vector<DataArrayInt *> partition=partitionBySpreadZone();
std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > partitionAuto; partitionAuto.reserve(partition.size());
std::copy(partition.begin(),partition.end(),std::back_insert_iterator<std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > >(partitionAuto));
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=MEDCouplingUMesh::New(getName().c_str(),mdim);
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=MEDCouplingUMesh::New(getName(),mdim);
ret->setCoords(getCoords());
ret->allocateCells((int)partition.size());
//
if(getMeshDimension()!=3 || getSpaceDimension()!=3)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::tetrahedrize : only available for mesh with meshdim == 3 and spacedim == 3 !");
int nbOfCells(getNumberOfCells()),nbNodes(getNumberOfNodes());
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> ret0(MEDCoupling1SGTUMesh::New(getName().c_str(),INTERP_KERNEL::NORM_TETRA4));
+ MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> ret0(MEDCoupling1SGTUMesh::New(getName(),INTERP_KERNEL::NORM_TETRA4));
MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(nbOfCells,1);
int *retPt(ret->getPointer());
MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newConn(DataArrayInt::New()); newConn->alloc(0,1);
{
public:
MEDCOUPLING_EXPORT static MEDCouplingUMesh *New();
- MEDCOUPLING_EXPORT static MEDCouplingUMesh *New(const char *meshName, int meshDim);
+ MEDCOUPLING_EXPORT static MEDCouplingUMesh *New(const std::string& meshName, int meshDim);
MEDCOUPLING_EXPORT MEDCouplingMesh *deepCpy() const;
MEDCOUPLING_EXPORT MEDCouplingUMesh *clone(bool recDeepCpy) const;
MEDCOUPLING_EXPORT MEDCouplingPointSet *deepCpyConnectivityOnly() const;
class MEDCouplingMesh : public RefCountObject, public TimeLabel
{
public:
- void setName(const char *name);
+ void setName(const std::string& name);
std::string getName() const;
- void setDescription(const char *descr);
+ void setDescription(const std::string& descr);
std::string getDescription() const;
void setTime(double val, int iteration, int order);
- void setTimeUnit(const char *unit);
- const char *getTimeUnit() const;
+ void setTimeUnit(const std::string& unit);
+ std::string getTimeUnit() const;
virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
bool isStructured() const throw(INTERP_KERNEL::Exception);
virtual MEDCouplingMesh *deepCpy() const;
virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
- void writeVTK(const char *fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
+ void writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
// tools
virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingFieldDouble *fillFromAnalytic2(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingFieldDouble *fillFromAnalytic3(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) const throw(INTERP_KERNEL::Exception);
+ virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
+ virtual MEDCouplingFieldDouble *fillFromAnalytic2(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
+ virtual MEDCouplingFieldDouble *fillFromAnalytic3(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const throw(INTERP_KERNEL::Exception);
virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
class MEDCoupling1GTUMesh : public ParaMEDMEM::MEDCouplingPointSet
{
public:
- static MEDCoupling1GTUMesh *New(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
+ static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
class MEDCoupling1SGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
{
public:
- static MEDCoupling1SGTUMesh *New(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
+ static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
DataArrayInt *sortHexa8EachOther() throw(INTERP_KERNEL::Exception);
%extend
{
- MEDCoupling1SGTUMesh(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
+ MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
{
return MEDCoupling1SGTUMesh::New(name,type);
}
class MEDCoupling1DGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
{
public:
- static MEDCoupling1DGTUMesh *New(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
+ static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
bool isPacked() const throw(INTERP_KERNEL::Exception);
%extend
{
- MEDCoupling1DGTUMesh(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
+ MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
{
return MEDCoupling1DGTUMesh::New(name,type);
}
{
public:
static MEDCouplingCMesh *New();
- static MEDCouplingCMesh *New(const char *meshName);
+ static MEDCouplingCMesh *New(const std::string& meshName);
MEDCouplingCMesh *clone(bool recDeepCpy) const;
void setCoords(const DataArrayDouble *coordsX,
const DataArrayDouble *coordsY=0,
{
return MEDCouplingCMesh::New();
}
- MEDCouplingCMesh(const char *meshName)
+ MEDCouplingCMesh(const std::string& meshName)
{
return MEDCouplingCMesh::New(meshName);
}
{
public:
static MEDCouplingCurveLinearMesh *New();
- static MEDCouplingCurveLinearMesh *New(const char *meshName);
+ static MEDCouplingCurveLinearMesh *New(const std::string& meshName);
MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const;
void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
%extend {
{
return MEDCouplingCurveLinearMesh::New();
}
- MEDCouplingCurveLinearMesh(const char *meshName)
+ MEDCouplingCurveLinearMesh(const std::string& meshName)
{
return MEDCouplingCurveLinearMesh::New(meshName);
}
public:
static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
- void setTimeUnit(const char *unit);
- const char *getTimeUnit() const;
+ void setTimeUnit(const std::string& unit);
+ std::string getTimeUnit() const;
void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
- void writeVTK(const char *fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
+ void writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
MEDCouplingFieldDouble *deepCpy() const;
void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
- void fillFromAnalytic(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
- void fillFromAnalytic2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
- void fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
- void applyFunc(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
- void applyFunc2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
- void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
+ void fillFromAnalytic(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
+ void fillFromAnalytic2(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
+ void fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
+ void applyFunc(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
+ void applyFunc2(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
+ void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
- void applyFunc(const char *func) throw(INTERP_KERNEL::Exception);
- void applyFuncFast32(const char *func) throw(INTERP_KERNEL::Exception);
- void applyFuncFast64(const char *func) throw(INTERP_KERNEL::Exception);
+ void applyFunc(const std::string& func) throw(INTERP_KERNEL::Exception);
+ void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
+ void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
double getMaxValue() const throw(INTERP_KERNEL::Exception);
double getMinValue() const throw(INTERP_KERNEL::Exception);
static MEDCouplingFieldDiscretization *New(TypeOfField type) throw(INTERP_KERNEL::Exception);
double getPrecision() const throw(INTERP_KERNEL::Exception);
void setPrecision(double val) throw(INTERP_KERNEL::Exception);
- static TypeOfField GetTypeOfFieldFromStringRepr(const char *repr) throw(INTERP_KERNEL::Exception);
+ static TypeOfField GetTypeOfFieldFromStringRepr(const std::string& repr) throw(INTERP_KERNEL::Exception);
virtual TypeOfField getEnum() const throw(INTERP_KERNEL::Exception);
virtual bool isEqual(const MEDCouplingFieldDiscretization *other, double eps) const throw(INTERP_KERNEL::Exception);
virtual bool isEqualIfNotWhy(const MEDCouplingFieldDiscretization *other, double eps, std::string& reason) const throw(INTERP_KERNEL::Exception);
class DataArray : public RefCountObject, public TimeLabel
{
public:
- void setName(const char *name);
+ void setName(const std::string& name);
void copyStringInfoFrom(const DataArray& other) throw(INTERP_KERNEL::Exception);
void copyPartOfStringInfoFrom(const DataArray& other, const std::vector<int>& compoIds) throw(INTERP_KERNEL::Exception);
void copyPartOfStringInfoFrom2(const std::vector<int>& compoIds, const DataArray& other) throw(INTERP_KERNEL::Exception);
bool areInfoEqualsIfNotWhy(const DataArray& other, std::string& reason) const throw(INTERP_KERNEL::Exception);
bool areInfoEquals(const DataArray& other) const throw(INTERP_KERNEL::Exception);
- std::string cppRepr(const char *varName) const throw(INTERP_KERNEL::Exception);
+ std::string cppRepr(const std::string& varName) const throw(INTERP_KERNEL::Exception);
std::string getName() const;
void setInfoOnComponents(const std::vector<std::string>& info) throw(INTERP_KERNEL::Exception);
void setInfoAndChangeNbOfCompo(const std::vector<std::string>& info) throw(INTERP_KERNEL::Exception);
std::string getInfoOnComponent(int i) const throw(INTERP_KERNEL::Exception);
std::string getVarOnComponent(int i) const throw(INTERP_KERNEL::Exception);
std::string getUnitOnComponent(int i) const throw(INTERP_KERNEL::Exception);
- void setInfoOnComponent(int i, const char *info) throw(INTERP_KERNEL::Exception);
+ void setInfoOnComponent(int i, const std::string& info) throw(INTERP_KERNEL::Exception);
int getNumberOfComponents() const;
virtual void alloc(int nbOfTuple, int nbOfCompo=1) throw(INTERP_KERNEL::Exception);
virtual void reAlloc(int nbOfTuples) throw(INTERP_KERNEL::Exception);
virtual DataArray *deepCpy() const throw(INTERP_KERNEL::Exception);
virtual DataArray *selectByTupleId2(int bg, int end2, int step) const throw(INTERP_KERNEL::Exception);
virtual void rearrange(int newNbOfCompo) throw(INTERP_KERNEL::Exception);
- void checkNbOfTuples(int nbOfTuples, const char *msg) const throw(INTERP_KERNEL::Exception);
- void checkNbOfComps(int nbOfCompo, const char *msg) const throw(INTERP_KERNEL::Exception);
- void checkNbOfTuplesAndComp(const DataArray& other, const char *msg) const throw(INTERP_KERNEL::Exception);
- void checkNbOfTuplesAndComp(int nbOfTuples, int nbOfCompo, const char *msg) const throw(INTERP_KERNEL::Exception);
- void checkNbOfElems(std::size_t nbOfElems, const char *msg) const throw(INTERP_KERNEL::Exception);
- static int GetNumberOfItemGivenBES(int begin, int end, int step, const char *msg) throw(INTERP_KERNEL::Exception);
- static int GetNumberOfItemGivenBESRelative(int begin, int end, int step, const char *msg) throw(INTERP_KERNEL::Exception);
+ void checkNbOfTuples(int nbOfTuples, const std::string& msg) const throw(INTERP_KERNEL::Exception);
+ void checkNbOfComps(int nbOfCompo, const std::string& msg) const throw(INTERP_KERNEL::Exception);
+ void checkNbOfTuplesAndComp(const DataArray& other, const std::string& msg) const throw(INTERP_KERNEL::Exception);
+ void checkNbOfTuplesAndComp(int nbOfTuples, int nbOfCompo, const std::string& msg) const throw(INTERP_KERNEL::Exception);
+ void checkNbOfElems(std::size_t nbOfElems, const std::string& msg) const throw(INTERP_KERNEL::Exception);
+ static int GetNumberOfItemGivenBES(int begin, int end, int step, const std::string& msg) throw(INTERP_KERNEL::Exception);
+ static int GetNumberOfItemGivenBESRelative(int begin, int end, int step, const std::string& msg) throw(INTERP_KERNEL::Exception);
static int GetPosOfItemGivenBESRelativeNoThrow(int value, int begin, int end, int step) throw(INTERP_KERNEL::Exception);
static std::string GetVarNameFromInfo(const std::string& info) throw(INTERP_KERNEL::Exception);
static std::string GetUnitFromInfo(const std::string& info) throw(INTERP_KERNEL::Exception);
void applyRPow(double val) throw(INTERP_KERNEL::Exception);
DataArrayDouble *negate() const throw(INTERP_KERNEL::Exception);
DataArrayDouble *applyFunc(int nbOfComp, FunctionToEvaluate func) const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *applyFunc(int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *applyFunc(const char *func) const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *applyFunc2(int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) const throw(INTERP_KERNEL::Exception);
- void applyFuncFast32(const char *func) throw(INTERP_KERNEL::Exception);
- void applyFuncFast64(const char *func) throw(INTERP_KERNEL::Exception);
+ DataArrayDouble *applyFunc(int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
+ DataArrayDouble *applyFunc(const std::string& func) const throw(INTERP_KERNEL::Exception);
+ DataArrayDouble *applyFunc2(int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
+ DataArrayDouble *applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const throw(INTERP_KERNEL::Exception);
+ void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
+ void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
DataArrayInt *getIdsNotInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
static DataArrayDouble *Aggregate(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
public:
MEDCouplingRemapper();
~MEDCouplingRemapper();
- int prepare(const MEDCouplingMesh *srcMesh, const MEDCouplingMesh *targetMesh, const char *method) throw(INTERP_KERNEL::Exception);
+ int prepare(const MEDCouplingMesh *srcMesh, const MEDCouplingMesh *targetMesh, const std::string& method) throw(INTERP_KERNEL::Exception);
int prepareEx(const MEDCouplingFieldTemplate *src, const MEDCouplingFieldTemplate *target) throw(INTERP_KERNEL::Exception);
void transfer(const MEDCouplingFieldDouble *srcField, MEDCouplingFieldDouble *targetField, double dftValue) throw(INTERP_KERNEL::Exception);
void partialTransfer(const MEDCouplingFieldDouble *srcField, MEDCouplingFieldDouble *targetField) throw(INTERP_KERNEL::Exception);
using namespace ParaMEDMEM;
-MEDFileData *MEDFileData::New(const char *fileName)
+MEDFileData *MEDFileData::New(const std::string& fileName)
{
return new MEDFileData(fileName);
}
return ret;
}
-bool MEDFileData::changeMeshName(const char *oldMeshName, const char *newMeshName)
+bool MEDFileData::changeMeshName(const std::string& oldMeshName, const std::string& newMeshName)
{
std::string oldName(oldMeshName);
std::vector< std::pair<std::string,std::string> > v(1);
MEDFileFields *fs=_fields;
if(fs)
for(std::size_t i=0;i<meshesImpacted.size();i++)
- fs->renumberEntitiesLyingOnMesh(meshesImpacted[i]->getName().c_str(),oldCodeOfMeshImpacted[i],newCodeOfMeshImpacted[i],renumParamsOfMeshImpacted[i]);
+ fs->renumberEntitiesLyingOnMesh(meshesImpacted[i]->getName(),oldCodeOfMeshImpacted[i],newCodeOfMeshImpacted[i],renumParamsOfMeshImpacted[i]);
}
return !meshesImpacted.empty();
}
{
}
-MEDFileData::MEDFileData(const char *fileName)
+MEDFileData::MEDFileData(const std::string& fileName)
try
{
_fields=MEDFileFields::New(fileName);
throw e;
}
-void MEDFileData::write(const char *fileName, int mode) const
+void MEDFileData::write(const std::string& fileName, int mode) const
{
med_access_mode medmod=MEDFileUtilities::TraduceWriteMode(mode);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,medmod);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),medmod);
const MEDFileMeshes *ms=_meshes;
if(ms)
ms->write(fid);
class MEDFileData : public RefCountObject, public MEDFileWritable
{
public:
- MEDLOADER_EXPORT static MEDFileData *New(const char *fileName);
+ MEDLOADER_EXPORT static MEDFileData *New(const std::string& fileName);
MEDLOADER_EXPORT static MEDFileData *New();
MEDLOADER_EXPORT MEDFileData *deepCpy() const;
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDLOADER_EXPORT std::string simpleRepr() const;
//
MEDLOADER_EXPORT bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
- MEDLOADER_EXPORT bool changeMeshName(const char *oldMeshName, const char *newMeshName);
+ MEDLOADER_EXPORT bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName);
MEDLOADER_EXPORT bool unPolyzeMeshes();
//
- MEDLOADER_EXPORT void write(const char *fileName, int mode) const;
+ MEDLOADER_EXPORT void write(const std::string& fileName, int mode) const;
private:
MEDFileData();
- MEDFileData(const char *fileName);
+ MEDFileData(const std::string& fileName);
private:
MEDCouplingAutoRefCountObjectPtr<MEDFileFields> _fields;
MEDCouplingAutoRefCountObjectPtr<MEDFileMeshes> _meshes;
const char MEDFileField1TSWithoutSDA::TYPE_STR[]="FLOAT64";
const char MEDFileIntField1TSWithoutSDA::TYPE_STR[]="INT32";
-MEDFileFieldLoc *MEDFileFieldLoc::New(med_idt fid, const char *locName)
+MEDFileFieldLoc *MEDFileFieldLoc::New(med_idt fid, const std::string& locName)
{
return new MEDFileFieldLoc(fid,locName);
}
return new MEDFileFieldLoc(fid,id);
}
-MEDFileFieldLoc *MEDFileFieldLoc::New(const char *locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w)
+MEDFileFieldLoc *MEDFileFieldLoc::New(const std::string& locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w)
{
return new MEDFileFieldLoc(locName,geoType,refCoo,gsCoo,w);
}
-MEDFileFieldLoc::MEDFileFieldLoc(med_idt fid, const char *locName):_name(locName)
+MEDFileFieldLoc::MEDFileFieldLoc(med_idt fid, const std::string& locName):_name(locName)
{
med_geometry_type geotype;
med_geometry_type sectiongeotype;
int nsectionmeshcell;
INTERP_KERNEL::AutoPtr<char> geointerpname=MEDLoaderBase::buildEmptyString(MED_NAME_SIZE);
INTERP_KERNEL::AutoPtr<char> sectionmeshname=MEDLoaderBase::buildEmptyString(MED_NAME_SIZE);
- MEDlocalizationInfoByName(fid,locName,&geotype,&_dim,&_nb_gauss_pt,geointerpname,sectionmeshname,&nsectionmeshcell,§iongeotype);
+ MEDlocalizationInfoByName(fid,locName.c_str(),&geotype,&_dim,&_nb_gauss_pt,geointerpname,sectionmeshname,&nsectionmeshcell,§iongeotype);
_geo_type=(INTERP_KERNEL::NormalizedCellType)(std::distance(typmai3,std::find(typmai3,typmai3+34,geotype)));
const INTERP_KERNEL::CellModel& cm=INTERP_KERNEL::CellModel::GetCellModel(_geo_type);
_nb_node_per_cell=cm.getNumberOfNodes();
_ref_coo.resize(_dim*_nb_node_per_cell);
_gs_coo.resize(_dim*_nb_gauss_pt);
_w.resize(_nb_gauss_pt);
- MEDlocalizationRd(fid,locName,MED_FULL_INTERLACE,&_ref_coo[0],&_gs_coo[0],&_w[0]);
+ MEDlocalizationRd(fid,locName.c_str(),MED_FULL_INTERLACE,&_ref_coo[0],&_gs_coo[0],&_w[0]);
}
MEDFileFieldLoc::MEDFileFieldLoc(med_idt fid, int id)
MEDlocalizationRd(fid,locName,MED_FULL_INTERLACE,&_ref_coo[0],&_gs_coo[0],&_w[0]);
}
-MEDFileFieldLoc::MEDFileFieldLoc(const char *locName, INTERP_KERNEL::NormalizedCellType geoType,
+MEDFileFieldLoc::MEDFileFieldLoc(const std::string& locName, INTERP_KERNEL::NormalizedCellType geoType,
const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w):_name(locName),_geo_type(geoType),_ref_coo(refCoo),_gs_coo(gsCoo),
_w(w)
{
oss << "GaussPtsCoords="; std::copy(_gs_coo.begin(),_gs_coo.end(),std::ostream_iterator<double>(oss," ")); oss << std::endl;
}
-void MEDFileFieldLoc::setName(const char *name)
+void MEDFileFieldLoc::setName(const std::string& name)
{
_name=name;
}
return _profile;
}
-void MEDFileFieldPerMeshPerTypePerDisc::setProfile(const char *newPflName)
+void MEDFileFieldPerMeshPerTypePerDisc::setProfile(const std::string& newPflName)
{
_profile=newPflName;
}
return _localization;
}
-void MEDFileFieldPerMeshPerTypePerDisc::setLocalization(const char *newLocName)
+void MEDFileFieldPerMeshPerTypePerDisc::setLocalization(const std::string& newLocName)
{
_localization=newLocName;
}
return false;
}
-bool MEDFileFieldPerMesh::renumberEntitiesLyingOnMesh(const char *meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N,
+bool MEDFileFieldPerMesh::renumberEntitiesLyingOnMesh(const std::string& meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N,
MEDFileFieldGlobsReal& glob)
{
if(_mesh_name!=meshName)
copyTinyInfoFrom(mesh);
}
-void MEDFileFieldGlobs::loadProfileInFile(med_idt fid, int id, const char *pflName)
+void MEDFileFieldGlobs::loadProfileInFile(med_idt fid, int id, const std::string& pflName)
{
if(id>=(int)_pfls.size())
_pfls.resize(id+1);
_pfls[id]=DataArrayInt::New();
- int lgth=MEDprofileSizeByName(fid,pflName);
+ int lgth=MEDprofileSizeByName(fid,pflName.c_str());
_pfls[id]->setName(pflName);
_pfls[id]->alloc(lgth,1);
- MEDprofileRd(fid,pflName,_pfls[id]->getPointer());
+ MEDprofileRd(fid,pflName.c_str(),_pfls[id]->getPointer());
_pfls[id]->applyLin(1,-1,0);//Converting into C format
}
}
}
-MEDFileFieldGlobs *MEDFileFieldGlobs::New(const char *fname)
+MEDFileFieldGlobs *MEDFileFieldGlobs::New(const std::string& fname)
{
return new MEDFileFieldGlobs(fname);
}
return ret.retn();
}
-MEDFileFieldGlobs::MEDFileFieldGlobs(const char *fname):_file_name(fname)
+MEDFileFieldGlobs::MEDFileFieldGlobs(const std::string& fname):_file_name(fname)
{
}
}
}
-void MEDFileFieldGlobs::setFileName(const char *fileName)
+void MEDFileFieldGlobs::setFileName(const std::string& fileName)
{
_file_name=fileName;
}
return _locs[locId]->getNbOfGaussPtPerCell();
}
-const MEDFileFieldLoc& MEDFileFieldGlobs::getLocalization(const char *locName) const
+const MEDFileFieldLoc& MEDFileFieldGlobs::getLocalization(const std::string& locName) const
{
return getLocalizationFromId(getLocalizationId(locName));
}
class LocFinder
{
public:
- LocFinder(const char *loc):_loc(loc) { }
+ LocFinder(const std::string& loc):_loc(loc) { }
bool operator() (const MEDCouplingAutoRefCountObjectPtr<MEDFileFieldLoc>& loc) { return loc->isName(_loc); }
private:
- const char *_loc;
+ const std::string &_loc;
};
class PflFinder
};
}
-int MEDFileFieldGlobs::getLocalizationId(const char *loc) const
+int MEDFileFieldGlobs::getLocalizationId(const std::string& loc) const
{
std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldLoc> >::const_iterator it=std::find_if(_locs.begin(),_locs.end(),ParaMEDMEMImpl::LocFinder(loc));
if(it==_locs.end())
/*!
* The returned value is never null.
*/
-const DataArrayInt *MEDFileFieldGlobs::getProfile(const char *pflName) const
+const DataArrayInt *MEDFileFieldGlobs::getProfile(const std::string& pflName) const
{
std::string pflNameCpp(pflName);
std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >::const_iterator it=std::find_if(_pfls.begin(),_pfls.end(),ParaMEDMEMImpl::PflFinder(pflNameCpp));
return *_locs[locId];
}
-MEDFileFieldLoc& MEDFileFieldGlobs::getLocalization(const char *locName)
+MEDFileFieldLoc& MEDFileFieldGlobs::getLocalization(const std::string& locName)
{
return getLocalizationFromId(getLocalizationId(locName));
}
/*!
* The returned value is never null.
*/
-DataArrayInt *MEDFileFieldGlobs::getProfile(const char *pflName)
+DataArrayInt *MEDFileFieldGlobs::getProfile(const std::string& pflName)
{
std::string pflNameCpp(pflName);
std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >::iterator it=std::find_if(_pfls.begin(),_pfls.end(),ParaMEDMEMImpl::PflFinder(pflNameCpp));
return ret;
}
-bool MEDFileFieldGlobs::existsPfl(const char *pflName) const
+bool MEDFileFieldGlobs::existsPfl(const std::string& pflName) const
{
std::vector<std::string> v=getPfls();
std::string s(pflName);
return std::find(v.begin(),v.end(),s)!=v.end();
}
-bool MEDFileFieldGlobs::existsLoc(const char *locName) const
+bool MEDFileFieldGlobs::existsLoc(const std::string& locName) const
{
std::vector<std::string> v=getLocs();
std::string s(locName);
_pfls.push_back(pfl);
}
-void MEDFileFieldGlobs::appendLoc(const char *locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w)
+void MEDFileFieldGlobs::appendLoc(const std::string& locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w)
{
std::string name(locName);
if(name.empty())
return CreateNewNameNotIn("NewLoc_",names);
}
-std::string MEDFileFieldGlobs::CreateNewNameNotIn(const char *prefix, const std::vector<std::string>& namesToAvoid)
+std::string MEDFileFieldGlobs::CreateNewNameNotIn(const std::string& prefix, const std::vector<std::string>& namesToAvoid)
{
for(std::size_t sz=0;sz<100000;sz++)
{
* Creates a MEDFileFieldGlobsReal on a given file name. Nothing is read here.
* \param [in] fname - the file name.
*/
-MEDFileFieldGlobsReal::MEDFileFieldGlobsReal(const char *fname):_globals(MEDFileFieldGlobs::New(fname))
+MEDFileFieldGlobsReal::MEDFileFieldGlobsReal(const std::string& fname):_globals(MEDFileFieldGlobs::New(fname))
{
}
contentNotNull()->checkGlobsLocsPartCoherency(getLocsReallyUsed());
}
-void MEDFileFieldGlobsReal::loadProfileInFile(med_idt fid, int id, const char *pflName)
+void MEDFileFieldGlobsReal::loadProfileInFile(med_idt fid, int id, const std::string& pflName)
{
contentNotNull()->loadProfileInFile(fid,id,pflName);
}
* \param [in] pflName - the profile name of interest.
* \return bool - \c true if the profile named \a pflName exists.
*/
-bool MEDFileFieldGlobsReal::existsPfl(const char *pflName) const
+bool MEDFileFieldGlobsReal::existsPfl(const std::string& pflName) const
{
return contentNotNull()->existsPfl(pflName);
}
* \param [in] locName - the localization name of interest.
* \return bool - \c true if the localization named \a locName exists.
*/
-bool MEDFileFieldGlobsReal::existsLoc(const char *locName) const
+bool MEDFileFieldGlobsReal::existsLoc(const std::string& locName) const
{
return contentNotNull()->existsLoc(locName);
}
* Sets the name of a MED file.
* \param [inout] fileName - the file name.
*/
-void MEDFileFieldGlobsReal::setFileName(const char *fileName)
+void MEDFileFieldGlobsReal::setFileName(const std::string& fileName)
{
contentNotNull()->setFileName(fileName);
}
* \param [in] newName - a new name of the profile.
* \sa changePflsNames().
*/
-void MEDFileFieldGlobsReal::changePflName(const char *oldName, const char *newName)
+void MEDFileFieldGlobsReal::changePflName(const std::string& oldName, const std::string& newName)
{
std::vector< std::pair<std::vector<std::string>, std::string > > mapOfModif(1);
std::pair<std::vector<std::string>, std::string > p(std::vector<std::string>(1,std::string(oldName)),std::string(newName));
* \param [in] newName - a new name of the localization.
* \sa changeLocsNames().
*/
-void MEDFileFieldGlobsReal::changeLocName(const char *oldName, const char *newName)
+void MEDFileFieldGlobsReal::changeLocName(const std::string& oldName, const std::string& newName)
{
std::vector< std::pair<std::vector<std::string>, std::string > > mapOfModif(1);
std::pair<std::vector<std::string>, std::string > p(std::vector<std::string>(1,std::string(oldName)),std::string(newName));
* \return int - the id of the localization.
* \throw If there is no a localization named \a loc.
*/
-int MEDFileFieldGlobsReal::getLocalizationId(const char *loc) const
+int MEDFileFieldGlobsReal::getLocalizationId(const std::string& loc) const
{
return contentNotNull()->getLocalizationId(loc);
}
/*!
* Returns the name of the MED file.
- * \return const char * - the MED file name.
+ * \return const std::string& - the MED file name.
*/
-const char *MEDFileFieldGlobsReal::getFileName() const
+std::string MEDFileFieldGlobsReal::getFileName() const
{
return contentNotNull()->getFileName();
}
* \return const MEDFileFieldLoc& - the localization object having the name \a locName.
* \throw If there is no a localization named \a locName.
*/
-const MEDFileFieldLoc& MEDFileFieldGlobsReal::getLocalization(const char *locName) const
+const MEDFileFieldLoc& MEDFileFieldGlobsReal::getLocalization(const std::string& locName) const
{
return contentNotNull()->getLocalization(locName);
}
* \return const DataArrayInt * - the profile array having the name \a pflName.
* \throw If there is no a profile named \a pflName.
*/
-const DataArrayInt *MEDFileFieldGlobsReal::getProfile(const char *pflName) const
+const DataArrayInt *MEDFileFieldGlobsReal::getProfile(const std::string& pflName) const
{
return contentNotNull()->getProfile(pflName);
}
* having the name \a locName.
* \throw If there is no a localization named \a locName.
*/
-MEDFileFieldLoc& MEDFileFieldGlobsReal::getLocalization(const char *locName)
+MEDFileFieldLoc& MEDFileFieldGlobsReal::getLocalization(const std::string& locName)
{
return contentNotNull()->getLocalization(locName);
}
* \return DataArrayInt * - a non-const pointer to the profile array having the name \a pflName.
* \throw If there is no a profile named \a pflName.
*/
-DataArrayInt *MEDFileFieldGlobsReal::getProfile(const char *pflName)
+DataArrayInt *MEDFileFieldGlobsReal::getProfile(const std::string& pflName)
{
return contentNotNull()->getProfile(pflName);
}
* \throw If a localization with the name \a locName already exists but is
* different form the new one.
*/
-void MEDFileFieldGlobsReal::appendLoc(const char *locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w)
+void MEDFileFieldGlobsReal::appendLoc(const std::string& locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w)
{
contentNotNull()->appendLoc(locName,geoType,refCoo,gsCoo,w);
}
{
}
-MEDFileFieldNameScope::MEDFileFieldNameScope(const char *fieldName):_name(fieldName)
+MEDFileFieldNameScope::MEDFileFieldNameScope(const std::string& fieldName):_name(fieldName)
{
}
* Sets name of \a this field
* \param [in] name - the new field name.
*/
-void MEDFileFieldNameScope::setName(const char *fieldName)
+void MEDFileFieldNameScope::setName(const std::string& fieldName)
{
_name=fieldName;
}
return _dt_unit;
}
-void MEDFileFieldNameScope::setDtUnit(const char *dtUnit)
+void MEDFileFieldNameScope::setDtUnit(const std::string& dtUnit)
{
_dt_unit=dtUnit;
}
return ret;
}
-MEDFileAnyTypeField1TSWithoutSDA::MEDFileAnyTypeField1TSWithoutSDA(const char *fieldName, int csit, int iteration, int order):MEDFileFieldNameScope(fieldName),_iteration(iteration),_order(order),_csit(csit),_nb_of_tuples_to_be_allocated(-2)
+MEDFileAnyTypeField1TSWithoutSDA::MEDFileAnyTypeField1TSWithoutSDA(const std::string& fieldName, int csit, int iteration, int order):MEDFileFieldNameScope(fieldName),_iteration(iteration),_order(order),_csit(csit),_nb_of_tuples_to_be_allocated(-2)
{
}
return _field_per_mesh[0]->getMeshName();
}
-void MEDFileAnyTypeField1TSWithoutSDA::setMeshName(const char *newMeshName)
+void MEDFileAnyTypeField1TSWithoutSDA::setMeshName(const std::string& newMeshName)
{
std::string oldName(getMeshName());
std::vector< std::pair<std::string,std::string> > v(1);
* Length of this and of nested sequences is the same as that of \a typesF.
* \throw If no field is lying on \a mname.
*/
-std::vector< std::vector< std::pair<int,int> > > MEDFileAnyTypeField1TSWithoutSDA::getFieldSplitedByType(const char *mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const
+std::vector< std::vector< std::pair<int,int> > > MEDFileAnyTypeField1TSWithoutSDA::getFieldSplitedByType(const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const
{
int meshId=0;
- if(mname)
+ if(!mname.empty())
meshId=getMeshIdFromMeshName(mname);
else
if(_field_per_mesh.empty())
* \return int - the maximal absolute dimension of elements \a this fields lies on.
* \throw If no field is lying on \a mname.
*/
-int MEDFileAnyTypeField1TSWithoutSDA::getNonEmptyLevels(const char *mname, std::vector<int>& levs) const
+int MEDFileAnyTypeField1TSWithoutSDA::getNonEmptyLevels(const std::string& mname, std::vector<int>& levs) const
{
levs.clear();
int meshId=getMeshIdFromMeshName(mname);
* \param [in] locId is the localization id to find the right MEDFileFieldPerMeshPerTypePerDisc instance to set. It corresponds to the position of
* \c pfls[std::distance(types.begin(),std::find(types.begin(),typ)] vector in MEDFileField1TSWithoutSDA::getFieldSplitedByType. For non gausspoints field users, the value is 0.
*/
-MEDFileFieldPerMeshPerTypePerDisc *MEDFileAnyTypeField1TSWithoutSDA::getLeafGivenMeshAndTypeAndLocId(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId)
+MEDFileFieldPerMeshPerTypePerDisc *MEDFileAnyTypeField1TSWithoutSDA::getLeafGivenMeshAndTypeAndLocId(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId)
{
int mid=getMeshIdFromMeshName(mName);
return _field_per_mesh[mid]->getLeafGivenTypeAndLocId(typ,locId);
* \param [in] locId is the localization id to find the right MEDFileFieldPerMeshPerTypePerDisc instance to set. It corresponds to the position of
* \c pfls[std::distance(types.begin(),std::find(types.begin(),typ)] vector in MEDFileField1TSWithoutSDA::getFieldSplitedByType. For non gausspoints field users, the value is 0.
*/
-const MEDFileFieldPerMeshPerTypePerDisc *MEDFileAnyTypeField1TSWithoutSDA::getLeafGivenMeshAndTypeAndLocId(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId) const
+const MEDFileFieldPerMeshPerTypePerDisc *MEDFileAnyTypeField1TSWithoutSDA::getLeafGivenMeshAndTypeAndLocId(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId) const
{
int mid=getMeshIdFromMeshName(mName);
return _field_per_mesh[mid]->getLeafGivenTypeAndLocId(typ,locId);
/*!
* \param [in] mName specifies the underlying mesh name. This value can be pointer 0 for users that do not deal with fields on multi mesh.
*/
-int MEDFileAnyTypeField1TSWithoutSDA::getMeshIdFromMeshName(const char *mName) const
+int MEDFileAnyTypeField1TSWithoutSDA::getMeshIdFromMeshName(const std::string& mName) const
{
if(_field_per_mesh.empty())
throw INTERP_KERNEL::Exception("MEDFileField1TSWithoutSDA::getMeshIdFromMeshName : No field set !");
- if(mName==0)
+ if(mName.empty())
return 0;
std::string mName2(mName);
int ret=0;
return sz;
}
-bool MEDFileAnyTypeField1TSWithoutSDA::renumberEntitiesLyingOnMesh(const char *meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N,
+bool MEDFileAnyTypeField1TSWithoutSDA::renumberEntitiesLyingOnMesh(const std::string& meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N,
MEDFileFieldGlobsReal& glob)
{
bool ret=false;
* \throw If no field of \a this is lying on the mesh \a mName.
* \throw If no field values of the given \a type or given \a meshDimRelToMax are available.
*/
-MEDCouplingFieldDouble *MEDFileAnyTypeField1TSWithoutSDA::getFieldAtLevel(TypeOfField type, int meshDimRelToMax, const char *mName, int renumPol, const MEDFileFieldGlobsReal *glob, MEDCouplingAutoRefCountObjectPtr<DataArray>& arrOut, const MEDFileFieldNameScope& nasc) const
+MEDCouplingFieldDouble *MEDFileAnyTypeField1TSWithoutSDA::getFieldAtLevel(TypeOfField type, int meshDimRelToMax, const std::string& mName, int renumPol, const MEDFileFieldGlobsReal *glob, MEDCouplingAutoRefCountObjectPtr<DataArray>& arrOut, const MEDFileFieldNameScope& nasc) const
{
MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm;
- if(mName==0)
+ if(mName.empty())
mm=MEDFileMesh::New(glob->getFileName(),getMeshName().c_str(),getMeshIteration(),getMeshOrder());
else
mm=MEDFileMesh::New(glob->getFileName(),mName,getMeshIteration(),getMeshOrder());
* \throw If there are no mesh entities in the mesh.
* \throw If no field values of the given \a type are available.
*/
-MEDCouplingFieldDouble *MEDFileAnyTypeField1TSWithoutSDA::getFieldAtTopLevel(TypeOfField type, const char *mName, int renumPol, const MEDFileFieldGlobsReal *glob, MEDCouplingAutoRefCountObjectPtr<DataArray>& arrOut, const MEDFileFieldNameScope& nasc) const
+MEDCouplingFieldDouble *MEDFileAnyTypeField1TSWithoutSDA::getFieldAtTopLevel(TypeOfField type, const std::string& mName, int renumPol, const MEDFileFieldGlobsReal *glob, MEDCouplingAutoRefCountObjectPtr<DataArray>& arrOut, const MEDFileFieldNameScope& nasc) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm;
- if(mName==0)
+ MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm;
+ if(mName.empty())
mm=MEDFileMesh::New(glob->getFileName(),getMeshName().c_str(),getMeshIteration(),getMeshOrder());
else
mm=MEDFileMesh::New(glob->getFileName(),mName,getMeshIteration(),getMeshOrder());
MEDCouplingFieldDouble *MEDFileAnyTypeField1TSWithoutSDA::getFieldOnMeshAtLevel(TypeOfField type, int renumPol, const MEDFileFieldGlobsReal *glob, const MEDCouplingMesh *mesh, const DataArrayInt *cellRenum, const DataArrayInt *nodeRenum, MEDCouplingAutoRefCountObjectPtr<DataArray>& arrOut, const MEDFileFieldNameScope& nasc) const
{
static const char msg1[]="MEDFileField1TSWithoutSDA::getFieldOnMeshAtLevel : request for a renumbered field following mesh numbering whereas it is a profile field !";
- int meshId=getMeshIdFromMeshName(mesh->getName().c_str());
+ int meshId=getMeshIdFromMeshName(mesh->getName());
bool isPfl=false;
MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=_field_per_mesh[meshId]->getFieldOnMeshAtLevel(type,glob,mesh,isPfl,arrOut,nasc);
switch(renumPol)
return code;
}
-MEDFileField1TSWithoutSDA *MEDFileField1TSWithoutSDA::New(const char *fieldName, int csit, int iteration, int order, const std::vector<std::string>& infos)
+MEDFileField1TSWithoutSDA *MEDFileField1TSWithoutSDA::New(const std::string& fieldName, int csit, int iteration, int order, const std::vector<std::string>& infos)
{
return new MEDFileField1TSWithoutSDA(fieldName,csit,iteration,order,infos);
}
* Length of this and of nested sequences is the same as that of \a typesF.
* \throw If no field is lying on \a mname.
*/
-std::vector< std::vector<DataArrayDouble *> > MEDFileField1TSWithoutSDA::getFieldSplitedByType2(const char *mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const
+std::vector< std::vector<DataArrayDouble *> > MEDFileField1TSWithoutSDA::getFieldSplitedByType2(const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const
{
int meshId=0;
- if(mname)
+ if(!mname.empty())
meshId=getMeshIdFromMeshName(mname);
else
if(_field_per_mesh.empty())
return getUndergroundDataArrayDoubleExt(entries);
}
-MEDFileField1TSWithoutSDA::MEDFileField1TSWithoutSDA(const char *fieldName, int csit, int iteration, int order,
+MEDFileField1TSWithoutSDA::MEDFileField1TSWithoutSDA(const std::string& fieldName, int csit, int iteration, int order,
const std::vector<std::string>& infos):MEDFileAnyTypeField1TSWithoutSDA(fieldName,csit,iteration,order)
{
DataArrayDouble *arr=getOrCreateAndGetArrayDouble();
//= MEDFileIntField1TSWithoutSDA
-MEDFileIntField1TSWithoutSDA *MEDFileIntField1TSWithoutSDA::New(const char *fieldName, int csit, int iteration, int order,
+MEDFileIntField1TSWithoutSDA *MEDFileIntField1TSWithoutSDA::New(const std::string& fieldName, int csit, int iteration, int order,
const std::vector<std::string>& infos)
{
return new MEDFileIntField1TSWithoutSDA(fieldName,csit,iteration,order,infos);
{
}
-MEDFileIntField1TSWithoutSDA::MEDFileIntField1TSWithoutSDA(const char *fieldName, int csit, int iteration, int order,
+MEDFileIntField1TSWithoutSDA::MEDFileIntField1TSWithoutSDA(const std::string& fieldName, int csit, int iteration, int order,
const std::vector<std::string>& infos):MEDFileAnyTypeField1TSWithoutSDA(fieldName,csit,iteration,order)
{
DataArrayInt *arr=getOrCreateAndGetArrayInt();
//= MEDFileAnyTypeField1TS
-MEDFileAnyTypeField1TSWithoutSDA *MEDFileAnyTypeField1TS::BuildContentFrom(med_idt fid, const char *fileName, bool loadAll)
+MEDFileAnyTypeField1TSWithoutSDA *MEDFileAnyTypeField1TS::BuildContentFrom(med_idt fid, const std::string& fileName, bool loadAll)
{
med_field_type typcha;
//
return ret.retn();
}
-MEDFileAnyTypeField1TS::MEDFileAnyTypeField1TS(const char *fileName, bool loadAll)
+MEDFileAnyTypeField1TS::MEDFileAnyTypeField1TS(const std::string& fileName, bool loadAll)
try:MEDFileFieldGlobsReal(fileName)
{
MEDFileUtilities::CheckFileForRead(fileName);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
_content=BuildContentFrom(fid,fileName,loadAll);
loadGlobals(fid);
}
throw e;
}
-MEDFileAnyTypeField1TSWithoutSDA *MEDFileAnyTypeField1TS::BuildContentFrom(med_idt fid, const char *fileName, const char *fieldName, bool loadAll)
+MEDFileAnyTypeField1TSWithoutSDA *MEDFileAnyTypeField1TS::BuildContentFrom(med_idt fid, const std::string& fileName, const std::string& fieldName, bool loadAll)
{
med_field_type typcha;
std::vector<std::string> infos;
//
med_int numdt,numit;
med_float dt;
- MEDfieldComputingStepInfo(fid,fieldName,1,&numdt,&numit,&dt);
+ MEDfieldComputingStepInfo(fid,fieldName.c_str(),1,&numdt,&numit,&dt);
ret->setTime(numdt,numit,dt);
ret->_csit=1;
if(loadAll)
return ret.retn();
}
-MEDFileAnyTypeField1TS::MEDFileAnyTypeField1TS(const char *fileName, const char *fieldName, bool loadAll)
+MEDFileAnyTypeField1TS::MEDFileAnyTypeField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll)
try:MEDFileFieldGlobsReal(fileName)
{
MEDFileUtilities::CheckFileForRead(fileName);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
_content=BuildContentFrom(fid,fileName,fieldName,loadAll);
loadGlobals(fid);
}
throw e;
}
-MEDFileAnyTypeField1TS *MEDFileAnyTypeField1TS::BuildNewInstanceFromContent(MEDFileAnyTypeField1TSWithoutSDA *c, const char *fileName)
+MEDFileAnyTypeField1TS *MEDFileAnyTypeField1TS::BuildNewInstanceFromContent(MEDFileAnyTypeField1TSWithoutSDA *c, const std::string& fileName)
{
if(!c)
throw INTERP_KERNEL::Exception("MEDFileAnyTypeField1TS::BuildNewInstanceFromContent : empty content in input : unable to build a new instance !");
throw INTERP_KERNEL::Exception("MEDFileAnyTypeField1TS::BuildNewInstanceFromContent : internal error ! a content of type different from FLOAT64 and INT32 has been built but not intercepted !");
}
-MEDFileAnyTypeField1TS *MEDFileAnyTypeField1TS::New(const char *fileName, bool loadAll)
+MEDFileAnyTypeField1TS *MEDFileAnyTypeField1TS::New(const std::string& fileName, bool loadAll)
{
MEDFileUtilities::CheckFileForRead(fileName);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> c=BuildContentFrom(fid,fileName,loadAll);
MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TS> ret=BuildNewInstanceFromContent(c,fileName);
ret->loadGlobals(fid);
return ret.retn();
}
-MEDFileAnyTypeField1TS *MEDFileAnyTypeField1TS::New(const char *fileName, const char *fieldName, bool loadAll)
+MEDFileAnyTypeField1TS *MEDFileAnyTypeField1TS::New(const std::string& fileName, const std::string& fieldName, bool loadAll)
{
MEDFileUtilities::CheckFileForRead(fileName);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> c=BuildContentFrom(fid,fileName,fieldName,loadAll);
MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TS> ret=BuildNewInstanceFromContent(c,fileName);
ret->loadGlobals(fid);
return ret.retn();
}
-MEDFileAnyTypeField1TS *MEDFileAnyTypeField1TS::New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll)
+MEDFileAnyTypeField1TS *MEDFileAnyTypeField1TS::New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll)
{
MEDFileUtilities::CheckFileForRead(fileName);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> c=BuildContentFrom(fid,fileName,fieldName,iteration,order,loadAll);
MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TS> ret=BuildNewInstanceFromContent(c,fileName);
ret->loadGlobals(fid);
return ret.retn();
}
-MEDFileAnyTypeField1TSWithoutSDA *MEDFileAnyTypeField1TS::BuildContentFrom(med_idt fid, const char *fileName, const char *fieldName, int iteration, int order, bool loadAll)
+MEDFileAnyTypeField1TSWithoutSDA *MEDFileAnyTypeField1TS::BuildContentFrom(med_idt fid, const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll)
{
med_field_type typcha;
std::vector<std::string> infos;
{
med_int numdt,numit;
med_float dt;
- MEDfieldComputingStepInfo(fid,fieldName,i+1,&numdt,&numit,&dt);
+ MEDfieldComputingStepInfo(fid,fieldName.c_str(),i+1,&numdt,&numit,&dt);
if(numdt==iteration && numit==order)
{
found=true;
return ret.retn();
}
-MEDFileAnyTypeField1TS::MEDFileAnyTypeField1TS(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll)
+MEDFileAnyTypeField1TS::MEDFileAnyTypeField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll)
try:MEDFileFieldGlobsReal(fileName)
{
MEDFileUtilities::CheckFileForRead(fileName);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
- _content=BuildContentFrom(fid,fileName,fieldName,iteration,order,loadAll);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
+ _content=BuildContentFrom(fid,fileName.c_str(),fieldName.c_str(),iteration,order,loadAll);
loadGlobals(fid);
}
catch(INTERP_KERNEL::Exception& e)
}
}
-int MEDFileAnyTypeField1TS::LocateField2(med_idt fid, const char *fileName, int fieldIdCFormat, bool checkFieldId, std::string& fieldName, med_field_type& typcha, std::vector<std::string>& infos, std::string& dtunitOut)
+int MEDFileAnyTypeField1TS::LocateField2(med_idt fid, const std::string& fileName, int fieldIdCFormat, bool checkFieldId, std::string& fieldName, med_field_type& typcha, std::vector<std::string>& infos, std::string& dtunitOut)
{
if(checkFieldId)
{
* \param [out]
* \return in case of success the number of time steps available for the field with name \a fieldName.
*/
-int MEDFileAnyTypeField1TS::LocateField(med_idt fid, const char *fileName, const char *fieldName, int& posCFormat, med_field_type& typcha, std::vector<std::string>& infos, std::string& dtunitOut)
+int MEDFileAnyTypeField1TS::LocateField(med_idt fid, const std::string& fileName, const std::string& fieldName, int& posCFormat, med_field_type& typcha, std::vector<std::string>& infos, std::string& dtunitOut)
{
int nbFields=MEDnField(fid);
bool found=false;
* \param [in] forceRenameOnGlob specifies the behaviour in case of profile \b newPflName already exists. If true, the renaming is done without check. It can lead to major bug.
* If false, an exception will be thrown to force user to change previously the name of the profile with name \b newPflName
*/
-void MEDFileAnyTypeField1TS::setProfileNameOnLeaf(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newPflName, bool forceRenameOnGlob)
+void MEDFileAnyTypeField1TS::setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob)
{
MEDFileFieldPerMeshPerTypePerDisc *disc=getLeafGivenMeshAndTypeAndLocId(mName,typ,locId);
std::string oldPflName=disc->getProfile();
* \param [in] forceRenameOnGlob specifies the behaviour in case of profile \b newLocName already exists. If true, the renaming is done without check. It can lead to major bug.
* If false, an exception will be thrown to force user to change previously the name of the profile with name \b newLocName
*/
-void MEDFileAnyTypeField1TS::setLocNameOnLeaf(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newLocName, bool forceRenameOnGlob)
+void MEDFileAnyTypeField1TS::setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob)
{
MEDFileFieldPerMeshPerTypePerDisc *disc=getLeafGivenMeshAndTypeAndLocId(mName,typ,locId);
std::string oldLocName=disc->getLocalization();
* \throw If no field data is set.
* \throw If \a mode == 1 and the same data is present in an existing file.
*/
-void MEDFileAnyTypeField1TS::write(const char *fileName, int mode) const
+void MEDFileAnyTypeField1TS::write(const std::string& fileName, int mode) const
{
med_access_mode medmod=MEDFileUtilities::TraduceWriteMode(mode);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,medmod);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),medmod);
writeLL(fid);
}
*/
void MEDFileAnyTypeField1TS::loadArrays()
{
- MEDFileUtilities::AutoFid fid=MEDfileOpen(getFileName(),MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(getFileName().c_str(),MED_ACC_RDONLY);
contentNotNullBase()->loadBigArraysRecursively(fid,*contentNotNullBase());
}
*/
void MEDFileAnyTypeField1TS::loadArraysIfNecessary()
{
- MEDFileUtilities::AutoFid fid=MEDfileOpen(getFileName(),MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(getFileName().c_str(),MED_ACC_RDONLY);
contentNotNullBase()->loadBigArraysRecursivelyIfNecessary(fid,*contentNotNullBase());
}
return contentNotNullBase()->getName();
}
-void MEDFileAnyTypeField1TS::setName(const char *name)
+void MEDFileAnyTypeField1TS::setName(const std::string& name)
{
contentNotNullBase()->setName(name);
}
return contentNotNullBase()->getDtUnit();
}
-void MEDFileAnyTypeField1TS::setDtUnit(const char *dtUnit)
+void MEDFileAnyTypeField1TS::setDtUnit(const std::string& dtUnit)
{
contentNotNullBase()->setDtUnit(dtUnit);
}
return contentNotNullBase()->getMeshName();
}
-void MEDFileAnyTypeField1TS::setMeshName(const char *newMeshName)
+void MEDFileAnyTypeField1TS::setMeshName(const std::string& newMeshName)
{
contentNotNullBase()->setMeshName(newMeshName);
}
return contentNotNullBase()->getInfo();
}
-MEDFileFieldPerMeshPerTypePerDisc *MEDFileAnyTypeField1TS::getLeafGivenMeshAndTypeAndLocId(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId)
+MEDFileFieldPerMeshPerTypePerDisc *MEDFileAnyTypeField1TS::getLeafGivenMeshAndTypeAndLocId(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId)
{
return contentNotNullBase()->getLeafGivenMeshAndTypeAndLocId(mName,typ,locId);
}
-const MEDFileFieldPerMeshPerTypePerDisc *MEDFileAnyTypeField1TS::getLeafGivenMeshAndTypeAndLocId(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId) const
+const MEDFileFieldPerMeshPerTypePerDisc *MEDFileAnyTypeField1TS::getLeafGivenMeshAndTypeAndLocId(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId) const
{
return contentNotNullBase()->getLeafGivenMeshAndTypeAndLocId(mName,typ,locId);
}
-int MEDFileAnyTypeField1TS::getNonEmptyLevels(const char *mname, std::vector<int>& levs) const
+int MEDFileAnyTypeField1TS::getNonEmptyLevels(const std::string& mname, std::vector<int>& levs) const
{
return contentNotNullBase()->getNonEmptyLevels(mname,levs);
}
return contentNotNullBase()->getTypesOfFieldAvailable();
}
-std::vector< std::vector<std::pair<int,int> > > MEDFileAnyTypeField1TS::getFieldSplitedByType(const char *mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF,
+std::vector< std::vector<std::pair<int,int> > > MEDFileAnyTypeField1TS::getFieldSplitedByType(const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF,
std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const throw(INTERP_KERNEL::Exception)
{
return contentNotNullBase()->getFieldSplitedByType(mname,types,typesF,pfls,locs);
* is to delete this field using decrRef() as it is no more needed.
* \throw If reading the file fails.
*/
-MEDFileField1TS *MEDFileField1TS::New(const char *fileName, bool loadAll)
+MEDFileField1TS *MEDFileField1TS::New(const std::string& fileName, bool loadAll)
{
MEDCouplingAutoRefCountObjectPtr<MEDFileField1TS> ret=new MEDFileField1TS(fileName,loadAll);
ret->contentNotNull();
* \throw If reading the file fails.
* \throw If there is no field named \a fieldName in the file.
*/
-MEDFileField1TS *MEDFileField1TS::New(const char *fileName, const char *fieldName, bool loadAll)
+MEDFileField1TS *MEDFileField1TS::New(const std::string& fileName, const std::string& fieldName, bool loadAll)
{
MEDCouplingAutoRefCountObjectPtr<MEDFileField1TS> ret=new MEDFileField1TS(fileName,fieldName,loadAll);
ret->contentNotNull();
* \throw If there is no field named \a fieldName in the file.
* \throw If the required time step is missing from the file.
*/
-MEDFileField1TS *MEDFileField1TS::New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll)
+MEDFileField1TS *MEDFileField1TS::New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll)
{
MEDCouplingAutoRefCountObjectPtr<MEDFileField1TS> ret=new MEDFileField1TS(fileName,fieldName,iteration,order,loadAll);
ret->contentNotNull();
return arrOutC;
}
-MEDFileField1TS::MEDFileField1TS(const char *fileName, bool loadAll)
+MEDFileField1TS::MEDFileField1TS(const std::string& fileName, bool loadAll)
try:MEDFileAnyTypeField1TS(fileName,loadAll)
{
}
catch(INTERP_KERNEL::Exception& e)
{ throw e; }
-MEDFileField1TS::MEDFileField1TS(const char *fileName, const char *fieldName, bool loadAll)
+MEDFileField1TS::MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll)
try:MEDFileAnyTypeField1TS(fileName,fieldName,loadAll)
{
}
catch(INTERP_KERNEL::Exception& e)
{ throw e; }
-MEDFileField1TS::MEDFileField1TS(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll)
+MEDFileField1TS::MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll)
try:MEDFileAnyTypeField1TS(fileName,fieldName,iteration,order,loadAll)
{
}
if(getFileName2().empty())
throw INTERP_KERNEL::Exception("MEDFileField1TS::getFieldAtLevel : Request for a method that can be used for instances coming from file loading ! Use getFieldOnMeshAtLevel method instead !");
MEDCouplingAutoRefCountObjectPtr<DataArray> arrOut;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=contentNotNull()->getFieldAtLevel(type,meshDimRelToMax,0,renumPol,this,arrOut,*contentNotNull());
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=contentNotNull()->getFieldAtLevel(type,meshDimRelToMax,std::string(),renumPol,this,arrOut,*contentNotNull());
MEDFileField1TS::SetDataArrayDoubleInField(ret,arrOut);
return ret.retn();
}
if(getFileName2().empty())
throw INTERP_KERNEL::Exception("MEDFileField1TS::getFieldAtTopLevel : Request for a method that can be used for instances coming from file loading ! Use getFieldOnMeshAtTopLevel method instead !");
MEDCouplingAutoRefCountObjectPtr<DataArray> arrOut;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=contentNotNull()->getFieldAtTopLevel(type,0,renumPol,this,arrOut,*contentNotNull());
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=contentNotNull()->getFieldAtTopLevel(type,std::string(),renumPol,this,arrOut,*contentNotNull());
MEDFileField1TS::SetDataArrayDoubleInField(ret,arrOut);
return ret.retn();
}
* \throw If no field values of the given \a type or given \a meshDimRelToMax are available.
* \sa getFieldAtLevel()
*/
-MEDCouplingFieldDouble *MEDFileField1TS::getFieldAtLevelOld(TypeOfField type, const char *mname, int meshDimRelToMax, int renumPol) const
+MEDCouplingFieldDouble *MEDFileField1TS::getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol) const
{
if(getFileName2().empty())
throw INTERP_KERNEL::Exception("MEDFileField1TS::getFieldAtLevelOld : Request for a method that can be used for instances coming from file loading ! Use getFieldOnMeshAtLevel method instead !");
return contentNotNull()->getUndergroundDataArrayDoubleExt(entries);
}
-std::vector< std::vector<DataArrayDouble *> > MEDFileField1TS::getFieldSplitedByType2(const char *mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF,
+std::vector< std::vector<DataArrayDouble *> > MEDFileField1TS::getFieldSplitedByType2(const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF,
std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const throw(INTERP_KERNEL::Exception)
{
return contentNotNull()->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
return ret.retn();
}
-MEDFileIntField1TS *MEDFileIntField1TS::New(const char *fileName, bool loadAll)
+MEDFileIntField1TS *MEDFileIntField1TS::New(const std::string& fileName, bool loadAll)
{
MEDCouplingAutoRefCountObjectPtr<MEDFileIntField1TS> ret=new MEDFileIntField1TS(fileName,loadAll);
ret->contentNotNull();
return ret.retn();
}
-MEDFileIntField1TS *MEDFileIntField1TS::New(const char *fileName, const char *fieldName, bool loadAll)
+MEDFileIntField1TS *MEDFileIntField1TS::New(const std::string& fileName, const std::string& fieldName, bool loadAll)
{
MEDCouplingAutoRefCountObjectPtr<MEDFileIntField1TS> ret=new MEDFileIntField1TS(fileName,fieldName,loadAll);
ret->contentNotNull();
return ret.retn();
}
-MEDFileIntField1TS *MEDFileIntField1TS::New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll)
+MEDFileIntField1TS *MEDFileIntField1TS::New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll)
{
MEDCouplingAutoRefCountObjectPtr<MEDFileIntField1TS> ret=new MEDFileIntField1TS(fileName,fieldName,iteration,order,loadAll);
ret->contentNotNull();
_content=new MEDFileIntField1TSWithoutSDA;
}
-MEDFileIntField1TS::MEDFileIntField1TS(const char *fileName, bool loadAll)
+MEDFileIntField1TS::MEDFileIntField1TS(const std::string& fileName, bool loadAll)
try:MEDFileAnyTypeField1TS(fileName,loadAll)
{
}
catch(INTERP_KERNEL::Exception& e)
{ throw e; }
-MEDFileIntField1TS::MEDFileIntField1TS(const char *fileName, const char *fieldName, bool loadAll)
+MEDFileIntField1TS::MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll)
try:MEDFileAnyTypeField1TS(fileName,fieldName,loadAll)
{
}
catch(INTERP_KERNEL::Exception& e)
{ throw e; }
-MEDFileIntField1TS::MEDFileIntField1TS(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll)
+MEDFileIntField1TS::MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll)
try:MEDFileAnyTypeField1TS(fileName,fieldName,iteration,order,loadAll)
{
}
if(getFileName2().empty())
throw INTERP_KERNEL::Exception("MEDFileIntField1TS::getFieldAtLevel : Request for a method that can be used for instances coming from file loading ! Use getFieldOnMeshAtLevel method instead !");
MEDCouplingAutoRefCountObjectPtr<DataArray> arrOut2;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=contentNotNull()->getFieldAtLevel(type,meshDimRelToMax,0,renumPol,this,arrOut2,*contentNotNull());
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=contentNotNull()->getFieldAtLevel(type,meshDimRelToMax,std::string(),renumPol,this,arrOut2,*contentNotNull());
DataArrayInt *arrOutC=dynamic_cast<DataArrayInt *>((DataArray *)arrOut2);
if(!arrOutC)
throw INTERP_KERNEL::Exception("MEDFileIntField1TS::getFieldAtLevelOld : mismatch between dataArrays type and MEDFileIntField1TS ! Expected int32 !");
if(getFileName2().empty())
throw INTERP_KERNEL::Exception("MEDFileField1TS::getFieldAtTopLevel : Request for a method that can be used for instances coming from file loading ! Use getFieldOnMeshAtTopLevel method instead !");
MEDCouplingAutoRefCountObjectPtr<DataArray> arr;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=contentNotNull()->getFieldAtTopLevel(type,0,renumPol,this,arr,*contentNotNull());
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=contentNotNull()->getFieldAtTopLevel(type,std::string(),renumPol,this,arr,*contentNotNull());
arrOut=MEDFileIntField1TS::ReturnSafelyDataArrayInt(arr);
return ret.retn();
}
* \throw If no field values of the given \a type or given \a meshDimRelToMax are available.
* \sa getFieldAtLevel()
*/
-MEDCouplingFieldDouble *MEDFileIntField1TS::getFieldAtLevelOld(TypeOfField type, const char *mname, int meshDimRelToMax, DataArrayInt* &arrOut, int renumPol) const
+MEDCouplingFieldDouble *MEDFileIntField1TS::getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, DataArrayInt* &arrOut, int renumPol) const
{
if(getFileName2().empty())
throw INTERP_KERNEL::Exception("MEDFileField1TS::getFieldAtLevelOld : Request for a method that can be used for instances coming from file loading ! Use getFieldOnMeshAtLevel method instead !");
{
}
-MEDFileAnyTypeFieldMultiTSWithoutSDA::MEDFileAnyTypeFieldMultiTSWithoutSDA(const char *fieldName):MEDFileFieldNameScope(fieldName)
+MEDFileAnyTypeFieldMultiTSWithoutSDA::MEDFileAnyTypeFieldMultiTSWithoutSDA(const std::string& fieldName):MEDFileFieldNameScope(fieldName)
{
}
loadStructureOrStructureAndBigArraysRecursively(fid,nbOfStep,typcha,loadAll);
}
-MEDFileAnyTypeFieldMultiTSWithoutSDA::MEDFileAnyTypeFieldMultiTSWithoutSDA(med_idt fid, const char *fieldName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll)
+MEDFileAnyTypeFieldMultiTSWithoutSDA::MEDFileAnyTypeFieldMultiTSWithoutSDA(med_idt fid, const std::string& fieldName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll)
try:MEDFileFieldNameScope(fieldName),_infos(infos)
{
setDtUnit(dtunit.c_str());
return _time_steps[0]->getMeshName();
}
-void MEDFileAnyTypeFieldMultiTSWithoutSDA::setMeshName(const char *newMeshName)
+void MEDFileAnyTypeFieldMultiTSWithoutSDA::setMeshName(const std::string& newMeshName)
{
std::string oldName(getMeshName());
std::vector< std::pair<std::string,std::string> > v(1);
return getTimeStepEntry(iteration,order).getUndergroundDataArrayExt(entries);
}
-bool MEDFileAnyTypeFieldMultiTSWithoutSDA::renumberEntitiesLyingOnMesh(const char *meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N,
+bool MEDFileAnyTypeFieldMultiTSWithoutSDA::renumberEntitiesLyingOnMesh(const std::string& meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N,
MEDFileFieldGlobsReal& glob)
{
bool ret=false;
* To retrieve the highest level of f2 it should be done, f1->getFieldAtLevel(ON_CELLS,2-3+0);//absDim-meshDim+relativeLev
* To retrieve the lowest level of f2 it should be done, f1->getFieldAtLevel(ON_CELLS,2-3+(-1));//absDim-meshDim+relativeLev
*/
-int MEDFileAnyTypeFieldMultiTSWithoutSDA::getNonEmptyLevels(int iteration, int order, const char *mname, std::vector<int>& levs) const
+int MEDFileAnyTypeFieldMultiTSWithoutSDA::getNonEmptyLevels(int iteration, int order, const std::string& mname, std::vector<int>& levs) const
{
return getTimeStepEntry(iteration,order).getNonEmptyLevels(mname,levs);
}
/*!
* entry point for users that want to iterate into MEDFile DataStructure without any overhead.
*/
-std::vector< std::vector< std::pair<int,int> > > MEDFileAnyTypeFieldMultiTSWithoutSDA::getFieldSplitedByType(int iteration, int order, const char *mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const
+std::vector< std::vector< std::pair<int,int> > > MEDFileAnyTypeFieldMultiTSWithoutSDA::getFieldSplitedByType(int iteration, int order, const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const
{
return getTimeStepEntry(iteration,order).getFieldSplitedByType(mname,types,typesF,pfls,locs);
}
//= MEDFileFieldMultiTSWithoutSDA
-MEDFileFieldMultiTSWithoutSDA *MEDFileFieldMultiTSWithoutSDA::New(med_idt fid, const char *fieldName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll)
+MEDFileFieldMultiTSWithoutSDA *MEDFileFieldMultiTSWithoutSDA::New(med_idt fid, const std::string& fieldName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll)
{
return new MEDFileFieldMultiTSWithoutSDA(fid,fieldName,fieldTyp,infos,nbOfStep,dtunit,loadAll);
}
{
}
-MEDFileFieldMultiTSWithoutSDA::MEDFileFieldMultiTSWithoutSDA(const char *fieldName):MEDFileAnyTypeFieldMultiTSWithoutSDA(fieldName)
+MEDFileFieldMultiTSWithoutSDA::MEDFileFieldMultiTSWithoutSDA(const std::string& fieldName):MEDFileAnyTypeFieldMultiTSWithoutSDA(fieldName)
{
}
catch(INTERP_KERNEL::Exception& e)
{ throw e; }
-MEDFileFieldMultiTSWithoutSDA::MEDFileFieldMultiTSWithoutSDA(med_idt fid, const char *fieldName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll)
+MEDFileFieldMultiTSWithoutSDA::MEDFileFieldMultiTSWithoutSDA(med_idt fid, const std::string& fieldName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll)
try:MEDFileAnyTypeFieldMultiTSWithoutSDA(fid,fieldName,fieldTyp,infos,nbOfStep,dtunit,loadAll)
{
}
* entry point for users that want to iterate into MEDFile DataStructure with a reduced overhead because output arrays are extracted (created) specially
* for the call of this method. That's why the DataArrayDouble instance in returned vector of vector should be dealed by the caller.
*/
-std::vector< std::vector<DataArrayDouble *> > MEDFileFieldMultiTSWithoutSDA::getFieldSplitedByType2(int iteration, int order, const char *mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const
+std::vector< std::vector<DataArrayDouble *> > MEDFileFieldMultiTSWithoutSDA::getFieldSplitedByType2(int iteration, int order, const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const
{
const MEDFileAnyTypeField1TSWithoutSDA& myF1TS=getTimeStepEntry(iteration,order);
const MEDFileField1TSWithoutSDA *myF1TSC=dynamic_cast<const MEDFileField1TSWithoutSDA *>(&myF1TS);
{
}
-MEDFileAnyTypeFieldMultiTS::MEDFileAnyTypeFieldMultiTS(const char *fileName, bool loadAll)
+MEDFileAnyTypeFieldMultiTS::MEDFileAnyTypeFieldMultiTS(const std::string& fileName, bool loadAll)
try:MEDFileFieldGlobsReal(fileName)
{
MEDFileUtilities::CheckFileForRead(fileName);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
_content=BuildContentFrom(fid,fileName,loadAll);
loadGlobals(fid);
}
throw e;
}
-MEDFileAnyTypeFieldMultiTSWithoutSDA *MEDFileAnyTypeFieldMultiTS::BuildContentFrom(med_idt fid, const char *fileName, const char *fieldName, bool loadAll)
+MEDFileAnyTypeFieldMultiTSWithoutSDA *MEDFileAnyTypeFieldMultiTS::BuildContentFrom(med_idt fid, const std::string& fileName, const std::string& fieldName, bool loadAll)
{
med_field_type typcha;
std::vector<std::string> infos;
return ret.retn();
}
-MEDFileAnyTypeFieldMultiTSWithoutSDA *MEDFileAnyTypeFieldMultiTS::BuildContentFrom(med_idt fid, const char *fileName, bool loadAll)
+MEDFileAnyTypeFieldMultiTSWithoutSDA *MEDFileAnyTypeFieldMultiTS::BuildContentFrom(med_idt fid, const std::string& fileName, bool loadAll)
{
med_field_type typcha;
//
return ret.retn();
}
-MEDFileAnyTypeFieldMultiTS *MEDFileAnyTypeFieldMultiTS::BuildNewInstanceFromContent(MEDFileAnyTypeFieldMultiTSWithoutSDA *c, const char *fileName)
+MEDFileAnyTypeFieldMultiTS *MEDFileAnyTypeFieldMultiTS::BuildNewInstanceFromContent(MEDFileAnyTypeFieldMultiTSWithoutSDA *c, const std::string& fileName)
{
if(!c)
throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::BuildNewInstanceFromContent : empty content in input : unable to build a new instance !");
throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::BuildNewInstanceFromContent : internal error ! a content of type different from FLOAT64 and INT32 has been built but not intercepted !");
}
-MEDFileAnyTypeFieldMultiTS::MEDFileAnyTypeFieldMultiTS(const char *fileName, const char *fieldName, bool loadAll)
+MEDFileAnyTypeFieldMultiTS::MEDFileAnyTypeFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll)
try:MEDFileFieldGlobsReal(fileName)
{
MEDFileUtilities::CheckFileForRead(fileName);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
_content=BuildContentFrom(fid,fileName,fieldName,loadAll);
loadGlobals(fid);
}
//= MEDFileIntFieldMultiTSWithoutSDA
-MEDFileIntFieldMultiTSWithoutSDA *MEDFileIntFieldMultiTSWithoutSDA::New(med_idt fid, const char *fieldName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll)
+MEDFileIntFieldMultiTSWithoutSDA *MEDFileIntFieldMultiTSWithoutSDA::New(med_idt fid, const std::string& fieldName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll)
{
return new MEDFileIntFieldMultiTSWithoutSDA(fid,fieldName,fieldTyp,infos,nbOfStep,dtunit,loadAll);
}
{
}
-MEDFileIntFieldMultiTSWithoutSDA::MEDFileIntFieldMultiTSWithoutSDA(const char *fieldName):MEDFileAnyTypeFieldMultiTSWithoutSDA(fieldName)
+MEDFileIntFieldMultiTSWithoutSDA::MEDFileIntFieldMultiTSWithoutSDA(const std::string& fieldName):MEDFileAnyTypeFieldMultiTSWithoutSDA(fieldName)
{
}
-MEDFileIntFieldMultiTSWithoutSDA::MEDFileIntFieldMultiTSWithoutSDA(med_idt fid, const char *fieldName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll)
+MEDFileIntFieldMultiTSWithoutSDA::MEDFileIntFieldMultiTSWithoutSDA(med_idt fid, const std::string& fieldName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll)
try:MEDFileAnyTypeFieldMultiTSWithoutSDA(fid,fieldName,fieldTyp,infos,nbOfStep,dtunit,loadAll)
{
}
* is to delete this field using decrRef() as it is no more needed.
* \throw If reading the file fails.
*/
-MEDFileAnyTypeFieldMultiTS *MEDFileAnyTypeFieldMultiTS::New(const char *fileName, bool loadAll)
+MEDFileAnyTypeFieldMultiTS *MEDFileAnyTypeFieldMultiTS::New(const std::string& fileName, bool loadAll)
{
MEDFileUtilities::CheckFileForRead(fileName);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> c=BuildContentFrom(fid,fileName,loadAll);
MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTS> ret=BuildNewInstanceFromContent(c,fileName);
ret->loadGlobals(fid);
* \throw If reading the file fails.
* \throw If there is no field named \a fieldName in the file.
*/
-MEDFileAnyTypeFieldMultiTS *MEDFileAnyTypeFieldMultiTS::New(const char *fileName, const char *fieldName, bool loadAll)
+MEDFileAnyTypeFieldMultiTS *MEDFileAnyTypeFieldMultiTS::New(const std::string& fileName, const std::string& fieldName, bool loadAll)
{
MEDFileUtilities::CheckFileForRead(fileName);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> c=BuildContentFrom(fid,fileName,fieldName,loadAll);
MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTS> ret=BuildNewInstanceFromContent(c,fileName);
ret->loadGlobals(fid);
return contentNotNullBase()->getPosGivenTime(time,eps);
}
-int MEDFileAnyTypeFieldMultiTS::getNonEmptyLevels(int iteration, int order, const char *mname, std::vector<int>& levs) const
+int MEDFileAnyTypeFieldMultiTS::getNonEmptyLevels(int iteration, int order, const std::string& mname, std::vector<int>& levs) const
{
return contentNotNullBase()->getNonEmptyLevels(iteration,order,mname,levs);
}
return contentNotNullBase()->getTypesOfFieldAvailable();
}
-std::vector< std::vector< std::pair<int,int> > > MEDFileAnyTypeFieldMultiTS::getFieldSplitedByType(int iteration, int order, const char *mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const
+std::vector< std::vector< std::pair<int,int> > > MEDFileAnyTypeFieldMultiTS::getFieldSplitedByType(int iteration, int order, const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const
{
return contentNotNullBase()->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
}
return contentNotNullBase()->getName();
}
-void MEDFileAnyTypeFieldMultiTS::setName(const char *name)
+void MEDFileAnyTypeFieldMultiTS::setName(const std::string& name)
{
contentNotNullBase()->setName(name);
}
return contentNotNullBase()->getDtUnit();
}
-void MEDFileAnyTypeFieldMultiTS::setDtUnit(const char *dtUnit)
+void MEDFileAnyTypeFieldMultiTS::setDtUnit(const std::string& dtUnit)
{
contentNotNullBase()->setDtUnit(dtUnit);
}
return contentNotNullBase()->getMeshName();
}
-void MEDFileAnyTypeFieldMultiTS::setMeshName(const char *newMeshName)
+void MEDFileAnyTypeFieldMultiTS::setMeshName(const std::string& newMeshName)
{
contentNotNullBase()->setMeshName(newMeshName);
}
* \throw If no field data is set.
* \throw If \a mode == 1 and the same data is present in an existing file.
*/
-void MEDFileAnyTypeFieldMultiTS::write(const char *fileName, int mode) const
+void MEDFileAnyTypeFieldMultiTS::write(const std::string& fileName, int mode) const
{
med_access_mode medmod=MEDFileUtilities::TraduceWriteMode(mode);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,medmod);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),medmod);
writeLL(fid);
}
*/
void MEDFileAnyTypeFieldMultiTS::loadArrays()
{
- MEDFileUtilities::AutoFid fid=MEDfileOpen(getFileName(),MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(getFileName().c_str(),MED_ACC_RDONLY);
contentNotNullBase()->loadBigArraysRecursively(fid,*contentNotNullBase());
}
*/
void MEDFileAnyTypeFieldMultiTS::loadArraysIfNecessary()
{
- MEDFileUtilities::AutoFid fid=MEDfileOpen(getFileName(),MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(getFileName().c_str(),MED_ACC_RDONLY);
contentNotNullBase()->loadBigArraysRecursivelyIfNecessary(fid,*contentNotNullBase());
}
* is to delete this field using decrRef() as it is no more needed.
* \throw If reading the file fails.
*/
-MEDFileFieldMultiTS *MEDFileFieldMultiTS::New(const char *fileName, bool loadAll)
+MEDFileFieldMultiTS *MEDFileFieldMultiTS::New(const std::string& fileName, bool loadAll)
{
MEDCouplingAutoRefCountObjectPtr<MEDFileFieldMultiTS> ret=new MEDFileFieldMultiTS(fileName,loadAll);
ret->contentNotNull();//to check that content type matches with \a this type.
* \throw If reading the file fails.
* \throw If there is no field named \a fieldName in the file.
*/
-MEDFileFieldMultiTS *MEDFileFieldMultiTS::New(const char *fileName, const char *fieldName, bool loadAll)
+MEDFileFieldMultiTS *MEDFileFieldMultiTS::New(const std::string& fileName, const std::string& fieldName, bool loadAll)
{
MEDCouplingAutoRefCountObjectPtr<MEDFileFieldMultiTS> ret=new MEDFileFieldMultiTS(fileName,fieldName,loadAll);
ret->contentNotNull();//to check that content type matches with \a this type.
if(!myF1TSC)
throw INTERP_KERNEL::Exception("MEDFileFieldMultiTS::getFieldAtLevel : mismatch of type of field expecting FLOAT64 !");
MEDCouplingAutoRefCountObjectPtr<DataArray> arrOut;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=myF1TSC->getFieldAtLevel(type,meshDimRelToMax,0,renumPol,this,arrOut,*contentNotNullBase());
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=myF1TSC->getFieldAtLevel(type,meshDimRelToMax,std::string(),renumPol,this,arrOut,*contentNotNullBase());
MEDFileField1TS::SetDataArrayDoubleInField(ret,arrOut);
return ret.retn();
}
if(!myF1TSC)
throw INTERP_KERNEL::Exception("MEDFileFieldMultiTS::getFieldAtTopLevel : mismatch of type of field !");
MEDCouplingAutoRefCountObjectPtr<DataArray> arrOut;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=myF1TSC->getFieldAtTopLevel(type,0,renumPol,this,arrOut,*contentNotNullBase());
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=myF1TSC->getFieldAtTopLevel(type,std::string(),renumPol,this,arrOut,*contentNotNullBase());
MEDFileField1TS::SetDataArrayDoubleInField(ret,arrOut);
return ret.retn();
}
* This method is called 'old' because the user should give the mesh name he wants to use for it's field.
* This method is useful for MED2 file format when field on different mesh was autorized.
*/
-MEDCouplingFieldDouble *MEDFileFieldMultiTS::getFieldAtLevelOld(TypeOfField type, const char *mname, int iteration, int order, int meshDimRelToMax, int renumPol) const
+MEDCouplingFieldDouble *MEDFileFieldMultiTS::getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol) const
{
const MEDFileAnyTypeField1TSWithoutSDA& myF1TS=contentNotNullBase()->getTimeStepEntry(iteration,order);
const MEDFileField1TSWithoutSDA *myF1TSC=dynamic_cast<const MEDFileField1TSWithoutSDA *>(&myF1TS);
_content=new MEDFileFieldMultiTSWithoutSDA;
}
-MEDFileFieldMultiTS::MEDFileFieldMultiTS(const char *fileName, bool loadAll)
+MEDFileFieldMultiTS::MEDFileFieldMultiTS(const std::string& fileName, bool loadAll)
try:MEDFileAnyTypeFieldMultiTS(fileName,loadAll)
{
}
catch(INTERP_KERNEL::Exception& e)
{ throw e; }
-MEDFileFieldMultiTS::MEDFileFieldMultiTS(const char *fileName, const char *fieldName, bool loadAll)
+MEDFileFieldMultiTS::MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll)
try:MEDFileAnyTypeFieldMultiTS(fileName,fieldName,loadAll)
{
}
{
}
-std::vector< std::vector<DataArrayDouble *> > MEDFileFieldMultiTS::getFieldSplitedByType2(int iteration, int order, const char *mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const
+std::vector< std::vector<DataArrayDouble *> > MEDFileFieldMultiTS::getFieldSplitedByType2(int iteration, int order, const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const
{
return contentNotNull()->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
}
* is to delete this field using decrRef() as it is no more needed.
* \throw If reading the file fails.
*/
-MEDFileIntFieldMultiTS *MEDFileIntFieldMultiTS::New(const char *fileName, bool loadAll)
+MEDFileIntFieldMultiTS *MEDFileIntFieldMultiTS::New(const std::string& fileName, bool loadAll)
{
MEDCouplingAutoRefCountObjectPtr<MEDFileIntFieldMultiTS> ret=new MEDFileIntFieldMultiTS(fileName,loadAll);
ret->contentNotNull();//to check that content type matches with \a this type.
* \throw If reading the file fails.
* \throw If there is no field named \a fieldName in the file.
*/
-MEDFileIntFieldMultiTS *MEDFileIntFieldMultiTS::New(const char *fileName, const char *fieldName, bool loadAll)
+MEDFileIntFieldMultiTS *MEDFileIntFieldMultiTS::New(const std::string& fileName, const std::string& fieldName, bool loadAll)
{
MEDCouplingAutoRefCountObjectPtr<MEDFileIntFieldMultiTS> ret=new MEDFileIntFieldMultiTS(fileName,fieldName,loadAll);
ret->contentNotNull();//to check that content type matches with \a this type.
if(!myF1TSC)
throw INTERP_KERNEL::Exception("MEDFileIntFieldMultiTS::getFieldAtLevel : mismatch of type of field expecting INT32 !");
MEDCouplingAutoRefCountObjectPtr<DataArray> arr;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=myF1TSC->getFieldAtLevel(type,meshDimRelToMax,0,renumPol,this,arr,*contentNotNullBase());
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=myF1TSC->getFieldAtLevel(type,meshDimRelToMax,std::string(),renumPol,this,arr,*contentNotNullBase());
arrOut=MEDFileIntField1TS::ReturnSafelyDataArrayInt(arr);
return ret.retn();
}
if(!myF1TSC)
throw INTERP_KERNEL::Exception("MEDFileIntFieldMultiTS::getFieldAtTopLevel : mismatch of type of field ! INT32 expected !");
MEDCouplingAutoRefCountObjectPtr<DataArray> arr;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=myF1TSC->getFieldAtTopLevel(type,0,renumPol,this,arr,*contentNotNullBase());
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=myF1TSC->getFieldAtTopLevel(type,std::string(),renumPol,this,arr,*contentNotNullBase());
arrOut=MEDFileIntField1TS::ReturnSafelyDataArrayInt(arr);
return ret.retn();
}
* This method is called 'old' because the user should give the mesh name he wants to use for it's field.
* This method is useful for MED2 file format when field on different mesh was autorized.
*/
-MEDCouplingFieldDouble *MEDFileIntFieldMultiTS::getFieldAtLevelOld(TypeOfField type, int iteration, int order, const char *mname, int meshDimRelToMax, DataArrayInt* &arrOut, int renumPol) const
+MEDCouplingFieldDouble *MEDFileIntFieldMultiTS::getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, DataArrayInt* &arrOut, int renumPol) const
{
const MEDFileAnyTypeField1TSWithoutSDA& myF1TS=contentNotNullBase()->getTimeStepEntry(iteration,order);
const MEDFileIntField1TSWithoutSDA *myF1TSC=dynamic_cast<const MEDFileIntField1TSWithoutSDA *>(&myF1TS);
{
}
-MEDFileIntFieldMultiTS::MEDFileIntFieldMultiTS(const char *fileName, bool loadAll)
+MEDFileIntFieldMultiTS::MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll)
try:MEDFileAnyTypeFieldMultiTS(fileName,loadAll)
{
}
catch(INTERP_KERNEL::Exception& e)
{ throw e; }
-MEDFileIntFieldMultiTS::MEDFileIntFieldMultiTS(const char *fileName, const char *fieldName, bool loadAll)
+MEDFileIntFieldMultiTS::MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll)
try:MEDFileAnyTypeFieldMultiTS(fileName,fieldName,loadAll)
{
}
return new MEDFileFields;
}
-MEDFileFields *MEDFileFields::New(const char *fileName, bool loadAll)
+MEDFileFields *MEDFileFields::New(const std::string& fileName, bool loadAll)
{
return new MEDFileFields(fileName,loadAll);
}
{
}
-MEDFileFields::MEDFileFields(const char *fileName, bool loadAll)
+MEDFileFields::MEDFileFields(const std::string& fileName, bool loadAll)
try:MEDFileFieldGlobsReal(fileName)
{
MEDFileUtilities::CheckFileForRead(fileName);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
int nbFields=MEDnField(fid);
_fields.resize(nbFields);
med_field_type typcha;
}
}
-void MEDFileFields::write(const char *fileName, int mode) const
+void MEDFileFields::write(const std::string& fileName, int mode) const
{
med_access_mode medmod=MEDFileUtilities::TraduceWriteMode(mode);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,medmod);
+ MEDFileUtilities::AutoFid fid(MEDfileOpen(fileName.c_str(),medmod));
writeLL(fid);
}
*/
void MEDFileFields::loadArrays()
{
- MEDFileUtilities::AutoFid fid=MEDfileOpen(getFileName(),MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(getFileName().c_str(),MED_ACC_RDONLY);
for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::iterator it=_fields.begin();it!=_fields.end();it++)
{
MEDFileAnyTypeFieldMultiTSWithoutSDA *elt(*it);
*/
void MEDFileFields::loadArraysIfNecessary()
{
- MEDFileUtilities::AutoFid fid=MEDfileOpen(getFileName(),MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(getFileName().c_str(),MED_ACC_RDONLY);
for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::iterator it=_fields.begin();it!=_fields.end();it++)
{
MEDFileAnyTypeFieldMultiTSWithoutSDA *elt(*it);
*/
void MEDFileFields::unloadArrays()
{
- MEDFileUtilities::AutoFid fid=MEDfileOpen(getFileName(),MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(getFileName().c_str(),MED_ACC_RDONLY);
for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::iterator it=_fields.begin();it!=_fields.end();it++)
{
MEDFileAnyTypeFieldMultiTSWithoutSDA *elt(*it);
* \return If true a renumbering has been performed. The structure in \a this has been modified. If false, nothing has been done: it is typically the case if \a meshName is not refered by any
* field in \a this.
*/
-bool MEDFileFields::renumberEntitiesLyingOnMesh(const char *meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N)
+bool MEDFileFields::renumberEntitiesLyingOnMesh(const std::string& meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N)
{
bool ret=false;
for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::iterator it=_fields.begin();it!=_fields.end();it++)
return ret.retn();
}
-MEDFileAnyTypeFieldMultiTS *MEDFileFields::getFieldWithName(const char *fieldName) const
+MEDFileAnyTypeFieldMultiTS *MEDFileFields::getFieldWithName(const std::string& fieldName) const
{
return getFieldAtPos(getPosFromFieldName(fieldName));
}
* \param [in] meshName - the name of the mesh on w
* \return a new object that the caller should deal with.
*/
-MEDFileFields *MEDFileFields::partOfThisLyingOnSpecifiedMeshName(const char *meshName) const
+MEDFileFields *MEDFileFields::partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const
{
MEDCouplingAutoRefCountObjectPtr<MEDFileFields> ret=MEDFileFields::New();
for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::const_iterator it=_fields.begin();it!=_fields.end();it++)
return new MEDFileFieldsIterator(this);
}
-int MEDFileFields::getPosFromFieldName(const char *fieldName) const
+int MEDFileFields::getPosFromFieldName(const std::string& fieldName) const
{
std::string tmp(fieldName);
std::vector<std::string> poss;
public:
MEDLOADER_EXPORT void simpleRepr(std::ostream& oss) const;
MEDLOADER_EXPORT std::string getName() const { return _name; }
- MEDLOADER_EXPORT void setName(const char *name);
- static MEDFileFieldLoc *New(med_idt fid, const char *locName);
+ MEDLOADER_EXPORT void setName(const std::string& name);
+ static MEDFileFieldLoc *New(med_idt fid, const std::string& locName);
static MEDFileFieldLoc *New(med_idt fid, int id);
- static MEDFileFieldLoc *New(const char *locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w);
+ static MEDFileFieldLoc *New(const std::string& locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w);
std::size_t getHeapMemorySizeWithoutChildren() const;
std::vector<const BigMemoryObject *> getDirectChildren() const;
MEDFileFieldLoc *deepCpy() const;
MEDLOADER_EXPORT int getNbOfGaussPtPerCell() const { return _nb_gauss_pt; }
MEDLOADER_EXPORT void writeLL(med_idt fid) const;
MEDLOADER_EXPORT std::string repr() const;
- MEDLOADER_EXPORT bool isName(const char *name) const { return _name==name; }
+ MEDLOADER_EXPORT bool isName(const std::string& name) const { return _name==name; }
MEDLOADER_EXPORT int getDimension() const { return _dim; }
MEDLOADER_EXPORT int getNumberOfGaussPoints() const { return _nb_gauss_pt; }
MEDLOADER_EXPORT int getNumberOfPointsInCells() const { return _nb_node_per_cell; }
MEDLOADER_EXPORT INTERP_KERNEL::NormalizedCellType getGeoType() const { return _geo_type; }
MEDLOADER_EXPORT bool isEqual(const MEDFileFieldLoc& other, double eps) const;
private:
- MEDFileFieldLoc(med_idt fid, const char *locName);
+ MEDFileFieldLoc(med_idt fid, const std::string& locName);
MEDFileFieldLoc(med_idt fid, int id);
- MEDFileFieldLoc(const char *locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w);
+ MEDFileFieldLoc(const std::string& locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w);
private:
int _dim;
int _nb_gauss_pt;
const DataArray *getOrCreateAndGetArray() const;
const std::vector<std::string>& getInfo() const;
std::string getProfile() const;
- void setProfile(const char *newPflName);
+ void setProfile(const std::string& newPflName);
std::string getLocalization() const;
- void setLocalization(const char *newLocName);
+ void setLocalization(const std::string& newLocName);
int getLocId() const { return _loc_id; }
void setLocId(int newId) const { _loc_id=newId; }
void setFather(MEDFileFieldPerMeshPerType *newFather) { _father=newFather; }
std::vector<std::string> getPflsReallyUsedMulti() const;
std::vector<std::string> getLocsReallyUsedMulti() const;
bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
- bool renumberEntitiesLyingOnMesh(const char *meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N, MEDFileFieldGlobsReal& glob);
+ bool renumberEntitiesLyingOnMesh(const std::string& meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N, MEDFileFieldGlobsReal& glob);
void keepOnlySpatialDiscretization(TypeOfField tof, int &globalNum, std::vector< std::pair<int,int> >& its);
void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
class MEDFileFieldGlobs : public RefCountObject
{
public:
- static MEDFileFieldGlobs *New(const char *fname);
+ static MEDFileFieldGlobs *New(const std::string& fname);
static MEDFileFieldGlobs *New();
std::size_t getHeapMemorySizeWithoutChildren() const;
std::vector<const BigMemoryObject *> getDirectChildren() const;
void appendGlobs(const MEDFileFieldGlobs& other, double eps);
void checkGlobsPflsPartCoherency(const std::vector<std::string>& pflsUsed) const;
void checkGlobsLocsPartCoherency(const std::vector<std::string>& locsUsed) const;
- void loadProfileInFile(med_idt fid, int id, const char *pflName);
+ void loadProfileInFile(med_idt fid, int id, const std::string& pflName);
void loadProfileInFile(med_idt fid, int id);
void loadGlobals(med_idt fid, const MEDFileFieldGlobsReal& real);
void loadAllGlobals(med_idt fid);
void writeGlobals(med_idt fid, const MEDFileWritable& opt) const;
std::vector<std::string> getPfls() const;
std::vector<std::string> getLocs() const;
- bool existsPfl(const char *pflName) const;
- bool existsLoc(const char *locName) const;
+ bool existsPfl(const std::string& pflName) const;
+ bool existsLoc(const std::string& locName) const;
std::string createNewNameOfPfl() const;
std::string createNewNameOfLoc() const;
std::vector< std::vector<int> > whichAreEqualProfiles() const;
std::vector< std::vector<int> > whichAreEqualLocs(double eps) const;
- void setFileName(const char *fileName);
+ void setFileName(const std::string& fileName);
void changePflsNamesInStruct(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
void changeLocsNamesInStruct(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
int getNbOfGaussPtPerCell(int locId) const;
- int getLocalizationId(const char *loc) const;
- const char *getFileName() const { return _file_name.c_str(); }
+ int getLocalizationId(const std::string& loc) const;
+ std::string getFileName() const { return _file_name; }
std::string getFileName2() const { return _file_name; }
const MEDFileFieldLoc& getLocalizationFromId(int locId) const;
- const MEDFileFieldLoc& getLocalization(const char *locName) const;
+ const MEDFileFieldLoc& getLocalization(const std::string& locName) const;
const DataArrayInt *getProfileFromId(int pflId) const;
- const DataArrayInt *getProfile(const char *pflName) const;
+ const DataArrayInt *getProfile(const std::string& pflName) const;
MEDFileFieldLoc& getLocalizationFromId(int locId);
- MEDFileFieldLoc& getLocalization(const char *locName);
- DataArrayInt *getProfile(const char *pflName);
+ MEDFileFieldLoc& getLocalization(const std::string& locName);
+ DataArrayInt *getProfile(const std::string& pflName);
DataArrayInt *getProfileFromId(int pflId);
void killProfileIds(const std::vector<int>& pflIds);
void killLocalizationIds(const std::vector<int>& locIds);
//
void appendProfile(DataArrayInt *pfl);
- void appendLoc(const char *locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w);
+ void appendLoc(const std::string& locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w);
//
- static std::string CreateNewNameNotIn(const char *prefix, const std::vector<std::string>& namesToAvoid);
+ static std::string CreateNewNameNotIn(const std::string& prefix, const std::vector<std::string>& namesToAvoid);
protected:
- MEDFileFieldGlobs(const char *fname);
+ MEDFileFieldGlobs(const std::string& fname);
MEDFileFieldGlobs();
~MEDFileFieldGlobs();
protected:
class MEDFileFieldGlobsReal
{
public:
- MEDLOADER_EXPORT MEDFileFieldGlobsReal(const char *fname);
+ MEDLOADER_EXPORT MEDFileFieldGlobsReal(const std::string& fname);
MEDLOADER_EXPORT MEDFileFieldGlobsReal();
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
MEDLOADER_EXPORT virtual void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) = 0;
MEDLOADER_EXPORT virtual ~MEDFileFieldGlobsReal();
//
- MEDLOADER_EXPORT void loadProfileInFile(med_idt fid, int id, const char *pflName);
+ MEDLOADER_EXPORT void loadProfileInFile(med_idt fid, int id, const std::string& pflName);
MEDLOADER_EXPORT void loadProfileInFile(med_idt fid, int id);
MEDLOADER_EXPORT void loadGlobals(med_idt fid);
MEDLOADER_EXPORT void loadAllGlobals(med_idt fid);
MEDLOADER_EXPORT void writeGlobals(med_idt fid, const MEDFileWritable& opt) const;
MEDLOADER_EXPORT std::vector<std::string> getPfls() const;
MEDLOADER_EXPORT std::vector<std::string> getLocs() const;
- MEDLOADER_EXPORT bool existsPfl(const char *pflName) const;
- MEDLOADER_EXPORT bool existsLoc(const char *locName) const;
+ MEDLOADER_EXPORT bool existsPfl(const std::string& pflName) const;
+ MEDLOADER_EXPORT bool existsLoc(const std::string& locName) const;
MEDLOADER_EXPORT std::string createNewNameOfPfl() const;
MEDLOADER_EXPORT std::string createNewNameOfLoc() const;
MEDLOADER_EXPORT std::vector< std::vector<int> > whichAreEqualProfiles() const;
MEDLOADER_EXPORT std::vector< std::vector<int> > whichAreEqualLocs(double eps) const;
- MEDLOADER_EXPORT void setFileName(const char *fileName);
+ MEDLOADER_EXPORT void setFileName(const std::string& fileName);
MEDLOADER_EXPORT void changePflsNamesInStruct(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
MEDLOADER_EXPORT void changeLocsNamesInStruct(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
MEDLOADER_EXPORT void changePflsNames(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
MEDLOADER_EXPORT void changeLocsNames(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
- MEDLOADER_EXPORT void changePflName(const char *oldName, const char *newName);
- MEDLOADER_EXPORT void changeLocName(const char *oldName, const char *newName);
+ MEDLOADER_EXPORT void changePflName(const std::string& oldName, const std::string& newName);
+ MEDLOADER_EXPORT void changeLocName(const std::string& oldName, const std::string& newName);
MEDLOADER_EXPORT std::vector< std::pair<std::vector<std::string>, std::string > > zipPflsNames();
MEDLOADER_EXPORT std::vector< std::pair<std::vector<std::string>, std::string > > zipLocsNames(double eps);
MEDLOADER_EXPORT int getNbOfGaussPtPerCell(int locId) const;
- MEDLOADER_EXPORT int getLocalizationId(const char *loc) const;
- MEDLOADER_EXPORT const char *getFileName() const;
+ MEDLOADER_EXPORT int getLocalizationId(const std::string& loc) const;
+ MEDLOADER_EXPORT std::string getFileName() const;
MEDLOADER_EXPORT std::string getFileName2() const;
MEDLOADER_EXPORT const MEDFileFieldLoc& getLocalizationFromId(int locId) const;
- MEDLOADER_EXPORT const MEDFileFieldLoc& getLocalization(const char *locName) const;
+ MEDLOADER_EXPORT const MEDFileFieldLoc& getLocalization(const std::string& locName) const;
MEDLOADER_EXPORT MEDFileFieldLoc& getLocalizationFromId(int locId);
- MEDLOADER_EXPORT MEDFileFieldLoc& getLocalization(const char *locName);
- MEDLOADER_EXPORT const DataArrayInt *getProfile(const char *pflName) const;
+ MEDLOADER_EXPORT MEDFileFieldLoc& getLocalization(const std::string& locName);
+ MEDLOADER_EXPORT const DataArrayInt *getProfile(const std::string& pflName) const;
MEDLOADER_EXPORT const DataArrayInt *getProfileFromId(int pflId) const;
- MEDLOADER_EXPORT DataArrayInt *getProfile(const char *pflName);
+ MEDLOADER_EXPORT DataArrayInt *getProfile(const std::string& pflName);
MEDLOADER_EXPORT DataArrayInt *getProfileFromId(int pflId);
MEDLOADER_EXPORT void killProfileIds(const std::vector<int>& pflIds);
MEDLOADER_EXPORT void killLocalizationIds(const std::vector<int>& locIds);
//
MEDLOADER_EXPORT void appendProfile(DataArrayInt *pfl);
- MEDLOADER_EXPORT void appendLoc(const char *locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w);
+ MEDLOADER_EXPORT void appendLoc(const std::string& locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w);
protected:
MEDFileFieldGlobs *contentNotNull();
const MEDFileFieldGlobs *contentNotNull() const;
{
public:
MEDLOADER_EXPORT MEDFileFieldNameScope();
- MEDLOADER_EXPORT MEDFileFieldNameScope(const char *fieldName);
+ MEDLOADER_EXPORT MEDFileFieldNameScope(const std::string& fieldName);
MEDLOADER_EXPORT std::string getName() const;
- MEDLOADER_EXPORT void setName(const char *fieldName);
+ MEDLOADER_EXPORT void setName(const std::string& fieldName);
MEDLOADER_EXPORT std::string getDtUnit() const;
- MEDLOADER_EXPORT void setDtUnit(const char *dtUnit);
+ MEDLOADER_EXPORT void setDtUnit(const std::string& dtUnit);
MEDLOADER_EXPORT void copyNameScope(const MEDFileFieldNameScope& other);
protected:
std::string _name;
{
public:
MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA();
- MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA(const char *fieldName, int csit, int iteration, int order);
+ MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA(const std::string& fieldName, int csit, int iteration, int order);
MEDLOADER_EXPORT int getIteration() const { return _iteration; }
MEDLOADER_EXPORT int getOrder() const { return _order; }
MEDLOADER_EXPORT double getTime(int& iteration, int& order) const { iteration=_iteration; order=_order; return _dt; }
MEDLOADER_EXPORT void setTime(int iteration, int order, double val) { _dt=val; _iteration=iteration; _order=order; }
MEDLOADER_EXPORT int getDimension() const;
MEDLOADER_EXPORT std::string getMeshName() const;
- MEDLOADER_EXPORT void setMeshName(const char *newMeshName);
+ MEDLOADER_EXPORT void setMeshName(const std::string& newMeshName);
MEDLOADER_EXPORT bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
MEDLOADER_EXPORT int getMeshIteration() const;
MEDLOADER_EXPORT int getMeshOrder() const;
MEDLOADER_EXPORT void changePflsRefsNamesGen2(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
MEDLOADER_EXPORT void changeLocsRefsNamesGen2(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
//
- MEDLOADER_EXPORT int getNonEmptyLevels(const char *mname, std::vector<int>& levs) const;
- MEDLOADER_EXPORT std::vector< std::vector<std::pair<int,int> > > getFieldSplitedByType(const char *mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
+ MEDLOADER_EXPORT int getNonEmptyLevels(const std::string& mname, std::vector<int>& levs) const;
+ MEDLOADER_EXPORT std::vector< std::vector<std::pair<int,int> > > getFieldSplitedByType(const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
//
- MEDLOADER_EXPORT MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenMeshAndTypeAndLocId(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId);
- MEDLOADER_EXPORT const MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenMeshAndTypeAndLocId(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId) const;
+ MEDLOADER_EXPORT MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenMeshAndTypeAndLocId(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId);
+ MEDLOADER_EXPORT const MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenMeshAndTypeAndLocId(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId) const;
MEDLOADER_EXPORT void deepCpyLeavesFrom(const MEDFileAnyTypeField1TSWithoutSDA& other);
public:
MEDLOADER_EXPORT int getNumberOfComponents() const;
MEDLOADER_EXPORT virtual DataArray *getOrCreateAndGetArray() = 0;
MEDLOADER_EXPORT virtual const DataArray *getOrCreateAndGetArray() const = 0;
public:
- MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, const char *mName, int renumPol, const MEDFileFieldGlobsReal *glob, MEDCouplingAutoRefCountObjectPtr<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
+ MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, const std::string& mName, int renumPol, const MEDFileFieldGlobsReal *glob, MEDCouplingAutoRefCountObjectPtr<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol, const MEDFileFieldGlobsReal *glob, const MEDFileMesh *mesh, MEDCouplingAutoRefCountObjectPtr<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
- MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, const char *mName, int renumPol, const MEDFileFieldGlobsReal *glob, MEDCouplingAutoRefCountObjectPtr<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
+ MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, const std::string& mName, int renumPol, const MEDFileFieldGlobsReal *glob, MEDCouplingAutoRefCountObjectPtr<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int renumPol, const MEDFileFieldGlobsReal *glob, const MEDCouplingMesh *mesh, const DataArrayInt *cellRenum, const DataArrayInt *nodeRenum, MEDCouplingAutoRefCountObjectPtr<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
DataArray *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl, const MEDFileFieldGlobsReal *glob, const MEDFileFieldNameScope& nasc) const;
public:
- MEDLOADER_EXPORT bool renumberEntitiesLyingOnMesh(const char *meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N, MEDFileFieldGlobsReal& glob);
+ MEDLOADER_EXPORT bool renumberEntitiesLyingOnMesh(const std::string& meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N, MEDFileFieldGlobsReal& glob);
MEDLOADER_EXPORT std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> > splitDiscretizations() const;
MEDLOADER_EXPORT int keepOnlySpatialDiscretization(TypeOfField tof, std::vector< std::pair<int,int> >& its);
public:
MEDLOADER_EXPORT void unloadArrays();
MEDLOADER_EXPORT void writeLL(med_idt fid, const MEDFileWritable& opts, const MEDFileFieldNameScope& nasc) const;
protected:
- int getMeshIdFromMeshName(const char *mName) const;
+ int getMeshIdFromMeshName(const std::string& mName) const;
int addNewEntryIfNecessary(const MEDCouplingMesh *mesh);
void updateData(int newLgth, const std::vector< std::pair<int,int> >& oldStartStops);
protected:
MEDLOADER_EXPORT DataArray *getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
MEDLOADER_EXPORT DataArrayDouble *getUndergroundDataArrayDouble() const;
MEDLOADER_EXPORT DataArrayDouble *getUndergroundDataArrayDoubleExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
- MEDLOADER_EXPORT std::vector< std::vector<DataArrayDouble *> > getFieldSplitedByType2(const char *mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
+ MEDLOADER_EXPORT std::vector< std::vector<DataArrayDouble *> > getFieldSplitedByType2(const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
MEDLOADER_EXPORT static void CheckMeshDimRel(int meshDimRelToMax);
MEDLOADER_EXPORT static std::vector<int> CheckSBTMesh(const MEDCouplingMesh *mesh);
- MEDLOADER_EXPORT static MEDFileField1TSWithoutSDA *New(const char *fieldName, int csit, int iteration, int order, const std::vector<std::string>& infos);
+ MEDLOADER_EXPORT static MEDFileField1TSWithoutSDA *New(const std::string& fieldName, int csit, int iteration, int order, const std::vector<std::string>& infos);
public:
MEDLOADER_EXPORT MEDFileField1TSWithoutSDA();
- MEDLOADER_EXPORT MEDFileField1TSWithoutSDA(const char *fieldName, int csit, int iteration, int order, const std::vector<std::string>& infos);
+ MEDLOADER_EXPORT MEDFileField1TSWithoutSDA(const std::string& fieldName, int csit, int iteration, int order, const std::vector<std::string>& infos);
MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA *shallowCpy() const;
MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA *deepCpy() const;
MEDLOADER_EXPORT void setArray(DataArray *arr);
{
public:
MEDLOADER_EXPORT MEDFileIntField1TSWithoutSDA();
- MEDLOADER_EXPORT static MEDFileIntField1TSWithoutSDA *New(const char *fieldName, int csit, int iteration, int order, const std::vector<std::string>& infos);
+ MEDLOADER_EXPORT static MEDFileIntField1TSWithoutSDA *New(const std::string& fieldName, int csit, int iteration, int order, const std::vector<std::string>& infos);
MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA *deepCpy() const;
MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA *shallowCpy() const;
MEDLOADER_EXPORT const char *getTypeStr() const;
MEDLOADER_EXPORT DataArrayInt *getUndergroundDataArrayIntExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
MEDLOADER_EXPORT MEDFileField1TSWithoutSDA *convertToDouble() const;
protected:
- MEDFileIntField1TSWithoutSDA(const char *fieldName, int csit, int iteration, int order, const std::vector<std::string>& infos);
+ MEDFileIntField1TSWithoutSDA(const std::string& fieldName, int csit, int iteration, int order, const std::vector<std::string>& infos);
protected:
MEDCouplingAutoRefCountObjectPtr< DataArrayInt > _arr;
public:
{
protected:
MEDLOADER_EXPORT MEDFileAnyTypeField1TS();
- MEDLOADER_EXPORT MEDFileAnyTypeField1TS(const char *fileName, bool loadAll);
- MEDLOADER_EXPORT MEDFileAnyTypeField1TS(const char *fileName, const char *fieldName, bool loadAll);
- MEDLOADER_EXPORT MEDFileAnyTypeField1TS(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll);
+ MEDLOADER_EXPORT MEDFileAnyTypeField1TS(const std::string& fileName, bool loadAll);
+ MEDLOADER_EXPORT MEDFileAnyTypeField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll);
+ MEDLOADER_EXPORT MEDFileAnyTypeField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll);
MEDLOADER_EXPORT MEDFileAnyTypeField1TS(const MEDFileAnyTypeField1TSWithoutSDA& other, bool shallowCopyOfContent);
- MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *BuildNewInstanceFromContent(MEDFileAnyTypeField1TSWithoutSDA *c, const char *fileName);
- MEDLOADER_EXPORT static MEDFileAnyTypeField1TSWithoutSDA *BuildContentFrom(med_idt fid, const char *fileName, bool loadAll);
- MEDLOADER_EXPORT static MEDFileAnyTypeField1TSWithoutSDA *BuildContentFrom(med_idt fid, const char *fileName, const char *fieldName, bool loadAll);
- MEDLOADER_EXPORT static MEDFileAnyTypeField1TSWithoutSDA *BuildContentFrom(med_idt fid, const char *fileName, const char *fieldName, int iteration, int order, bool loadAll);
+ MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *BuildNewInstanceFromContent(MEDFileAnyTypeField1TSWithoutSDA *c, const std::string& fileName);
+ MEDLOADER_EXPORT static MEDFileAnyTypeField1TSWithoutSDA *BuildContentFrom(med_idt fid, const std::string& fileName, bool loadAll);
+ MEDLOADER_EXPORT static MEDFileAnyTypeField1TSWithoutSDA *BuildContentFrom(med_idt fid, const std::string& fileName, const std::string& fieldName, bool loadAll);
+ MEDLOADER_EXPORT static MEDFileAnyTypeField1TSWithoutSDA *BuildContentFrom(med_idt fid, const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll);
MEDLOADER_EXPORT void writeLL(med_idt fid) const;
// direct forwarding to MEDFileAnyTypeField1TSWithoutSDA instance _content
public:
- MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *New(const char *fileName, bool loadAll=true);
- MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *New(const char *fileName, const char *fieldName, bool loadAll=true);
- MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true);
+ MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true);
+ MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
+ MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
MEDLOADER_EXPORT int getDimension() const;
MEDLOADER_EXPORT int getIteration() const;
MEDLOADER_EXPORT int getOrder() const;
MEDLOADER_EXPORT double getTime(int& iteration, int& order) const;
MEDLOADER_EXPORT void setTime(int iteration, int order, double val);
MEDLOADER_EXPORT std::string getName() const;
- MEDLOADER_EXPORT void setName(const char *name);
+ MEDLOADER_EXPORT void setName(const std::string& name);
MEDLOADER_EXPORT std::string simpleRepr() const;
MEDLOADER_EXPORT void simpleRepr(int bkOffset, std::ostream& oss, int f1tsId) const;
MEDLOADER_EXPORT std::string getDtUnit() const;
- MEDLOADER_EXPORT void setDtUnit(const char *dtUnit);
+ MEDLOADER_EXPORT void setDtUnit(const std::string& dtUnit);
MEDLOADER_EXPORT std::string getMeshName() const;
- MEDLOADER_EXPORT void setMeshName(const char *newMeshName);
+ MEDLOADER_EXPORT void setMeshName(const std::string& newMeshName);
MEDLOADER_EXPORT bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
MEDLOADER_EXPORT int getMeshIteration() const;
MEDLOADER_EXPORT int getMeshOrder() const;
MEDLOADER_EXPORT const std::vector<std::string>& getInfo() const;
MEDLOADER_EXPORT std::vector<std::string>& getInfo();
MEDLOADER_EXPORT std::vector<TypeOfField> getTypesOfFieldAvailable() const;
- MEDLOADER_EXPORT std::vector< std::vector<std::pair<int,int> > > getFieldSplitedByType(const char *mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF,
+ MEDLOADER_EXPORT std::vector< std::vector<std::pair<int,int> > > getFieldSplitedByType(const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF,
std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const throw(INTERP_KERNEL::Exception);
- MEDLOADER_EXPORT MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenMeshAndTypeAndLocId(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId);
- MEDLOADER_EXPORT const MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenMeshAndTypeAndLocId(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId) const;
- MEDLOADER_EXPORT int getNonEmptyLevels(const char *mname, std::vector<int>& levs) const;
+ MEDLOADER_EXPORT MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenMeshAndTypeAndLocId(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId);
+ MEDLOADER_EXPORT const MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenMeshAndTypeAndLocId(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId) const;
+ MEDLOADER_EXPORT int getNonEmptyLevels(const std::string& mname, std::vector<int>& levs) const;
public:
- MEDLOADER_EXPORT void write(const char *fileName, int mode) const;
+ MEDLOADER_EXPORT void write(const std::string& fileName, int mode) const;
MEDLOADER_EXPORT void loadArrays();
MEDLOADER_EXPORT void loadArraysIfNecessary();
MEDLOADER_EXPORT void unloadArrays();
MEDLOADER_EXPORT virtual MEDFileAnyTypeField1TS *shallowCpy() const = 0;
public:
//! underground method see MEDFileField1TSWithoutSDA::setProfileNameOnLeaf
- MEDLOADER_EXPORT void setProfileNameOnLeaf(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newPflName, bool forceRenameOnGlob=false);
+ MEDLOADER_EXPORT void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false);
//! underground method see MEDFileField1TSWithoutSDA::setLocNameOnLeaf
- MEDLOADER_EXPORT void setLocNameOnLeaf(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newLocName, bool forceRenameOnGlob=false);
+ MEDLOADER_EXPORT void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false);
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsed() const;
MEDLOADER_EXPORT void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
MEDLOADER_EXPORT void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
public:
- MEDLOADER_EXPORT static int LocateField2(med_idt fid, const char *fileName, int fieldIdCFormat, bool checkFieldId, std::string& fieldName, med_field_type& typcha, std::vector<std::string>& infos, std::string& dtunitOut);
- MEDLOADER_EXPORT static int LocateField(med_idt fid, const char *fileName, const char *fieldName, int& posCFormat, med_field_type& typcha, std::vector<std::string>& infos, std::string& dtunitOut);
+ MEDLOADER_EXPORT static int LocateField2(med_idt fid, const std::string& fileName, int fieldIdCFormat, bool checkFieldId, std::string& fieldName, med_field_type& typcha, std::vector<std::string>& infos, std::string& dtunitOut);
+ MEDLOADER_EXPORT static int LocateField(med_idt fid, const std::string& fileName, const std::string& fieldName, int& posCFormat, med_field_type& typcha, std::vector<std::string>& infos, std::string& dtunitOut);
public:
MEDLOADER_EXPORT virtual med_field_type getMEDFileFieldType() const = 0;
MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA *contentNotNullBase();
class MEDFileField1TS : public MEDFileAnyTypeField1TS
{
public:
- MEDLOADER_EXPORT static MEDFileField1TS *New(const char *fileName, bool loadAll=true);
- MEDLOADER_EXPORT static MEDFileField1TS *New(const char *fileName, const char *fieldName, bool loadAll=true);
- MEDLOADER_EXPORT static MEDFileField1TS *New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true);
+ MEDLOADER_EXPORT static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true);
+ MEDLOADER_EXPORT static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
+ MEDLOADER_EXPORT static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
MEDLOADER_EXPORT static MEDFileField1TS *New(const MEDFileField1TSWithoutSDA& other, bool shallowCopyOfContent);
MEDLOADER_EXPORT static MEDFileField1TS *New();
MEDLOADER_EXPORT MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const;
MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
- MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const char *mname, int meshDimRelToMax, int renumPol=0) const;
+ MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
MEDLOADER_EXPORT DataArrayDouble *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl) const;
//
MEDLOADER_EXPORT void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field);
MEDLOADER_EXPORT DataArrayDouble *getUndergroundDataArray() const;
MEDLOADER_EXPORT DataArrayDouble *getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
- MEDLOADER_EXPORT std::vector< std::vector<DataArrayDouble *> > getFieldSplitedByType2(const char *mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF,
+ MEDLOADER_EXPORT std::vector< std::vector<DataArrayDouble *> > getFieldSplitedByType2(const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF,
std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const throw(INTERP_KERNEL::Exception);
public:
MEDLOADER_EXPORT static void SetDataArrayDoubleInField(MEDCouplingFieldDouble *f, MEDCouplingAutoRefCountObjectPtr<DataArray>& arr);
const MEDFileField1TSWithoutSDA *contentNotNull() const;
MEDFileField1TSWithoutSDA *contentNotNull();
private:
- MEDFileField1TS(const char *fileName, bool loadAll);
- MEDFileField1TS(const char *fileName, const char *fieldName, bool loadAll);
- MEDFileField1TS(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll);
+ MEDFileField1TS(const std::string& fileName, bool loadAll);
+ MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll);
+ MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll);
MEDFileField1TS(const MEDFileField1TSWithoutSDA& other, bool shallowCopyOfContent);
MEDFileField1TS();
};
{
public:
MEDLOADER_EXPORT static MEDFileIntField1TS *New();
- MEDLOADER_EXPORT static MEDFileIntField1TS *New(const char *fileName, bool loadAll=true);
- MEDLOADER_EXPORT static MEDFileIntField1TS *New(const char *fileName, const char *fieldName, bool loadAll=true);
- MEDLOADER_EXPORT static MEDFileIntField1TS *New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true);
+ MEDLOADER_EXPORT static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true);
+ MEDLOADER_EXPORT static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
+ MEDLOADER_EXPORT static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
MEDLOADER_EXPORT static MEDFileIntField1TS *New(const MEDFileIntField1TSWithoutSDA& other, bool shallowCopyOfContent);
MEDLOADER_EXPORT MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const;
MEDLOADER_EXPORT MEDFileAnyTypeField1TS *shallowCpy() const;
MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, DataArrayInt* &arrOut, int renumPol=0) const;
MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt* &arrOut, int renumPol=0) const;
MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, DataArrayInt* &arrOut, int renumPol=0) const;
- MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const char *mname, int meshDimRelToMax, DataArrayInt* &arrOut, int renumPol=0) const;
+ MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, DataArrayInt* &arrOut, int renumPol=0) const;
MEDLOADER_EXPORT DataArrayInt *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl) const;
//
MEDLOADER_EXPORT void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals);
MEDFileIntField1TSWithoutSDA *contentNotNull();
private:
MEDFileIntField1TS();
- MEDFileIntField1TS(const char *fileName, bool loadAll);
- MEDFileIntField1TS(const char *fileName, const char *fieldName, bool loadAll);
- MEDFileIntField1TS(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll);
+ MEDFileIntField1TS(const std::string& fileName, bool loadAll);
+ MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll);
+ MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll);
MEDFileIntField1TS(const MEDFileIntField1TSWithoutSDA& other, bool shallowCopyOfContent);
};
{
protected:
MEDFileAnyTypeFieldMultiTSWithoutSDA();
- MEDFileAnyTypeFieldMultiTSWithoutSDA(const char *fieldName);
+ MEDFileAnyTypeFieldMultiTSWithoutSDA(const std::string& fieldName);
MEDFileAnyTypeFieldMultiTSWithoutSDA(med_idt fid, int fieldId, bool loadAll);
- MEDFileAnyTypeFieldMultiTSWithoutSDA(med_idt fid, const char *fieldName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll);
+ MEDFileAnyTypeFieldMultiTSWithoutSDA(med_idt fid, const std::string& fieldName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll);
public:
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
MEDLOADER_EXPORT const MEDFileAnyTypeField1TSWithoutSDA& getTimeStepEntry(int iteration, int order) const;
MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA& getTimeStepEntry(int iteration, int order);
MEDLOADER_EXPORT std::string getMeshName() const;
- MEDLOADER_EXPORT void setMeshName(const char *newMeshName);
+ MEDLOADER_EXPORT void setMeshName(const std::string& newMeshName);
MEDLOADER_EXPORT bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
MEDLOADER_EXPORT int getNumberOfTS() const;
MEDLOADER_EXPORT void eraseEmptyTS();
MEDLOADER_EXPORT void pushBackTimeStep(MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA>& tse);
MEDLOADER_EXPORT void synchronizeNameScope();
MEDLOADER_EXPORT void simpleRepr(int bkOffset, std::ostream& oss, int fmtsId) const;
- MEDLOADER_EXPORT int getNonEmptyLevels(int iteration, int order, const char *mname, std::vector<int>& levs) const;
+ MEDLOADER_EXPORT int getNonEmptyLevels(int iteration, int order, const std::string& mname, std::vector<int>& levs) const;
MEDLOADER_EXPORT void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob);
MEDLOADER_EXPORT void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArray *arr, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile, MEDFileFieldGlobsReal& glob);
- MEDLOADER_EXPORT std::vector< std::vector< std::pair<int,int> > > getFieldSplitedByType(int iteration, int order, const char *mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
+ MEDLOADER_EXPORT std::vector< std::vector< std::pair<int,int> > > getFieldSplitedByType(int iteration, int order, const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
MEDLOADER_EXPORT std::vector< std::vector<TypeOfField> > getTypesOfFieldAvailable() const;
MEDLOADER_EXPORT DataArray *getUndergroundDataArray(int iteration, int order) const;
MEDLOADER_EXPORT DataArray *getUndergroundDataArrayExt(int iteration, int order, std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
- MEDLOADER_EXPORT bool renumberEntitiesLyingOnMesh(const char *meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N, MEDFileFieldGlobsReal& glob);
+ MEDLOADER_EXPORT bool renumberEntitiesLyingOnMesh(const std::string& meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N, MEDFileFieldGlobsReal& glob);
MEDLOADER_EXPORT void loadStructureOrStructureAndBigArraysRecursively(med_idt fid, int nbPdt, med_field_type fieldTyp, bool loadAll);
MEDLOADER_EXPORT void writeLL(med_idt fid, const MEDFileWritable& opts) const;
MEDLOADER_EXPORT void loadBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc);
class MEDFileFieldMultiTSWithoutSDA : public MEDFileAnyTypeFieldMultiTSWithoutSDA
{
public:
- MEDLOADER_EXPORT static MEDFileFieldMultiTSWithoutSDA *New(med_idt fid, const char *fieldName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll);
+ MEDLOADER_EXPORT static MEDFileFieldMultiTSWithoutSDA *New(med_idt fid, const std::string& fieldName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll);
MEDLOADER_EXPORT MEDFileFieldMultiTSWithoutSDA(med_idt fid, int fieldId, bool loadAll);
MEDLOADER_EXPORT const char *getTypeStr() const;
MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *shallowCpy() const;
MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *createNew() const;
- MEDLOADER_EXPORT std::vector< std::vector<DataArrayDouble *> > getFieldSplitedByType2(int iteration, int order, const char *mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
+ MEDLOADER_EXPORT std::vector< std::vector<DataArrayDouble *> > getFieldSplitedByType2(int iteration, int order, const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
MEDLOADER_EXPORT MEDFileIntFieldMultiTSWithoutSDA *convertToInt() const;
protected:
- MEDFileFieldMultiTSWithoutSDA(const char *fieldName);
- MEDFileFieldMultiTSWithoutSDA(med_idt fid, const char *fieldName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll);
+ MEDFileFieldMultiTSWithoutSDA(const std::string& fieldName);
+ MEDFileFieldMultiTSWithoutSDA(med_idt fid, const std::string& fieldName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll);
med_field_type getMEDFileFieldType() const { return MED_FLOAT64; }
MEDFileAnyTypeField1TSWithoutSDA *createNew1TSWithoutSDAEmptyInstance() const;
void checkCoherencyOfType(const MEDFileAnyTypeField1TSWithoutSDA *f1ts) const;
class MEDFileIntFieldMultiTSWithoutSDA : public MEDFileAnyTypeFieldMultiTSWithoutSDA
{
public:
- MEDLOADER_EXPORT static MEDFileIntFieldMultiTSWithoutSDA *New(med_idt fid, const char *fieldName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll);
+ MEDLOADER_EXPORT static MEDFileIntFieldMultiTSWithoutSDA *New(med_idt fid, const std::string& fieldName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll);
MEDLOADER_EXPORT MEDFileIntFieldMultiTSWithoutSDA(med_idt fid, int fieldId, bool loadAll);
MEDLOADER_EXPORT const char *getTypeStr() const;
MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *shallowCpy() const;
MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *createNew() const;
MEDLOADER_EXPORT MEDFileFieldMultiTSWithoutSDA *convertToDouble() const;
protected:
- MEDFileIntFieldMultiTSWithoutSDA(const char *fieldName);
- MEDFileIntFieldMultiTSWithoutSDA(med_idt fid, const char *fieldName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll);
+ MEDFileIntFieldMultiTSWithoutSDA(const std::string& fieldName);
+ MEDFileIntFieldMultiTSWithoutSDA(med_idt fid, const std::string& fieldName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll);
med_field_type getMEDFileFieldType() const { return MED_INT32; }
MEDFileAnyTypeField1TSWithoutSDA *createNew1TSWithoutSDAEmptyInstance() const;
void checkCoherencyOfType(const MEDFileAnyTypeField1TSWithoutSDA *f1ts) const;
{
protected:
MEDFileAnyTypeFieldMultiTS();
- MEDFileAnyTypeFieldMultiTS(const char *fileName, bool loadAll);
- MEDFileAnyTypeFieldMultiTS(const char *fileName, const char *fieldName, bool loadAll);
+ MEDFileAnyTypeFieldMultiTS(const std::string& fileName, bool loadAll);
+ MEDFileAnyTypeFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll);
MEDFileAnyTypeFieldMultiTS(const MEDFileAnyTypeFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent);
- static MEDFileAnyTypeFieldMultiTS *BuildNewInstanceFromContent(MEDFileAnyTypeFieldMultiTSWithoutSDA *c, const char *fileName);
- static MEDFileAnyTypeFieldMultiTSWithoutSDA *BuildContentFrom(med_idt fid, const char *fileName, bool loadAll);
- static MEDFileAnyTypeFieldMultiTSWithoutSDA *BuildContentFrom(med_idt fid, const char *fileName, const char *fieldName, bool loadAll);
+ static MEDFileAnyTypeFieldMultiTS *BuildNewInstanceFromContent(MEDFileAnyTypeFieldMultiTSWithoutSDA *c, const std::string& fileName);
+ static MEDFileAnyTypeFieldMultiTSWithoutSDA *BuildContentFrom(med_idt fid, const std::string& fileName, bool loadAll);
+ static MEDFileAnyTypeFieldMultiTSWithoutSDA *BuildContentFrom(med_idt fid, const std::string& fileName, const std::string& fieldName, bool loadAll);
public:
- MEDLOADER_EXPORT static MEDFileAnyTypeFieldMultiTS *New(const char *fileName, bool loadAll=true);
- MEDLOADER_EXPORT static MEDFileAnyTypeFieldMultiTS *New(const char *fileName, const char *fieldName, bool loadAll=true);
+ MEDLOADER_EXPORT static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
+ MEDLOADER_EXPORT static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
MEDLOADER_EXPORT void loadArrays();
MEDLOADER_EXPORT void loadArraysIfNecessary();
MEDLOADER_EXPORT void unloadArrays();
- MEDLOADER_EXPORT void write(const char *fileName, int mode) const;
+ MEDLOADER_EXPORT void write(const std::string& fileName, int mode) const;
MEDLOADER_EXPORT void writeLL(med_idt fid) const;
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
MEDLOADER_EXPORT static int CheckSupportAcrossTime(MEDFileAnyTypeFieldMultiTS *f0, MEDFileAnyTypeFieldMultiTS *f1, const MEDFileMesh *mesh, TypeOfField& tof0, TypeOfField& tof1);
public:// direct forwarding to MEDFileField1TSWithoutSDA instance _content
MEDLOADER_EXPORT std::string getName() const;
- MEDLOADER_EXPORT void setName(const char *name);
+ MEDLOADER_EXPORT void setName(const std::string& name);
MEDLOADER_EXPORT std::string getDtUnit() const;
- MEDLOADER_EXPORT void setDtUnit(const char *dtUnit);
+ MEDLOADER_EXPORT void setDtUnit(const std::string& dtUnit);
MEDLOADER_EXPORT std::string getMeshName() const;
- MEDLOADER_EXPORT void setMeshName(const char *newMeshName);
+ MEDLOADER_EXPORT void setMeshName(const std::string& newMeshName);
MEDLOADER_EXPORT std::string simpleRepr() const;
MEDLOADER_EXPORT void simpleRepr(int bkOffset, std::ostream& oss, int fmtsId) const;
MEDLOADER_EXPORT int getNumberOfTS() const;
MEDLOADER_EXPORT const std::vector<std::string>& getInfo() const;
MEDLOADER_EXPORT void setInfo(const std::vector<std::string>& info);
MEDLOADER_EXPORT int getNumberOfComponents() const;
- MEDLOADER_EXPORT int getNonEmptyLevels(int iteration, int order, const char *mname, std::vector<int>& levs) const;
+ MEDLOADER_EXPORT int getNonEmptyLevels(int iteration, int order, const std::string& mname, std::vector<int>& levs) const;
MEDLOADER_EXPORT std::vector< std::vector<TypeOfField> > getTypesOfFieldAvailable() const;
- MEDLOADER_EXPORT std::vector< std::vector< std::pair<int,int> > > getFieldSplitedByType(int iteration, int order, const char *mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
+ MEDLOADER_EXPORT std::vector< std::vector< std::pair<int,int> > > getFieldSplitedByType(int iteration, int order, const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
MEDLOADER_EXPORT MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> getContent();
public:
MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsed() const;
{
public:
MEDLOADER_EXPORT static MEDFileFieldMultiTS *New();
- MEDLOADER_EXPORT static MEDFileFieldMultiTS *New(const char *fileName, bool loadAll=true);
- MEDLOADER_EXPORT static MEDFileFieldMultiTS *New(const char *fileName, const char *fieldName, bool loadAll=true);
+ MEDLOADER_EXPORT static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
+ MEDLOADER_EXPORT static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
MEDLOADER_EXPORT static MEDFileFieldMultiTS *New(const MEDFileFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent);
MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *shallowCpy() const;
MEDLOADER_EXPORT void checkCoherencyOfType(const MEDFileAnyTypeField1TS *f1ts) const;
MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
- MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const char *mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
+ MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
MEDLOADER_EXPORT DataArrayDouble *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl) const;
//
MEDLOADER_EXPORT void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field);
MEDLOADER_EXPORT void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile);
- MEDLOADER_EXPORT std::vector< std::vector<DataArrayDouble *> > getFieldSplitedByType2(int iteration, int order, const char *mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
+ MEDLOADER_EXPORT std::vector< std::vector<DataArrayDouble *> > getFieldSplitedByType2(int iteration, int order, const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
MEDLOADER_EXPORT DataArrayDouble *getUndergroundDataArray(int iteration, int order) const;
MEDLOADER_EXPORT DataArrayDouble *getUndergroundDataArrayExt(int iteration, int order, std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
private:
private:
MEDFileFieldMultiTS();
MEDFileFieldMultiTS(const MEDFileFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent);
- MEDFileFieldMultiTS(const char *fileName, bool loadAll);
- MEDFileFieldMultiTS(const char *fileName, const char *fieldName, bool loadAll);
+ MEDFileFieldMultiTS(const std::string& fileName, bool loadAll);
+ MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll);
};
/*!
{
public:
MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New();
- MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New(const char *fileName, bool loadAll=true);
- MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New(const char *fileName, const char *fieldName, bool loadAll=true);
+ MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
+ MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New(const MEDFileIntFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent);
MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *shallowCpy() const;
MEDLOADER_EXPORT void checkCoherencyOfType(const MEDFileAnyTypeField1TS *f1ts) const;
MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, DataArrayInt* &arrOut, int renumPol=0) const;
MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt* &arrOut, int renumPol=0) const;
MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, DataArrayInt* &arrOut, int renumPol=0) const;
- MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const char *mname, int meshDimRelToMax, DataArrayInt* &arrOut, int renumPol=0) const;
+ MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, DataArrayInt* &arrOut, int renumPol=0) const;
MEDLOADER_EXPORT DataArrayInt *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl) const;
//
MEDLOADER_EXPORT void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals);
private:
MEDFileIntFieldMultiTS();
MEDFileIntFieldMultiTS(const MEDFileIntFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent);
- MEDFileIntFieldMultiTS(const char *fileName, bool loadAll);
- MEDFileIntFieldMultiTS(const char *fileName, const char *fieldName, bool loadAll);
+ MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll);
+ MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll);
};
class MEDFileAnyTypeFieldMultiTSIterator
{
public:
MEDLOADER_EXPORT static MEDFileFields *New();
- MEDLOADER_EXPORT static MEDFileFields *New(const char *fileName, bool loadAll=true);
+ MEDLOADER_EXPORT static MEDFileFields *New(const std::string& fileName, bool loadAll=true);
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
MEDLOADER_EXPORT MEDFileFields *deepCpy() const;
MEDLOADER_EXPORT MEDFileFields *shallowCpy() const;
- MEDLOADER_EXPORT void write(const char *fileName, int mode) const;
+ MEDLOADER_EXPORT void write(const std::string& fileName, int mode) const;
MEDLOADER_EXPORT void writeLL(med_idt fid) const;
MEDLOADER_EXPORT void loadArrays();
MEDLOADER_EXPORT void loadArraysIfNecessary();
MEDLOADER_EXPORT void pushField(MEDFileAnyTypeFieldMultiTS *field);
MEDLOADER_EXPORT void pushFields(const std::vector<MEDFileAnyTypeFieldMultiTS *>& fields);
MEDLOADER_EXPORT void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field);
- MEDLOADER_EXPORT int getPosFromFieldName(const char *fieldName) const;
+ MEDLOADER_EXPORT int getPosFromFieldName(const std::string& fieldName) const;
MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const;
- MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *getFieldWithName(const char *fieldName) const;
+ MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const;
MEDLOADER_EXPORT MEDFileFields *buildSubPart(const int *startIds, const int *endIds) const;
- MEDLOADER_EXPORT MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const char *meshName) const;
+ MEDLOADER_EXPORT MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const;
MEDLOADER_EXPORT MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(const std::vector< std::pair<int,int> >& timeSteps) const;
MEDLOADER_EXPORT MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(const std::vector< std::pair<int,int> >& timeSteps) const;
MEDLOADER_EXPORT MEDFileFieldsIterator *iterator();
MEDLOADER_EXPORT void destroyFieldsAtPos(const int *startIds, const int *endIds);
MEDLOADER_EXPORT void destroyFieldsAtPos2(int bg, int end, int step);
MEDLOADER_EXPORT bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
- MEDLOADER_EXPORT bool renumberEntitiesLyingOnMesh(const char *meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N);
+ MEDLOADER_EXPORT bool renumberEntitiesLyingOnMesh(const std::string& meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N);
public:
MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsed() const;
MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsed() const;
MEDLOADER_EXPORT void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
private:
MEDFileFields();
- MEDFileFields(const char *fileName, bool loadAll);
+ MEDFileFields(const std::string& fileName, bool loadAll);
private:
std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> > _fields;
};
}
}
-bool MEDFileField1TSStructItem2::isFastlyEqual(int& startExp, INTERP_KERNEL::NormalizedCellType gt, const char *pflName) const
+bool MEDFileField1TSStructItem2::isFastlyEqual(int& startExp, INTERP_KERNEL::NormalizedCellType gt, const std::string& pflName) const
{
if(startExp!=_start_end.first)
return false;
std::vector< std::vector<std::string> > pfls,locs;
std::vector< std::vector<TypeOfField> > typesF;
std::vector<INTERP_KERNEL::NormalizedCellType> geoTypes;
- std::vector< std::vector<std::pair<int,int> > > strtEnds=ref->getFieldSplitedByType(0,geoTypes,typesF,pfls,locs);
+ std::vector< std::vector<std::pair<int,int> > > strtEnds=ref->getFieldSplitedByType(std::string(),geoTypes,typesF,pfls,locs);
std::size_t nbOfGeoTypes(geoTypes.size());
if(nbOfGeoTypes==0)
throw INTERP_KERNEL::Exception("MEDFileField1TSStruct : not null by empty ref !");
int getNbOfIntegrationPts(const MEDFileFieldGlobsReal *globs) const;
//! warning this method also set _nb_of_entity attribute !
void checkInRange(int nbOfEntity, int nip, const MEDFileFieldGlobsReal *globs);
- bool isFastlyEqual(int& startExp, INTERP_KERNEL::NormalizedCellType gt, const char *pflName) const;
+ bool isFastlyEqual(int& startExp, INTERP_KERNEL::NormalizedCellType gt, const std::string& pflName) const;
bool operator==(const MEDFileField1TSStructItem2& other) const throw(INTERP_KERNEL::Exception);
bool isCellSupportEqual(const MEDFileField1TSStructItem2& other, const MEDFileFieldGlobsReal *globs) const;
bool isNodeSupportEqual(const MEDFileField1TSStructItem2& other, const MEDFileFieldGlobsReal *globs) const;
* \throw If there is no meshes in the file.
* \throw If the mesh in the file is of a not supported type.
*/
-MEDFileMesh *MEDFileMesh::New(const char *fileName, MEDFileMeshReadSelector *mrs)
+MEDFileMesh *MEDFileMesh::New(const std::string& fileName, MEDFileMeshReadSelector *mrs)
{
std::vector<std::string> ms=MEDLoader::GetMeshNames(fileName);
if(ms.empty())
}
MEDFileUtilities::CheckFileForRead(fileName);
ParaMEDMEM::MEDCouplingMeshType meshType;
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
int dt,it;
std::string dummy2;
- MEDFileMeshL2::GetMeshIdFromName(fid,ms.front().c_str(),meshType,dt,it,dummy2);
+ MEDFileMeshL2::GetMeshIdFromName(fid,ms.front(),meshType,dt,it,dummy2);
switch(meshType)
{
case UNSTRUCTURED:
{
MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> ret=MEDFileUMesh::New();
- ret->loadUMeshFromFile(fid,ms.front().c_str(),dt,it,mrs);
+ ret->loadUMeshFromFile(fid,ms.front(),dt,it,mrs);
return (MEDFileUMesh *)ret.retn();
}
case CARTESIAN:
{
MEDCouplingAutoRefCountObjectPtr<MEDFileCMesh> ret=MEDFileCMesh::New();
- ret->loadCMeshFromFile(fid,ms.front().c_str(),dt,it,mrs);
+ ret->loadCMeshFromFile(fid,ms.front(),dt,it,mrs);
return (MEDFileCMesh *)ret.retn();
}
case CURVE_LINEAR:
{
MEDCouplingAutoRefCountObjectPtr<MEDFileCurveLinearMesh> ret=MEDFileCurveLinearMesh::New();
- ret->loadCLMeshFromFile(fid,ms.front().c_str(),dt,it,mrs);
+ ret->loadCLMeshFromFile(fid,ms.front(),dt,it,mrs);
return (MEDFileCurveLinearMesh *)ret.retn();
}
default:
* \throw If there is no mesh with given attributes in the file.
* \throw If the mesh in the file is of a not supported type.
*/
-MEDFileMesh *MEDFileMesh::New(const char *fileName, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs)
+MEDFileMesh *MEDFileMesh::New(const std::string& fileName, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs)
{
MEDFileUtilities::CheckFileForRead(fileName);
ParaMEDMEM::MEDCouplingMeshType meshType;
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
int dummy0,dummy1;
std::string dummy2;
MEDFileMeshL2::GetMeshIdFromName(fid,mName,meshType,dummy0,dummy1,dummy2);
* \throw If the mesh name is not set.
* \throw If \a mode == 1 and the same data is present in an existing file.
*/
-void MEDFileMesh::write(const char *fileName, int mode) const
+void MEDFileMesh::write(const std::string& fileName, int mode) const
{
med_access_mode medmod=MEDFileUtilities::TraduceWriteMode(mode);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,medmod);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),medmod);
std::ostringstream oss; oss << "MEDFileMesh : error on attempt to write in file : \"" << fileName << "\"";
- MEDFileUtilities::CheckMEDCode(fid,fid,oss.str().c_str());
+ MEDFileUtilities::CheckMEDCode(fid,fid,oss.str());
write(fid);
}
* \return std::vector<std::string> - a sequence of names of the families.
* \throw If the name of a nonexistent group is specified.
*/
-std::vector<std::string> MEDFileMesh::getFamiliesOnGroup(const char *name) const
+std::vector<std::string> MEDFileMesh::getFamiliesOnGroup(const std::string& name) const
{
std::string oname(name);
std::map<std::string, std::vector<std::string> >::const_iterator it=_groups.find(oname);
* \return std::vector<int> - sequence of ids of the families.
* \throw If the name of a nonexistent group is specified.
*/
-std::vector<int> MEDFileMesh::getFamiliesIdsOnGroup(const char *name) const
+std::vector<int> MEDFileMesh::getFamiliesIdsOnGroup(const std::string& name) const
{
std::string oname(name);
std::map<std::string, std::vector<std::string> >::const_iterator it=_groups.find(oname);
* \param [in] name - the name of the group of interest.
* \param [in] fams - a sequence of names of families constituting the group.
*/
-void MEDFileMesh::setFamiliesOnGroup(const char *name, const std::vector<std::string>& fams)
+void MEDFileMesh::setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams)
{
std::string oname(name);
_groups[oname]=fams;
* \param [in] famIds - a sequence of ids of families constituting the group.
* \throw If a family name is not found by its id.
*/
-void MEDFileMesh::setFamiliesIdsOnGroup(const char *name, const std::vector<int>& famIds)
+void MEDFileMesh::setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds)
{
std::string oname(name);
std::vector<std::string> fams(famIds.size());
* \param [in] name - the name of the family of interest.
* \return std::vector<std::string> - a sequence of names of groups including the family.
*/
-std::vector<std::string> MEDFileMesh::getGroupsOnFamily(const char *name) const
+std::vector<std::string> MEDFileMesh::getGroupsOnFamily(const std::string& name) const
{
std::vector<std::string> ret;
for(std::map<std::string, std::vector<std::string> >::const_iterator it1=_groups.begin();it1!=_groups.end();it1++)
* \param [in] grps - a sequence of group names to add the family in.
* \throw If a family named \a famName not yet exists.
*/
-void MEDFileMesh::setGroupsOnFamily(const char *famName, const std::vector<std::string>& grps)
+void MEDFileMesh::setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps)
{
std::string fName(famName);
const std::map<std::string,int>::const_iterator it=_families.find(fName);
std::map<std::string,int> newFams;
for(std::map<std::string,int>::const_iterator it=_families.begin();it!=_families.end();it++)
{
- std::vector<std::string> grps=getGroupsOnFamily((*it).first.c_str());
+ std::vector<std::string> grps=getGroupsOnFamily((*it).first);
if(grps.size()==1 && groups[grps[0]].size()==1)
{
if(newFams.find(grps[0])!=newFams.end())
* \param [in] name - the name of the group to remove.
* \throw If no group with such a \a name exists.
*/
-void MEDFileMesh::removeGroup(const char *name)
+void MEDFileMesh::removeGroup(const std::string& name)
{
std::string oname(name);
std::map<std::string, std::vector<std::string> >::iterator it=_groups.find(oname);
* \param [in] name - the name of the family to remove.
* \throw If no family with such a \a name exists.
*/
-void MEDFileMesh::removeFamily(const char *name)
+void MEDFileMesh::removeFamily(const std::string& name)
{
std::string oname(name);
std::map<std::string, int >::iterator it=_families.find(oname);
else
{
ret.push_back((*it).first);
- std::vector<std::string> grpsOnEraseFam=getGroupsOnFamily((*it).first.c_str());
+ std::vector<std::string> grpsOnEraseFam=getGroupsOnFamily((*it).first);
for(std::vector<std::string>::const_iterator it2=grpsOnEraseFam.begin();it2!=grpsOnEraseFam.end();it2++)
{
std::map<std::string, std::vector<std::string> >::iterator it3=grps.find(*it2);//it3!=grps.empty() thanks to copy
* \throw If no group named \a oldName exists in \a this mesh.
* \throw If a group named \a newName already exists.
*/
-void MEDFileMesh::changeGroupName(const char *oldName, const char *newName)
+void MEDFileMesh::changeGroupName(const std::string& oldName, const std::string& newName)
{
std::string oname(oldName);
std::map<std::string, std::vector<std::string> >::iterator it=_groups.find(oname);
* \throw If no family named \a oldName exists in \a this mesh.
* \throw If a family named \a newName already exists.
*/
-void MEDFileMesh::changeFamilyName(const char *oldName, const char *newName)
+void MEDFileMesh::changeFamilyName(const std::string& oldName, const std::string& newName)
{
std::string oname(oldName);
std::map<std::string, int >::iterator it=_families.find(oname);
* \param [in] groupName - the group name.
* \return bool - \c true the group \a groupName exists in \a this mesh.
*/
-bool MEDFileMesh::existsGroup(const char *groupName) const
+bool MEDFileMesh::existsGroup(const std::string& groupName) const
{
std::string grpName(groupName);
return _groups.find(grpName)!=_groups.end();
* \param [in] familyName - the family name.
* \return bool - \c true the family \a familyName exists in \a this mesh.
*/
-bool MEDFileMesh::existsFamily(const char *familyName) const
+bool MEDFileMesh::existsFamily(const std::string& familyName) const
{
std::string fname(familyName);
return _families.find(fname)!=_families.end();
* \param [in] familyName - the family name.
* \param [in] id - a new id of the family.
*/
-void MEDFileMesh::setFamilyId(const char *familyName, int id)
+void MEDFileMesh::setFamilyId(const std::string& familyName, int id)
{
std::string fname(familyName);
_families[fname]=id;
}
-void MEDFileMesh::setFamilyIdUnique(const char *familyName, int id)
+void MEDFileMesh::setFamilyIdUnique(const std::string& familyName, int id)
{
std::string fname(familyName);
for(std::map<std::string,int>::const_iterator it=_families.begin();it!=_families.end();it++)
* \param [in] famId - an id of the family.
* \throw If a family with the same name or id already exists in \a this mesh.
*/
-void MEDFileMesh::addFamily(const char *familyName, int famId)
+void MEDFileMesh::addFamily(const std::string& familyName, int famId)
{
std::string fname(familyName);
std::map<std::string,int>::const_iterator it=_families.find(fname);
* \throw If no mesh entities of dimension \a meshDimRelToMaxExt exist in \a this mesh.
* \throw If no family field of dimension \a meshDimRelToMaxExt is present in \a this mesh.
*/
-void MEDFileMesh::createGroupOnAll(int meshDimRelToMaxExt, const char *groupName)
+void MEDFileMesh::createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName)
{
std::string grpName(groupName);
std::vector<int> levs=getNonEmptyLevelsExt();
std::string famName=getFamilyNameGivenId(*it2);
std::ostringstream oss; oss << "Family_" << maxFamId;
std::string zeName=CreateNameNotIn(oss.str(),allFams);
- addFamilyOnAllGroupsHaving(famName.c_str(),zeName.c_str());
+ addFamilyOnAllGroupsHaving(famName,zeName);
_families[zeName]=maxFamId;
(const_cast<DataArrayInt *>(fieldFamIds))->changeValue(*it2,maxFamId);
maxFamId++;
* \throw If \a grpName or \a famName is an empty string.
* \throw If no family named \a famName is present in \a this mesh.
*/
-void MEDFileMesh::addFamilyOnGrp(const char *grpName, const char *famName)
+void MEDFileMesh::addFamilyOnGrp(const std::string& grpName, const std::string& famName)
{
std::string grpn(grpName);
std::string famn(famName);
* This method is quite underground because it can lead to unconsistency because family 'otherFamName' is \b not added into _families.
* This method is used by MEDFileMesh::keepFamIdsOnlyOnLevs method.
*/
-void MEDFileMesh::addFamilyOnAllGroupsHaving(const char *famName, const char *otherFamName)
+void MEDFileMesh::addFamilyOnAllGroupsHaving(const std::string& famName, const std::string& otherFamName)
{
std::string famNameCpp(famName);
std::string otherCpp(otherFamName);
}
}
-void MEDFileMesh::changeAllGroupsContainingFamily(const char *familyNameToChange, const std::vector<std::string>& newFamiliesNames)
+void MEDFileMesh::changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames)
{
ChangeAllGroupsContainingFamily(_groups,familyNameToChange,newFamiliesNames);
}
-void MEDFileMesh::ChangeAllGroupsContainingFamily(std::map<std::string, std::vector<std::string> >& groups, const char *familyNameToChange, const std::vector<std::string>& newFamiliesNames)
+void MEDFileMesh::ChangeAllGroupsContainingFamily(std::map<std::string, std::vector<std::string> >& groups, const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames)
{
std::string fam(familyNameToChange);
for(std::map<std::string, std::vector<std::string> >::iterator it=groups.begin();it!=groups.end();it++)
* \return int - the id of the family of interest.
* \throw If no family with such a \a name exists.
*/
-int MEDFileMesh::getFamilyId(const char *name) const
+int MEDFileMesh::getFamilyId(const std::string& name) const
{
std::string oname(name);
std::map<std::string, int>::const_iterator it=_families.find(oname);
if(allIds->presenceOfValue(*it3))
{
std::string famName=getFamilyNameGivenId(*it3);
- std::vector<std::string> grps=getGroupsOnFamily(famName.c_str());
+ std::vector<std::string> grps=getGroupsOnFamily(famName);
ren[*it3]=maxId;
bool dummy;
std::string newFam=findOrCreateAndGiveFamilyWithId(maxId,dummy);
for(std::vector<std::string>::const_iterator it4=grps.begin();it4!=grps.end();it4++)
- addFamilyOnGrp((*it4).c_str(),newFam.c_str());
+ addFamilyOnGrp((*it4),newFam);
}
}
MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ids=fam->getIdsEqualList(&(*it2).second[0],&(*it2).second[0]+(*it2).second.size());
* \throw If the name of a nonexistent group is specified.
* \throw If the family field is missing for \a meshDimRelToMaxExt.
*/
-DataArrayInt *MEDFileMesh::getGroupArr(int meshDimRelToMaxExt, const char *grp, bool renum) const
+DataArrayInt *MEDFileMesh::getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum) const
{
std::vector<std::string> tmp(1);
tmp[0]=grp;
* is to delete this array using decrRef() as it is no more needed.
* \throw If the family field is missing for \a meshDimRelToMaxExt.
*/
-DataArrayInt *MEDFileMesh::getFamilyArr(int meshDimRelToMaxExt, const char *fam, bool renum) const
+DataArrayInt *MEDFileMesh::getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum) const
{
std::vector<std::string> tmp(1);
tmp[0]=fam;
* \throw If the name of a nonexistent group is specified.
* \throw If the family field is missing for nodes.
*/
-DataArrayInt *MEDFileMesh::getNodeGroupArr(const char *grp, bool renum) const
+DataArrayInt *MEDFileMesh::getNodeGroupArr(const std::string& grp, bool renum) const
{
std::vector<std::string> tmp(1);
tmp[0]=grp;
* \throw If the name of a nonexistent group is specified.
* \throw If the family field is missing for nodes.
*/
-DataArrayInt *MEDFileMesh::getNodeFamilyArr(const char *fam, bool renum) const
+DataArrayInt *MEDFileMesh::getNodeFamilyArr(const std::string& fam, bool renum) const
{
std::vector<std::string> tmp(1);
tmp[0]=fam;
for(unsigned int ii=0;ii<grps.size();ii++)
{
grps2[ii]=MEDFileUMeshSplitL1::Renumber(getRevNumberFieldAtLevel(meshDimRelToMaxExt),grps[ii]);
- grps2[ii]->setName(grps[ii]->getName().c_str());
+ grps2[ii]->setName(grps[ii]->getName());
}
std::vector<const DataArrayInt *> grps3(grps2.begin(),grps2.end());
fam=DataArrayInt::MakePartition(grps3,sz,fidsOfGroups);
{
oss << "- Family with name \"" << (*it).first << "\" with number " << (*it).second << std::endl;
oss << " - Groups lying on this family : ";
- std::vector<std::string> grps=getGroupsOnFamily((*it).first.c_str());
+ std::vector<std::string> grps=getGroupsOnFamily((*it).first);
std::copy(grps.begin(),grps.end(),std::ostream_iterator<std::string>(oss," "));
oss << std::endl << std::endl;
}
* \throw If there is no mesh with given attributes in the file.
* \throw If the mesh in the file is not an unstructured one.
*/
-MEDFileUMesh *MEDFileUMesh::New(const char *fileName, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs)
+MEDFileUMesh *MEDFileUMesh::New(const std::string& fileName, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs)
{
MEDFileUtilities::CheckFileForRead(fileName);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
return new MEDFileUMesh(fid,mName,dt,it,mrs);
}
* \throw If there is no meshes in the file.
* \throw If the mesh in the file is not an unstructured one.
*/
-MEDFileUMesh *MEDFileUMesh::New(const char *fileName, MEDFileMeshReadSelector *mrs)
+MEDFileUMesh *MEDFileUMesh::New(const std::string& fileName, MEDFileMeshReadSelector *mrs)
{
std::vector<std::string> ms=MEDLoader::GetMeshNames(fileName);
if(ms.empty())
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
MEDFileUtilities::CheckFileForRead(fileName);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
int dt,it;
ParaMEDMEM::MEDCouplingMeshType meshType;
std::string dummy2;
- MEDFileMeshL2::GetMeshIdFromName(fid,ms.front().c_str(),meshType,dt,it,dummy2);
- return new MEDFileUMesh(fid,ms.front().c_str(),dt,it,mrs);
+ MEDFileMeshL2::GetMeshIdFromName(fid,ms.front(),meshType,dt,it,dummy2);
+ return new MEDFileUMesh(fid,ms.front(),dt,it,mrs);
}
/*!
{
}
-MEDFileUMesh::MEDFileUMesh(med_idt fid, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs)
+MEDFileUMesh::MEDFileUMesh(med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs)
try
{
loadUMeshFromFile(fid,mName,dt,it,mrs);
throw e;
}
-void MEDFileUMesh::loadUMeshFromFile(med_idt fid, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs)
+void MEDFileUMesh::loadUMeshFromFile(med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs)
{
MEDFileUMeshL2 loaderl2;
ParaMEDMEM::MEDCouplingMeshType meshType;
}
MEDmeshCr(fid,maa,spaceDim,mdim,MED_UNSTRUCTURED_MESH,desc,"",MED_SORT_DTIT,MED_CARTESIAN,comp,unit);
MEDmeshUniversalNameWr(fid,maa);
- MEDFileUMeshL2::WriteCoords(fid,maa,_iteration,_order,_time,_coords,_fam_coords,_num_coords,_name_coords);
+ std::string meshName(MEDLoaderBase::buildStringFromFortran(maa,MED_NAME_SIZE));
+ MEDFileUMeshL2::WriteCoords(fid,meshName,_iteration,_order,_time,_coords,_fam_coords,_num_coords,_name_coords);
for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1> >::const_iterator it=_ms.begin();it!=_ms.end();it++)
if((const MEDFileUMeshSplitL1 *)(*it)!=0)
- (*it)->write(fid,maa,mdim);
- MEDFileUMeshL2::WriteFamiliesAndGrps(fid,maa,_families,_groups,_too_long_str);
+ (*it)->write(fid,meshName,mdim);
+ MEDFileUMeshL2::WriteFamiliesAndGrps(fid,meshName,_families,_groups,_too_long_str);
}
/*!
* \param [in] grp - the name of the group of interest.
* \return std::vector<int> - a sequence of the relative dimensions.
*/
-std::vector<int> MEDFileUMesh::getGrpNonEmptyLevels(const char *grp) const
+std::vector<int> MEDFileUMesh::getGrpNonEmptyLevels(const std::string& grp) const
{
std::vector<std::string> fams=getFamiliesOnGroup(grp);
return getFamsNonEmptyLevels(fams);
* \param [in] grp - the name of the group of interest.
* \return std::vector<int> - a sequence of the relative dimensions.
*/
-std::vector<int> MEDFileUMesh::getGrpNonEmptyLevelsExt(const char *grp) const
+std::vector<int> MEDFileUMesh::getGrpNonEmptyLevelsExt(const std::string& grp) const
{
std::vector<std::string> fams=getFamiliesOnGroup(grp);
return getFamsNonEmptyLevelsExt(fams);
* \param [in] fam - the name of the family of interest.
* \return std::vector<int> - a sequence of the relative dimensions.
*/
-std::vector<int> MEDFileUMesh::getFamNonEmptyLevels(const char *fam) const
+std::vector<int> MEDFileUMesh::getFamNonEmptyLevels(const std::string& fam) const
{
std::vector<std::string> fams(1,std::string(fam));
return getFamsNonEmptyLevels(fams);
* \param [in] fam - the name of the family of interest.
* \return std::vector<int> - a sequence of the relative dimensions.
*/
-std::vector<int> MEDFileUMesh::getFamNonEmptyLevelsExt(const char *fam) const
+std::vector<int> MEDFileUMesh::getFamNonEmptyLevelsExt(const std::string& fam) const
{
std::vector<std::string> fams(1,std::string(fam));
return getFamsNonEmptyLevelsExt(fams);
std::vector<std::string> allGrps=getGroupsNames();
for(std::vector<std::string>::const_iterator it=allGrps.begin();it!=allGrps.end();it++)
{
- std::vector<int> levs=getGrpNonEmptyLevelsExt((*it).c_str());
+ std::vector<int> levs=getGrpNonEmptyLevelsExt((*it));
if(std::find(levs.begin(),levs.end(),meshDimRelToMaxExt)!=levs.end())
ret.push_back(*it);
}
m->computeNodeIdsAlg(nodesFetched);
else
{
- const DataArrayInt *arr(globs->getProfile(st[i].getPflName().c_str()));
+ const DataArrayInt *arr(globs->getProfile(st[i].getPflName()));
MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh> m2(dynamic_cast<MEDCoupling1GTUMesh *>(m->buildPartOfMySelf(arr->begin(),arr->end(),true)));
m2->computeNodeIdsAlg(nodesFetched);
}
* \throw If the name of a nonexistent group is specified.
* \throw If there are no mesh entities of \a meshDimRelToMaxExt dimension in \a this mesh.
*/
-MEDCouplingUMesh *MEDFileUMesh::getGroup(int meshDimRelToMaxExt, const char *grp, bool renum) const
+MEDCouplingUMesh *MEDFileUMesh::getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum) const
{
synchronizeTinyInfoOnLeaves();
std::vector<std::string> tmp(1);
std::vector<std::string> fams2=getFamiliesOnGroups(grps);
MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> zeRet=getFamilies(meshDimRelToMaxExt,fams2,renum);
if(grps.size()==1 && ((MEDCouplingUMesh *)zeRet))
- zeRet->setName(grps[0].c_str());
+ zeRet->setName(grps[0]);
return zeRet.retn();
}
* \throw If a name of a nonexistent family is present in \a grps.
* \throw If there are no mesh entities of \a meshDimRelToMaxExt dimension in \a this mesh.
*/
-MEDCouplingUMesh *MEDFileUMesh::getFamily(int meshDimRelToMaxExt, const char *fam, bool renum) const
+MEDCouplingUMesh *MEDFileUMesh::getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum) const
{
synchronizeTinyInfoOnLeaves();
std::vector<std::string> tmp(1);
else
zeRet=l1->getFamilyPart(0,0,renum);
if(fams.size()==1 && ((MEDCouplingUMesh *)zeRet))
- zeRet->setName(fams[0].c_str());
+ zeRet->setName(fams[0]);
return zeRet.retn();
}
MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> cc=_coords->deepCpy();
umesh->setCoords(cc);
MEDFileUMeshSplitL1::ClearNonDiscrAttributes(umesh);
- umesh->setName(getName().c_str());
+ umesh->setName(getName());
return umesh;
}
}
_groups.erase(*it);
}
-void MEDFileUMesh::duplicateNodesOnM1Group(const char *grpNameM1, DataArrayInt *&nodesDuplicated, DataArrayInt *&cellsModified, DataArrayInt *&cellsNotModified)
+void MEDFileUMesh::duplicateNodesOnM1Group(const std::string& grpNameM1, DataArrayInt *&nodesDuplicated, DataArrayInt *&cellsModified, DataArrayInt *&cellsNotModified)
{
std::vector<int> levs=getNonEmptyLevels();
if(std::find(levs.begin(),levs.end(),0)==levs.end() || std::find(levs.begin(),levs.end(),-1)==levs.end())
MEDCouplingAutoRefCountObjectPtr<DataArrayInt> szOfCellGrpOfSameType(tmp00);
MEDCouplingAutoRefCountObjectPtr<DataArrayInt> idInMsOfCellGrpOfSameType(tmp11);
//
- newm1->setName(getName().c_str());
+ newm1->setName(getName());
const DataArrayInt *fam=getFamilyFieldAtLevel(-1);
if(!fam)
throw INTERP_KERNEL::Exception("MEDFileUMesh::duplicateNodesOnM1Group : internal problem !");
setMeshAtLevel(-1,newm1);
setFamilyFieldArr(-1,newFam);
std::string grpName2(grpNameM1); grpName2+="_dup";
- addFamily(grpName2.c_str(),idd);
- addFamilyOnGrp(grpName2.c_str(),grpName2.c_str());
+ addFamily(grpName2,idd);
+ addFamilyOnGrp(grpName2,grpName2);
//
fam=_fam_coords;
if(fam)
if(existsFamily(*famId))
{
std::string locFamName2=getFamilyNameGivenId(*famId); std::vector<std::string> v(2); v[0]=locFamName2; v[1]=locFamName;
- ChangeAllGroupsContainingFamily(groups,getFamilyNameGivenId(*famId).c_str(),v);
+ ChangeAllGroupsContainingFamily(groups,getFamilyNameGivenId(*famId),v);
}
maxVal++;
} // modifying all other groups on *famId to lie on maxVal and lie the grp on maxVal
if(existsFamily(*famId))
{
std::string n1(FindOrCreateAndGiveFamilyWithId(families,isNodeGroup?maxVal:-maxVal,created)); std::vector<std::string> v(2); v[0]=n1; v[1]=n2;
- ChangeAllGroupsContainingFamily(groups,getFamilyNameGivenId(*famId).c_str(),v);
+ ChangeAllGroupsContainingFamily(groups,getFamilyNameGivenId(*famId),v);
}
maxVal+=2;
}
for(std::vector<const MEDCouplingUMesh *>::const_iterator it=ms.begin();it!=ms.end();it++)
{
int mdim=(*it)->getMeshDimension();
- setName((*it)->getName().c_str());
+ setName((*it)->getName());
setMeshAtLevel(mdim-zeDim,const_cast<MEDCouplingUMesh *>(*it),renum);
}
- setName(name.c_str());
+ setName(name);
}
/*!
std::fill(nodesFetched.begin(),nodesFetched.end(),true);
return ;
}
- const DataArrayInt *arr(globs->getProfile(st[0].getPflName().c_str()));
+ const DataArrayInt *arr(globs->getProfile(st[0].getPflName()));
const MEDCouplingStructuredMesh *cmesh=getStructuredMesh();//cmesh not null because getNumberOfNodes called before
int sz(nodesFetched.size());
for(const int *work=arr->begin();work!=arr->end();work++)
return geoTypeReq;
}
-void MEDFileStructuredMesh::loadStrMeshFromFile(MEDFileStrMeshL2 *strm, med_idt fid, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs)
+void MEDFileStructuredMesh::loadStrMeshFromFile(MEDFileStrMeshL2 *strm, med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs)
{
setName(strm->getName());
setDescription(strm->getDescription());
setTimeUnit(strm->getTimeUnit());
MEDFileMeshL2::ReadFamiliesAndGrps(fid,mName,_families,_groups,mrs);
med_bool chgt=MED_FALSE,trsf=MED_FALSE;
- int nbOfElt=MEDmeshnEntity(fid,mName,dt,it,MED_NODE,MED_NONE,MED_FAMILY_NUMBER,MED_NODAL,&chgt,&trsf);
+ int nbOfElt=MEDmeshnEntity(fid,mName.c_str(),dt,it,MED_NODE,MED_NONE,MED_FAMILY_NUMBER,MED_NODAL,&chgt,&trsf);
if(nbOfElt>0)
{
if(!mrs || mrs->isNodeFamilyFieldReading())
{
_fam_nodes=DataArrayInt::New();
_fam_nodes->alloc(nbOfElt,1);
- MEDmeshEntityFamilyNumberRd(fid,mName,dt,it,MED_NODE,MED_NONE,_fam_nodes->getPointer());
+ MEDmeshEntityFamilyNumberRd(fid,mName.c_str(),dt,it,MED_NODE,MED_NONE,_fam_nodes->getPointer());
}
}
- nbOfElt=MEDmeshnEntity(fid,mName,dt,it,MED_NODE,MED_NONE,MED_NUMBER,MED_NODAL,&chgt,&trsf);
+ nbOfElt=MEDmeshnEntity(fid,mName.c_str(),dt,it,MED_NODE,MED_NONE,MED_NUMBER,MED_NODAL,&chgt,&trsf);
if(nbOfElt>0)
{
if(!mrs || mrs->isNodeNumFieldReading())
{
_num_nodes=DataArrayInt::New();
_num_nodes->alloc(nbOfElt,1);
- MEDmeshEntityNumberRd(fid,mName,dt,it,MED_NODE,MED_NONE,_num_nodes->getPointer());
+ MEDmeshEntityNumberRd(fid,mName.c_str(),dt,it,MED_NODE,MED_NONE,_num_nodes->getPointer());
}
}
int meshDim=getStructuredMesh()->getMeshDimension();
med_geometry_type geoTypeReq=GetGeoTypeFromMeshDim(meshDim);
- nbOfElt=MEDmeshnEntity(fid,mName,dt,it,MED_CELL,geoTypeReq,MED_FAMILY_NUMBER,MED_NODAL,&chgt,&trsf);
+ nbOfElt=MEDmeshnEntity(fid,mName.c_str(),dt,it,MED_CELL,geoTypeReq,MED_FAMILY_NUMBER,MED_NODAL,&chgt,&trsf);
if(nbOfElt>0)
{
if(!mrs || mrs->isCellFamilyFieldReading())
{
_fam_cells=DataArrayInt::New();
_fam_cells->alloc(nbOfElt,1);
- MEDmeshEntityFamilyNumberRd(fid,mName,dt,it,MED_CELL,geoTypeReq,_fam_cells->getPointer());
+ MEDmeshEntityFamilyNumberRd(fid,mName.c_str(),dt,it,MED_CELL,geoTypeReq,_fam_cells->getPointer());
}
}
- nbOfElt=MEDmeshnEntity(fid,mName,dt,it,MED_CELL,geoTypeReq,MED_NUMBER,MED_NODAL,&chgt,&trsf);
+ nbOfElt=MEDmeshnEntity(fid,mName.c_str(),dt,it,MED_CELL,geoTypeReq,MED_NUMBER,MED_NODAL,&chgt,&trsf);
if(nbOfElt>0)
{
if(!mrs || mrs->isCellNumFieldReading())
{
_num_cells=DataArrayInt::New();
_num_cells->alloc(nbOfElt,1);
- MEDmeshEntityNumberRd(fid,mName,dt,it,MED_CELL,geoTypeReq,_num_cells->getPointer());
+ MEDmeshEntityNumberRd(fid,mName.c_str(),dt,it,MED_CELL,geoTypeReq,_num_cells->getPointer());
}
}
- nbOfElt=MEDmeshnEntity(fid,mName,dt,it,MED_CELL,geoTypeReq,MED_NAME,MED_NODAL,&chgt,&trsf);
+ nbOfElt=MEDmeshnEntity(fid,mName.c_str(),dt,it,MED_CELL,geoTypeReq,MED_NAME,MED_NODAL,&chgt,&trsf);
if(nbOfElt>0)
{
if(!mrs || mrs->isCellNameFieldReading())
{
_names_cells=DataArrayAsciiChar::New();
_names_cells->alloc(nbOfElt+1,MED_SNAME_SIZE);//not a bug to avoid the memory corruption due to last \0 at the end
- MEDmeshEntityNameRd(fid,mName,dt,it,MED_CELL,geoTypeReq,_names_cells->getPointer());
+ MEDmeshEntityNameRd(fid,mName.c_str(),dt,it,MED_CELL,geoTypeReq,_names_cells->getPointer());
_names_cells->reAlloc(nbOfElt);//not a bug to avoid the memory corruption due to last \0 at the end
}
}
- nbOfElt=MEDmeshnEntity(fid,mName,dt,it,MED_NODE,MED_NONE,MED_NAME,MED_NODAL,&chgt,&trsf);
+ nbOfElt=MEDmeshnEntity(fid,mName.c_str(),dt,it,MED_NODE,MED_NONE,MED_NAME,MED_NODAL,&chgt,&trsf);
if(nbOfElt>0)
{
if(!mrs || mrs->isNodeNameFieldReading())
{
_names_nodes=DataArrayAsciiChar::New();
_names_nodes->alloc(nbOfElt+1,MED_SNAME_SIZE);//not a bug to avoid the memory corruption due to last \0 at the end
- MEDmeshEntityNameRd(fid,mName,dt,it,MED_NODE,MED_NONE,_names_nodes->getPointer());
+ MEDmeshEntityNameRd(fid,mName.c_str(),dt,it,MED_NODE,MED_NONE,_names_nodes->getPointer());
_names_nodes->reAlloc(nbOfElt);//not a bug to avoid the memory corruption due to last \0 at the end
}
}
}
-void MEDFileStructuredMesh::writeStructuredLL(med_idt fid, const char *maa) const
+void MEDFileStructuredMesh::writeStructuredLL(med_idt fid, const std::string& maa) const
{
int meshDim=getStructuredMesh()->getMeshDimension();
med_geometry_type geoTypeReq=GetGeoTypeFromMeshDim(meshDim);
//
if((const DataArrayInt *)_fam_cells)
- MEDmeshEntityFamilyNumberWr(fid,maa,_iteration,_order,MED_CELL,geoTypeReq,_fam_cells->getNumberOfTuples(),_fam_cells->getConstPointer());
+ MEDmeshEntityFamilyNumberWr(fid,maa.c_str(),_iteration,_order,MED_CELL,geoTypeReq,_fam_cells->getNumberOfTuples(),_fam_cells->getConstPointer());
if((const DataArrayInt *)_fam_nodes)
- MEDmeshEntityFamilyNumberWr(fid,maa,_iteration,_order,MED_NODE,MED_NONE,_fam_nodes->getNumberOfTuples(),_fam_nodes->getConstPointer());
+ MEDmeshEntityFamilyNumberWr(fid,maa.c_str(),_iteration,_order,MED_NODE,MED_NONE,_fam_nodes->getNumberOfTuples(),_fam_nodes->getConstPointer());
if((const DataArrayInt *)_num_cells)
- MEDmeshEntityNumberWr(fid,maa,_iteration,_order,MED_CELL,geoTypeReq,_num_cells->getNumberOfTuples(),_num_cells->getConstPointer());
+ MEDmeshEntityNumberWr(fid,maa.c_str(),_iteration,_order,MED_CELL,geoTypeReq,_num_cells->getNumberOfTuples(),_num_cells->getConstPointer());
if((const DataArrayInt *)_num_nodes)
- MEDmeshEntityNumberWr(fid,maa,_iteration,_order,MED_NODE,MED_NONE,_num_nodes->getNumberOfTuples(),_num_nodes->getConstPointer());
+ MEDmeshEntityNumberWr(fid,maa.c_str(),_iteration,_order,MED_NODE,MED_NONE,_num_nodes->getNumberOfTuples(),_num_nodes->getConstPointer());
if((const DataArrayAsciiChar *)_names_cells)
{
if(_names_cells->getNumberOfComponents()!=MED_SNAME_SIZE)
oss << " ! The array has " << _names_cells->getNumberOfComponents() << " components !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
- MEDmeshEntityNameWr(fid,maa,_iteration,_order,MED_CELL,geoTypeReq,_names_cells->getNumberOfTuples(),_names_cells->getConstPointer());
+ MEDmeshEntityNameWr(fid,maa.c_str(),_iteration,_order,MED_CELL,geoTypeReq,_names_cells->getNumberOfTuples(),_names_cells->getConstPointer());
}
if((const DataArrayAsciiChar *)_names_nodes)
{
oss << " ! The array has " << _names_cells->getNumberOfComponents() << " components !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
- MEDmeshEntityNameWr(fid,maa,_iteration,_order,MED_NODE,MED_NONE,_names_nodes->getNumberOfTuples(),_names_nodes->getConstPointer());
+ MEDmeshEntityNameWr(fid,maa.c_str(),_iteration,_order,MED_NODE,MED_NONE,_names_nodes->getNumberOfTuples(),_names_nodes->getConstPointer());
}
//
- MEDFileUMeshL2::WriteFamiliesAndGrps(fid,maa,_families,_groups,_too_long_str);
+ MEDFileUMeshL2::WriteFamiliesAndGrps(fid,maa.c_str(),_families,_groups,_too_long_str);
}
/*!
* \throw If there is no meshes in the file.
* \throw If the mesh in the file is not a Cartesian one.
*/
-MEDFileCMesh *MEDFileCMesh::New(const char *fileName, MEDFileMeshReadSelector *mrs)
+MEDFileCMesh *MEDFileCMesh::New(const std::string& fileName, MEDFileMeshReadSelector *mrs)
{
std::vector<std::string> ms=MEDLoader::GetMeshNames(fileName);
if(ms.empty())
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
MEDFileUtilities::CheckFileForRead(fileName);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
int dt,it;
ParaMEDMEM::MEDCouplingMeshType meshType;
std::string dummy2;
- MEDFileMeshL2::GetMeshIdFromName(fid,ms.front().c_str(),meshType,dt,it,dummy2);
- return new MEDFileCMesh(fid,ms.front().c_str(),dt,it,mrs);
+ MEDFileMeshL2::GetMeshIdFromName(fid,ms.front(),meshType,dt,it,dummy2);
+ return new MEDFileCMesh(fid,ms.front(),dt,it,mrs);
}
/*!
* \throw If there is no mesh with given attributes in the file.
* \throw If the mesh in the file is not a Cartesian one.
*/
-MEDFileCMesh *MEDFileCMesh::New(const char *fileName, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs)
+MEDFileCMesh *MEDFileCMesh::New(const std::string& fileName, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs)
{
MEDFileUtilities::CheckFileForRead(fileName);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
return new MEDFileCMesh(fid,mName,dt,it,mrs);
}
{
}
-MEDFileCMesh::MEDFileCMesh(med_idt fid, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs)
+MEDFileCMesh::MEDFileCMesh(med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs)
try
{
loadCMeshFromFile(fid,mName,dt,it,mrs);
throw e;
}
-void MEDFileCMesh::loadCMeshFromFile(med_idt fid, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs)
+void MEDFileCMesh::loadCMeshFromFile(med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs)
{
ParaMEDMEM::MEDCouplingMeshType meshType;
int dummy0,dummy1;
MEDmeshGridIndexCoordinateWr(fid,maa,_iteration,_order,_time,i+1,da->getNumberOfTuples(),da->getConstPointer());
}
//
- MEDFileStructuredMesh::writeStructuredLL(fid,maa);
+ std::string meshName(MEDLoaderBase::buildStringFromFortran(maa,MED_NAME_SIZE));
+ MEDFileStructuredMesh::writeStructuredLL(fid,meshName);
}
void MEDFileCMesh::synchronizeTinyInfoOnLeaves() const
const MEDCouplingCMesh *cmesh=_cmesh;
if(!cmesh)
return;
- (const_cast<MEDCouplingCMesh *>(cmesh))->setName(_name.c_str());
- (const_cast<MEDCouplingCMesh *>(cmesh))->setDescription(_desc_name.c_str());
+ (const_cast<MEDCouplingCMesh *>(cmesh))->setName(_name);
+ (const_cast<MEDCouplingCMesh *>(cmesh))->setDescription(_desc_name);
(const_cast<MEDCouplingCMesh *>(cmesh))->setTime(_time,_iteration,_order);
- (const_cast<MEDCouplingCMesh *>(cmesh))->setTimeUnit(_dt_unit.c_str());
+ (const_cast<MEDCouplingCMesh *>(cmesh))->setTimeUnit(_dt_unit);
}
MEDFileCurveLinearMesh *MEDFileCurveLinearMesh::New()
return new MEDFileCurveLinearMesh;
}
-MEDFileCurveLinearMesh *MEDFileCurveLinearMesh::New(const char *fileName, MEDFileMeshReadSelector *mrs)
+MEDFileCurveLinearMesh *MEDFileCurveLinearMesh::New(const std::string& fileName, MEDFileMeshReadSelector *mrs)
{
std::vector<std::string> ms=MEDLoader::GetMeshNames(fileName);
if(ms.empty())
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
MEDFileUtilities::CheckFileForRead(fileName);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
int dt,it;
ParaMEDMEM::MEDCouplingMeshType meshType;
std::string dummy2;
- MEDFileMeshL2::GetMeshIdFromName(fid,ms.front().c_str(),meshType,dt,it,dummy2);
- return new MEDFileCurveLinearMesh(fid,ms.front().c_str(),dt,it,mrs);
+ MEDFileMeshL2::GetMeshIdFromName(fid,ms.front(),meshType,dt,it,dummy2);
+ return new MEDFileCurveLinearMesh(fid,ms.front(),dt,it,mrs);
}
-MEDFileCurveLinearMesh *MEDFileCurveLinearMesh::New(const char *fileName, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs)
+MEDFileCurveLinearMesh *MEDFileCurveLinearMesh::New(const std::string& fileName, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs)
{
MEDFileUtilities::CheckFileForRead(fileName);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
return new MEDFileCurveLinearMesh(fid,mName,dt,it,mrs);
}
const MEDCouplingCurveLinearMesh *clmesh=_clmesh;
if(!clmesh)
return;
- (const_cast<MEDCouplingCurveLinearMesh *>(clmesh))->setName(_name.c_str());
- (const_cast<MEDCouplingCurveLinearMesh *>(clmesh))->setDescription(_desc_name.c_str());
+ (const_cast<MEDCouplingCurveLinearMesh *>(clmesh))->setName(_name);
+ (const_cast<MEDCouplingCurveLinearMesh *>(clmesh))->setDescription(_desc_name);
(const_cast<MEDCouplingCurveLinearMesh *>(clmesh))->setTime(_time,_iteration,_order);
- (const_cast<MEDCouplingCurveLinearMesh *>(clmesh))->setTimeUnit(_dt_unit.c_str());
+ (const_cast<MEDCouplingCurveLinearMesh *>(clmesh))->setTimeUnit(_dt_unit);
}
const MEDCouplingCurveLinearMesh *MEDFileCurveLinearMesh::getMesh() const
{
}
-MEDFileCurveLinearMesh::MEDFileCurveLinearMesh(med_idt fid, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs)
+MEDFileCurveLinearMesh::MEDFileCurveLinearMesh(med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs)
try
{
loadCLMeshFromFile(fid,mName,dt,it,mrs);
MEDmeshNodeCoordinateWr(fid,maa,_iteration,_order,_time,MED_FULL_INTERLACE,coords->getNumberOfTuples(),coords->begin());
//
- MEDFileStructuredMesh::writeStructuredLL(fid,maa);
+ std::string meshName(MEDLoaderBase::buildStringFromFortran(maa,MED_NAME_SIZE));
+ MEDFileStructuredMesh::writeStructuredLL(fid,meshName);
}
-void MEDFileCurveLinearMesh::loadCLMeshFromFile(med_idt fid, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs)
+void MEDFileCurveLinearMesh::loadCLMeshFromFile(med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs)
{
ParaMEDMEM::MEDCouplingMeshType meshType;
int dummy0,dummy1;
return new MEDFileMeshMultiTS;
}
-MEDFileMeshMultiTS *MEDFileMeshMultiTS::New(const char *fileName)
+MEDFileMeshMultiTS *MEDFileMeshMultiTS::New(const std::string& fileName)
{
return new MEDFileMeshMultiTS(fileName);
}
-MEDFileMeshMultiTS *MEDFileMeshMultiTS::New(const char *fileName, const char *mName)
+MEDFileMeshMultiTS *MEDFileMeshMultiTS::New(const std::string& fileName, const std::string& mName)
{
return new MEDFileMeshMultiTS(fileName,mName);
}
return _mesh_one_ts[0]->getName();
}
-void MEDFileMeshMultiTS::setName(const char *newMeshName)
+void MEDFileMeshMultiTS::setName(const std::string& newMeshName)
{
std::string oldName(getName());
std::vector< std::pair<std::string,std::string> > v(1);
}
}
-void MEDFileMeshMultiTS::write(const char *fileName, int mode) const
+void MEDFileMeshMultiTS::write(const std::string& fileName, int mode) const
{
med_access_mode medmod=MEDFileUtilities::TraduceWriteMode(mode);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,medmod);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),medmod);
std::ostringstream oss; oss << "MEDFileMesh : error on attempt to write in file : \"" << fileName << "\"";
- MEDFileUtilities::CheckMEDCode(fid,fid,oss.str().c_str());
+ MEDFileUtilities::CheckMEDCode(fid,fid,oss.str());
write(fid);
}
-void MEDFileMeshMultiTS::loadFromFile(const char *fileName, const char *mName)
+void MEDFileMeshMultiTS::loadFromFile(const std::string& fileName, const std::string& mName)
{//for the moment to be improved
_mesh_one_ts.resize(1);
_mesh_one_ts[0]=MEDFileMesh::New(fileName,mName,-1,-1);
{
}
-MEDFileMeshMultiTS::MEDFileMeshMultiTS(const char *fileName)
+MEDFileMeshMultiTS::MEDFileMeshMultiTS(const std::string& fileName)
try
{
std::vector<std::string> ms=MEDLoader::GetMeshNames(fileName);
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
MEDFileUtilities::CheckFileForRead(fileName);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
int dt,it;
ParaMEDMEM::MEDCouplingMeshType meshType;
std::string dummy2;
- MEDFileMeshL2::GetMeshIdFromName(fid,ms.front().c_str(),meshType,dt,it,dummy2);
- loadFromFile(fileName,ms.front().c_str());
+ MEDFileMeshL2::GetMeshIdFromName(fid,ms.front(),meshType,dt,it,dummy2);
+ loadFromFile(fileName,ms.front());
}
catch(INTERP_KERNEL::Exception& e)
{
throw e;
}
-MEDFileMeshMultiTS::MEDFileMeshMultiTS(const char *fileName, const char *mName)
+MEDFileMeshMultiTS::MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName)
try
{
loadFromFile(fileName,mName);
return new MEDFileMeshes;
}
-MEDFileMeshes *MEDFileMeshes::New(const char *fileName)
+MEDFileMeshes *MEDFileMeshes::New(const std::string& fileName)
{
return new MEDFileMeshes(fileName);
}
}
}
-void MEDFileMeshes::write(const char *fileName, int mode) const
+void MEDFileMeshes::write(const std::string& fileName, int mode) const
{
med_access_mode medmod=MEDFileUtilities::TraduceWriteMode(mode);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,medmod);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),medmod);
std::ostringstream oss; oss << "MEDFileMesh : error on attempt to write in file : \"" << fileName << "\"";
- MEDFileUtilities::CheckMEDCode(fid,fid,oss.str().c_str());
+ MEDFileUtilities::CheckMEDCode(fid,fid,oss.str());
checkCoherency();
write(fid);
}
return _meshes[i]->getOneTimeStep();
}
-MEDFileMesh *MEDFileMeshes::getMeshWithName(const char *mname) const
+MEDFileMesh *MEDFileMeshes::getMeshWithName(const std::string& mname) const
{
std::vector<std::string> ms=getMeshesNames();
std::vector<std::string>::iterator it=std::find(ms.begin(),ms.end(),mname);
_meshes.erase(_meshes.begin()+i);
}
-void MEDFileMeshes::loadFromFile(const char *fileName)
+void MEDFileMeshes::loadFromFile(const std::string& fileName)
{
std::vector<std::string> ms=MEDLoader::GetMeshNames(fileName);
int i=0;
_meshes.resize(ms.size());
for(std::vector<std::string>::const_iterator it=ms.begin();it!=ms.end();it++,i++)
- _meshes[i]=MEDFileMeshMultiTS::New(fileName,(*it).c_str());
+ _meshes[i]=MEDFileMeshMultiTS::New(fileName,(*it));
}
MEDFileMeshes::MEDFileMeshes()
{
}
-MEDFileMeshes::MEDFileMeshes(const char *fileName)
+MEDFileMeshes::MEDFileMeshes(const std::string& fileName)
try
{
loadFromFile(fileName);
class MEDFileMesh : public RefCountObject, public MEDFileWritable
{
public:
- MEDLOADER_EXPORT static MEDFileMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0);
- MEDLOADER_EXPORT static MEDFileMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
+ MEDLOADER_EXPORT static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
+ MEDLOADER_EXPORT static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
MEDLOADER_EXPORT virtual MEDFileMesh *createNewEmpty() const = 0;
MEDLOADER_EXPORT virtual MEDFileMesh *shallowCpy() const = 0;
MEDLOADER_EXPORT virtual bool isEqual(const MEDFileMesh *other, double eps, std::string& what) const;
MEDLOADER_EXPORT virtual void clearNonDiscrAttributes() const;
- MEDLOADER_EXPORT void setName(const char *name) { _name=name; }
+ MEDLOADER_EXPORT void setName(const std::string& name) { _name=name; }
MEDLOADER_EXPORT bool changeNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
MEDLOADER_EXPORT std::string getName() const { return _name; }
- MEDLOADER_EXPORT const char *getUnivName() const { return _univ_name.c_str(); }
+ MEDLOADER_EXPORT std::string getUnivName() const { return _univ_name; }
MEDLOADER_EXPORT bool getUnivNameWrStatus() const { return _univ_wr_status; }
MEDLOADER_EXPORT void setUnivNameWrStatus(bool newStatus) { _univ_wr_status=newStatus; }
- MEDLOADER_EXPORT void setDescription(const char *name) { _desc_name=name; }
+ MEDLOADER_EXPORT void setDescription(const std::string& name) { _desc_name=name; }
MEDLOADER_EXPORT std::string getDescription() const { return _desc_name; }
MEDLOADER_EXPORT void setOrder(int order) { _order=order; }
MEDLOADER_EXPORT int getOrder() const { return _order; }
MEDLOADER_EXPORT void setTime(int dt, int it, double time) { _time=time; _iteration=dt; _order=it; }
MEDLOADER_EXPORT double getTime(int& dt, int& it) { dt=_iteration; it=_order; return _time; }
MEDLOADER_EXPORT double getTimeValue() const { return _time; }
- MEDLOADER_EXPORT void setTimeUnit(const char *unit) { _dt_unit=unit; }
- MEDLOADER_EXPORT const char *getTimeUnit() const { return _dt_unit.c_str(); }
+ MEDLOADER_EXPORT void setTimeUnit(const std::string& unit) { _dt_unit=unit; }
+ MEDLOADER_EXPORT std::string getTimeUnit() const { return _dt_unit; }
MEDLOADER_EXPORT virtual int getNumberOfNodes() const = 0;
MEDLOADER_EXPORT virtual std::vector<int> getNonEmptyLevels() const = 0;
MEDLOADER_EXPORT virtual std::vector<int> getNonEmptyLevelsExt() const = 0;
MEDLOADER_EXPORT virtual std::vector<int> getFamArrNonEmptyLevelsExt() const = 0;
MEDLOADER_EXPORT virtual std::vector<int> getNumArrNonEmptyLevelsExt() const = 0;
MEDLOADER_EXPORT virtual std::vector<int> getNameArrNonEmptyLevelsExt() const = 0;
- MEDLOADER_EXPORT virtual void write(const char *fileName, int mode) const;
+ MEDLOADER_EXPORT virtual void write(const std::string& fileName, int mode) const;
MEDLOADER_EXPORT virtual void write(med_idt fid) const;
MEDLOADER_EXPORT virtual int getSizeAtLevel(int meshDimRelToMaxExt) const = 0;
MEDLOADER_EXPORT virtual MEDCouplingMesh *getGenMeshAtLevel(int meshDimRelToMax, bool renum=false) const = 0;
//
MEDLOADER_EXPORT bool areFamsEqual(const MEDFileMesh *other, std::string& what) const;
MEDLOADER_EXPORT bool areGrpsEqual(const MEDFileMesh *other, std::string& what) const;
- MEDLOADER_EXPORT bool existsGroup(const char *groupName) const;
+ MEDLOADER_EXPORT bool existsGroup(const std::string& groupName) const;
MEDLOADER_EXPORT bool existsFamily(int famId) const;
- MEDLOADER_EXPORT bool existsFamily(const char *familyName) const;
- MEDLOADER_EXPORT void setFamilyId(const char *familyName, int id);
- MEDLOADER_EXPORT void setFamilyIdUnique(const char *familyName, int id);
- MEDLOADER_EXPORT virtual void addFamily(const char *familyName, int id);
- MEDLOADER_EXPORT virtual void createGroupOnAll(int meshDimRelToMaxExt, const char *groupName);
+ MEDLOADER_EXPORT bool existsFamily(const std::string& familyName) const;
+ MEDLOADER_EXPORT void setFamilyId(const std::string& familyName, int id);
+ MEDLOADER_EXPORT void setFamilyIdUnique(const std::string& familyName, int id);
+ MEDLOADER_EXPORT virtual void addFamily(const std::string& familyName, int id);
+ MEDLOADER_EXPORT virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName);
MEDLOADER_EXPORT virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs);
- MEDLOADER_EXPORT void addFamilyOnGrp(const char *grpName, const char *famName);
+ MEDLOADER_EXPORT void addFamilyOnGrp(const std::string& grpName, const std::string& famName);
MEDLOADER_EXPORT std::string findOrCreateAndGiveFamilyWithId(int id, bool& created);
MEDLOADER_EXPORT void setFamilyInfo(const std::map<std::string,int>& info);
MEDLOADER_EXPORT void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
MEDLOADER_EXPORT void clearFamGrpMaps();
MEDLOADER_EXPORT const std::map<std::string,int>& getFamilyInfo() const { return _families; }
MEDLOADER_EXPORT const std::map<std::string, std::vector<std::string> >& getGroupInfo() const { return _groups; }
- MEDLOADER_EXPORT std::vector<std::string> getFamiliesOnGroup(const char *name) const;
+ MEDLOADER_EXPORT std::vector<std::string> getFamiliesOnGroup(const std::string& name) const;
MEDLOADER_EXPORT std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const;
- MEDLOADER_EXPORT std::vector<int> getFamiliesIdsOnGroup(const char *name) const;
- MEDLOADER_EXPORT void setFamiliesOnGroup(const char *name, const std::vector<std::string>& fams);
- MEDLOADER_EXPORT void setFamiliesIdsOnGroup(const char *name, const std::vector<int>& famIds);
- MEDLOADER_EXPORT std::vector<std::string> getGroupsOnFamily(const char *name) const;
- MEDLOADER_EXPORT void setGroupsOnFamily(const char *famName, const std::vector<std::string>& grps);
+ MEDLOADER_EXPORT std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const;
+ MEDLOADER_EXPORT void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams);
+ MEDLOADER_EXPORT void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds);
+ MEDLOADER_EXPORT std::vector<std::string> getGroupsOnFamily(const std::string& name) const;
+ MEDLOADER_EXPORT void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps);
MEDLOADER_EXPORT std::vector<std::string> getGroupsNames() const;
MEDLOADER_EXPORT std::vector<std::string> getFamiliesNames() const;
MEDLOADER_EXPORT void assignFamilyNameWithGroupName();
MEDLOADER_EXPORT std::vector<std::string> removeEmptyGroups();
- MEDLOADER_EXPORT void removeGroup(const char *name);
- MEDLOADER_EXPORT void removeFamily(const char *name);
+ MEDLOADER_EXPORT void removeGroup(const std::string& name);
+ MEDLOADER_EXPORT void removeFamily(const std::string& name);
MEDLOADER_EXPORT std::vector<std::string> removeOrphanGroups();
MEDLOADER_EXPORT std::vector<std::string> removeOrphanFamilies();
- MEDLOADER_EXPORT void changeGroupName(const char *oldName, const char *newName);
- MEDLOADER_EXPORT void changeFamilyName(const char *oldName, const char *newName);
+ MEDLOADER_EXPORT void changeGroupName(const std::string& oldName, const std::string& newName);
+ MEDLOADER_EXPORT void changeFamilyName(const std::string& oldName, const std::string& newName);
MEDLOADER_EXPORT void changeFamilyId(int oldId, int newId);
- MEDLOADER_EXPORT void changeAllGroupsContainingFamily(const char *familyNameToChange, const std::vector<std::string>& newFamiliesNames);
- MEDLOADER_EXPORT int getFamilyId(const char *name) const;
+ MEDLOADER_EXPORT void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames);
+ MEDLOADER_EXPORT int getFamilyId(const std::string& name) const;
MEDLOADER_EXPORT int getMaxAbsFamilyId() const;
MEDLOADER_EXPORT int getMaxFamilyId() const;
MEDLOADER_EXPORT int getMinFamilyId() const;
MEDLOADER_EXPORT virtual const DataArrayAsciiChar *getNameFieldAtLevel(int meshDimRelToMaxExt) const = 0;
MEDLOADER_EXPORT virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const = 0;
MEDLOADER_EXPORT virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const;
- MEDLOADER_EXPORT virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const char *grp, bool renum=false) const;
- MEDLOADER_EXPORT virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const char *fam, bool renum=false) const;
- MEDLOADER_EXPORT virtual DataArrayInt *getNodeGroupArr(const char *grp, bool renum=false) const;
+ MEDLOADER_EXPORT virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const;
+ MEDLOADER_EXPORT virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const;
+ MEDLOADER_EXPORT virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const;
MEDLOADER_EXPORT virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const;
- MEDLOADER_EXPORT virtual DataArrayInt *getNodeFamilyArr(const char *fam, bool renum=false) const;
+ MEDLOADER_EXPORT virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const;
MEDLOADER_EXPORT virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const;
// tools
MEDLOADER_EXPORT virtual bool unPolyze(std::vector<int>& oldCode, std::vector<int>& newCode, DataArrayInt *& o2nRenumCell) = 0;
protected:
MEDFileMesh();
//! protected because no way in MED file API to specify this name
- void setUnivName(const char *name) { _univ_name=name; }
- void addFamilyOnAllGroupsHaving(const char *famName, const char *otherFamName);
+ void setUnivName(const std::string& name) { _univ_name=name; }
+ void addFamilyOnAllGroupsHaving(const std::string& famName, const std::string& otherFamName);
virtual void writeLL(med_idt fid) const = 0;
void dealWithTinyInfo(const MEDCouplingMesh *m);
virtual void synchronizeTinyInfoOnLeaves() const = 0;
virtual void appendFamilyEntries(const DataArrayInt *famIds, const std::vector< std::vector<int> >& fidsOfGrps, const std::vector<std::string>& grpNames);
virtual void changeFamilyIdArr(int oldId, int newId) = 0;
static void TranslateFamilyIds(int offset, DataArrayInt *famArr, std::vector< std::vector<int> >& famIdsPerGrp);
- static void ChangeAllGroupsContainingFamily(std::map<std::string, std::vector<std::string> >& groups, const char *familyNameToChange, const std::vector<std::string>& newFamiliesNames);
+ static void ChangeAllGroupsContainingFamily(std::map<std::string, std::vector<std::string> >& groups, const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames);
static std::string FindOrCreateAndGiveFamilyWithId(std::map<std::string,int>& families, int id, bool& created);
static std::string CreateNameNotIn(const std::string& nameTry, const std::vector<std::string>& namesToAvoid);
static int PutInThirdComponentOfCodeOffset(std::vector<int>& code, int strt);
{
friend class MEDFileMesh;
public:
- MEDLOADER_EXPORT static MEDFileUMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
- MEDLOADER_EXPORT static MEDFileUMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0);
+ MEDLOADER_EXPORT static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
+ MEDLOADER_EXPORT static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
MEDLOADER_EXPORT static MEDFileUMesh *New();
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
MEDLOADER_EXPORT std::vector<int> getFamArrNonEmptyLevelsExt() const;
MEDLOADER_EXPORT std::vector<int> getNumArrNonEmptyLevelsExt() const;
MEDLOADER_EXPORT std::vector<int> getNameArrNonEmptyLevelsExt() const;
- MEDLOADER_EXPORT std::vector<int> getGrpNonEmptyLevels(const char *grp) const;
- MEDLOADER_EXPORT std::vector<int> getGrpNonEmptyLevelsExt(const char *grp) const;
- MEDLOADER_EXPORT std::vector<int> getFamNonEmptyLevels(const char *fam) const;
- MEDLOADER_EXPORT std::vector<int> getFamNonEmptyLevelsExt(const char *fam) const;
+ MEDLOADER_EXPORT std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const;
+ MEDLOADER_EXPORT std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const;
+ MEDLOADER_EXPORT std::vector<int> getFamNonEmptyLevels(const std::string& fam) const;
+ MEDLOADER_EXPORT std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const;
MEDLOADER_EXPORT std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const;
MEDLOADER_EXPORT std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const;
MEDLOADER_EXPORT std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const;
MEDLOADER_EXPORT std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const;
MEDLOADER_EXPORT std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const;
MEDLOADER_EXPORT DataArrayDouble *getCoords() const;
- MEDLOADER_EXPORT MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const char *grp, bool renum=false) const;
+ MEDLOADER_EXPORT MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const;
MEDLOADER_EXPORT MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const;
- MEDLOADER_EXPORT MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const char *fam, bool renum=false) const;
+ MEDLOADER_EXPORT MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const;
MEDLOADER_EXPORT MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const;
MEDLOADER_EXPORT DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const;
MEDLOADER_EXPORT MEDCouplingUMesh *getMeshAtLevel(int meshDimRelToMaxExt, bool renum=false) const;
MEDLOADER_EXPORT void setGroupsOnSetMesh(int meshDimRelToMax, const std::vector<const MEDCouplingUMesh *>& ms, bool renum=false);
MEDLOADER_EXPORT void optimizeFamilies();
// tools
- MEDLOADER_EXPORT void duplicateNodesOnM1Group(const char *grpNameM1, DataArrayInt *&nodesDuplicated, DataArrayInt *&cellsModified, DataArrayInt *&cellsNotModified);
+ MEDLOADER_EXPORT void duplicateNodesOnM1Group(const std::string& grpNameM1, DataArrayInt *&nodesDuplicated, DataArrayInt *&cellsModified, DataArrayInt *&cellsNotModified);
MEDLOADER_EXPORT bool unPolyze(std::vector<int>& oldCode, std::vector<int>& newCode, DataArrayInt *& o2nRenumCell);
MEDLOADER_EXPORT DataArrayInt *zipCoords();
private:
void writeLL(med_idt fid) const;
MEDFileUMesh();
- MEDFileUMesh(med_idt fid, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs);
- void loadUMeshFromFile(med_idt fid, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs);
+ MEDFileUMesh(med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs);
+ void loadUMeshFromFile(med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs);
const MEDFileUMeshSplitL1 *getMeshAtLevSafe(int meshDimRelToMaxExt) const;
MEDFileUMeshSplitL1 *getMeshAtLevSafe(int meshDimRelToMaxExt);
void checkMeshDimCoherency(int meshDim, int meshDimRelToMax) const;
protected:
void changeFamilyIdArr(int oldId, int newId);
void deepCpyAttributes();
- void loadStrMeshFromFile(MEDFileStrMeshL2 *strm, med_idt fid, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs);
- void writeStructuredLL(med_idt fid, const char *maa) const;
+ void loadStrMeshFromFile(MEDFileStrMeshL2 *strm, med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs);
+ void writeStructuredLL(med_idt fid, const std::string& maa) const;
virtual const MEDCouplingStructuredMesh *getStructuredMesh() const = 0;
static med_geometry_type GetGeoTypeFromMeshDim(int meshDim);
private:
friend class MEDFileMesh;
public:
MEDLOADER_EXPORT static MEDFileCMesh *New();
- MEDLOADER_EXPORT static MEDFileCMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0);
- MEDLOADER_EXPORT static MEDFileCMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
+ MEDLOADER_EXPORT static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
+ MEDLOADER_EXPORT static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
MEDLOADER_EXPORT MEDFileMesh *createNewEmpty() const;
void writeLL(med_idt fid) const;
MEDFileCMesh();
void synchronizeTinyInfoOnLeaves() const;
- MEDFileCMesh(med_idt fid, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs);
- void loadCMeshFromFile(med_idt fid, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs);
+ MEDFileCMesh(med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs);
+ void loadCMeshFromFile(med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs);
private:
MEDCouplingAutoRefCountObjectPtr<MEDCouplingCMesh> _cmesh;
};
friend class MEDFileMesh;
public:
MEDLOADER_EXPORT static MEDFileCurveLinearMesh *New();
- MEDLOADER_EXPORT static MEDFileCurveLinearMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0);
- MEDLOADER_EXPORT static MEDFileCurveLinearMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
+ MEDLOADER_EXPORT static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
+ MEDLOADER_EXPORT static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
MEDLOADER_EXPORT MEDFileMesh *createNewEmpty() const;
MEDLOADER_EXPORT void setMesh(MEDCouplingCurveLinearMesh *m);
private:
MEDFileCurveLinearMesh();
- MEDFileCurveLinearMesh(med_idt fid, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs);
+ MEDFileCurveLinearMesh(med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs);
const MEDCouplingStructuredMesh *getStructuredMesh() const;
void synchronizeTinyInfoOnLeaves() const;
void writeLL(med_idt fid) const;
- void loadCLMeshFromFile(med_idt fid, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs);//to imp
+ void loadCLMeshFromFile(med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs);//to imp
private:
MEDCouplingAutoRefCountObjectPtr<MEDCouplingCurveLinearMesh> _clmesh;
};
{
public:
MEDLOADER_EXPORT static MEDFileMeshMultiTS *New();
- MEDLOADER_EXPORT static MEDFileMeshMultiTS *New(const char *fileName);
- MEDLOADER_EXPORT static MEDFileMeshMultiTS *New(const char *fileName, const char *mName);
+ MEDLOADER_EXPORT static MEDFileMeshMultiTS *New(const std::string& fileName);
+ MEDLOADER_EXPORT static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName);
MEDLOADER_EXPORT MEDFileMeshMultiTS *deepCpy() const;
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
MEDLOADER_EXPORT std::string getName() const;
- MEDLOADER_EXPORT void setName(const char *newMeshName);
+ MEDLOADER_EXPORT void setName(const std::string& newMeshName);
MEDLOADER_EXPORT bool changeNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
MEDLOADER_EXPORT MEDFileMesh *getOneTimeStep() const;
MEDLOADER_EXPORT void write(med_idt fid) const;
- MEDLOADER_EXPORT void write(const char *fileName, int mode) const;
+ MEDLOADER_EXPORT void write(const std::string& fileName, int mode) const;
MEDLOADER_EXPORT void setOneTimeStep(MEDFileMesh *mesh1TimeStep);
private:
- void loadFromFile(const char *fileName, const char *mName);
+ void loadFromFile(const std::string& fileName, const std::string& mName);
MEDFileMeshMultiTS();
- MEDFileMeshMultiTS(const char *fileName);
- MEDFileMeshMultiTS(const char *fileName, const char *mName);
+ MEDFileMeshMultiTS(const std::string& fileName);
+ MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName);
private:
std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> > _mesh_one_ts;
};
{
public:
MEDLOADER_EXPORT static MEDFileMeshes *New();
- MEDLOADER_EXPORT static MEDFileMeshes *New(const char *fileName);
+ MEDLOADER_EXPORT static MEDFileMeshes *New(const std::string& fileName);
MEDLOADER_EXPORT MEDFileMeshes *deepCpy() const;
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
MEDLOADER_EXPORT std::string simpleRepr() const;
MEDLOADER_EXPORT void simpleReprWithoutHeader(std::ostream& oss) const;
- MEDLOADER_EXPORT void write(const char *fileName, int mode) const;
+ MEDLOADER_EXPORT void write(const std::string& fileName, int mode) const;
MEDLOADER_EXPORT void write(med_idt fid) const;
MEDLOADER_EXPORT int getNumberOfMeshes() const;
MEDLOADER_EXPORT MEDFileMeshesIterator *iterator();
MEDLOADER_EXPORT MEDFileMesh *getMeshAtPos(int i) const;
- MEDLOADER_EXPORT MEDFileMesh *getMeshWithName(const char *mname) const;
+ MEDLOADER_EXPORT MEDFileMesh *getMeshWithName(const std::string& mname) const;
MEDLOADER_EXPORT std::vector<std::string> getMeshesNames() const;
MEDLOADER_EXPORT bool changeNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
//
MEDLOADER_EXPORT void destroyMeshAtPos(int i);
private:
void checkCoherency() const;
- void loadFromFile(const char *fileName);
+ void loadFromFile(const std::string& fileName);
MEDFileMeshes();
- MEDFileMeshes(const char *fileName);
+ MEDFileMeshes(const std::string& fileName);
private:
std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileMeshMultiTS> > _meshes;
};
loadCommonPart(fid,mName,dt,it,mdim,curNbOfElem,MED_POLYHEDRON,entity,mrs);
}
-void MEDFileUMeshPerType::Write(med_idt fid, const char *mname, int mdim, const MEDCoupling1GTUMesh *m, const DataArrayInt *fam, const DataArrayInt *num, const DataArrayAsciiChar *names)
+void MEDFileUMeshPerType::Write(med_idt fid, const std::string& mname, int mdim, const MEDCoupling1GTUMesh *m, const DataArrayInt *fam, const DataArrayInt *num, const DataArrayAsciiChar *names)
{
int nbOfCells=m->getNumberOfCells();
if(nbOfCells<1)
throw INTERP_KERNEL::Exception("MEDFileUMeshPerType::Write : internal error #1 !");
MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arr(m0->getNodalConnectivity()->deepCpy());
std::transform(arr->begin(),arr->end(),arr->getPointer(),std::bind2nd(std::plus<int>(),1));
- MEDmeshElementConnectivityWr(fid,mname,dt,it,timm,MED_CELL,curMedType,MED_NODAL,MED_FULL_INTERLACE,nbOfCells,arr->begin());
+ MEDmeshElementConnectivityWr(fid,mname.c_str(),dt,it,timm,MED_CELL,curMedType,MED_NODAL,MED_FULL_INTERLACE,nbOfCells,arr->begin());
}
else
{
MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arr(m0->getNodalConnectivity()->deepCpy()),arrI(m0->getNodalConnectivityIndex()->deepCpy());
std::transform(arr->begin(),arr->end(),arr->getPointer(),std::bind2nd(std::plus<int>(),1));
std::transform(arrI->begin(),arrI->end(),arrI->getPointer(),std::bind2nd(std::plus<int>(),1));
- MEDmeshPolygon2Wr(fid,mname,dt,it,timm,MED_CELL,ikt==INTERP_KERNEL::NORM_POLYGON?MED_POLYGON:MED_POLYGON2,MED_NODAL,nbOfCells+1,arrI->begin(),arr->begin());
+ MEDmeshPolygon2Wr(fid,mname.c_str(),dt,it,timm,MED_CELL,ikt==INTERP_KERNEL::NORM_POLYGON?MED_POLYGON:MED_POLYGON2,MED_NODAL,nbOfCells+1,arrI->begin(),arr->begin());
}
else
{
}
w1[1]=w1[0]+nbOfFaces2;
}
- MEDmeshPolyhedronWr(fid,mname,dt,it,timm,MED_CELL,MED_NODAL,nbOfCells+1,tab1,nbOfFaces+1,tab2,bigtab);
+ MEDmeshPolyhedronWr(fid,mname.c_str(),dt,it,timm,MED_CELL,MED_NODAL,nbOfCells+1,tab1,nbOfFaces+1,tab2,bigtab);
}
}
if(fam)
- MEDmeshEntityFamilyNumberWr(fid,mname,dt,it,MED_CELL,curMedType,nbOfCells,fam->getConstPointer());
+ MEDmeshEntityFamilyNumberWr(fid,mname.c_str(),dt,it,MED_CELL,curMedType,nbOfCells,fam->getConstPointer());
if(num)
- MEDmeshEntityNumberWr(fid,mname,dt,it,MED_CELL,curMedType,nbOfCells,num->getConstPointer());
+ MEDmeshEntityNumberWr(fid,mname.c_str(),dt,it,MED_CELL,curMedType,nbOfCells,num->getConstPointer());
if(names)
{
if(names->getNumberOfComponents()!=MED_SNAME_SIZE)
oss << " ! The array has " << names->getNumberOfComponents() << " components !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
- MEDmeshEntityNameWr(fid,mname,dt,it,MED_CELL,curMedType,nbOfCells,names->getConstPointer());
+ MEDmeshEntityNameWr(fid,mname.c_str(),dt,it,MED_CELL,curMedType,nbOfCells,names->getConstPointer());
}
}
const DataArrayInt *getFam() const { return _fam; }
const DataArrayInt *getNum() const { return _num; }
const DataArrayAsciiChar *getNames() const { return _names; }
- static void Write(med_idt fid, const char *mname, int mdim, const MEDCoupling1GTUMesh *m, const DataArrayInt *fam, const DataArrayInt *num, const DataArrayAsciiChar *names);
+ static void Write(med_idt fid, const std::string& mname, int mdim, const MEDCoupling1GTUMesh *m, const DataArrayInt *fam, const DataArrayInt *num, const DataArrayAsciiChar *names);
private:
MEDFileUMeshPerType(med_idt fid, const char *mName, int dt, int it, int mdim, med_geometry_type geoElt, INTERP_KERNEL::NormalizedCellType type,
med_entity_type entity, MEDFileMeshReadSelector *mrs);
return std::vector<const BigMemoryObject *>();
}
-int MEDFileMeshL2::GetMeshIdFromName(med_idt fid, const char *mname, ParaMEDMEM::MEDCouplingMeshType& meshType, int& dt, int& it, std::string& dtunit1)
+int MEDFileMeshL2::GetMeshIdFromName(med_idt fid, const std::string& mname, ParaMEDMEM::MEDCouplingMeshType& meshType, int& dt, int& it, std::string& dtunit1)
{
med_mesh_type type_maillage;
char maillage_description[MED_COMMENT_SIZE+1];
case MED_STRUCTURED_MESH:
{
med_grid_type gt;
- MEDmeshGridTypeRd(fid,mname,>);
+ MEDmeshGridTypeRd(fid,mname.c_str(),>);
switch(gt)
{
case MED_CARTESIAN_GRID:
}
med_int numdt,numit;
med_float dtt;
- MEDmeshComputationStepInfo(fid,mname,1,&numdt,&numit,&dtt);
+ MEDmeshComputationStepInfo(fid,mname.c_str(),1,&numdt,&numit,&dtt);
dt=numdt; it=numit;
return ret;
}
-double MEDFileMeshL2::CheckMeshTimeStep(med_idt fid, const char *mName, int nstep, int dt, int it)
+double MEDFileMeshL2::CheckMeshTimeStep(med_idt fid, const std::string& mName, int nstep, int dt, int it)
{
bool found=false;
med_int numdt,numit;
std::vector< std::pair<int,int> > p(nstep);
for(int i=0;i<nstep;i++)
{
- MEDmeshComputationStepInfo(fid,mName,i+1,&numdt,&numit,&dtt);
+ MEDmeshComputationStepInfo(fid,mName.c_str(),i+1,&numdt,&numit,&dtt);
p[i]=std::make_pair<int,int>(numdt,numit);
found=(numdt==dt) && (numit==numit);
}
return dtt;
}
-std::vector<std::string> MEDFileMeshL2::getAxisInfoOnMesh(med_idt fid, int mId, const char *mName, ParaMEDMEM::MEDCouplingMeshType& meshType, int& nstep, int& Mdim)
+std::vector<std::string> MEDFileMeshL2::getAxisInfoOnMesh(med_idt fid, int mId, const std::string& mName, ParaMEDMEM::MEDCouplingMeshType& meshType, int& nstep, int& Mdim)
{
med_mesh_type type_maillage;
med_int spaceDim;
case MED_STRUCTURED_MESH:
{
med_grid_type gt;
- MEDmeshGridTypeRd(fid,mName,>);
+ MEDmeshGridTypeRd(fid,mName.c_str(),>);
switch(gt)
{
case MED_CARTESIAN_GRID:
return infosOnComp;
}
-void MEDFileMeshL2::ReadFamiliesAndGrps(med_idt fid, const char *meshName, std::map<std::string,int>& fams, std::map<std::string, std::vector<std::string> >& grps, MEDFileMeshReadSelector *mrs)
+void MEDFileMeshL2::ReadFamiliesAndGrps(med_idt fid, const std::string& meshName, std::map<std::string,int>& fams, std::map<std::string, std::vector<std::string> >& grps, MEDFileMeshReadSelector *mrs)
{
if(mrs && !(mrs->isCellFamilyFieldReading() || mrs->isNodeFamilyFieldReading()))
return ;
char nomfam[MED_NAME_SIZE+1];
med_int numfam;
- int nfam=MEDnFamily(fid,meshName);
+ int nfam=MEDnFamily(fid,meshName.c_str());
for(int i=0;i<nfam;i++)
{
- int ngro=MEDnFamilyGroup(fid,meshName,i+1);
- med_int natt=MEDnFamily23Attribute(fid,meshName,i+1);
+ int ngro=MEDnFamilyGroup(fid,meshName.c_str(),i+1);
+ med_int natt=MEDnFamily23Attribute(fid,meshName.c_str(),i+1);
INTERP_KERNEL::AutoPtr<med_int> attide=new med_int[natt];
INTERP_KERNEL::AutoPtr<med_int> attval=new med_int[natt];
INTERP_KERNEL::AutoPtr<char> attdes=new char[MED_COMMENT_SIZE*natt+1];
INTERP_KERNEL::AutoPtr<char> gro=new char[MED_LNAME_SIZE*ngro+1];
- MEDfamily23Info(fid,meshName,i+1,nomfam,attide,attval,attdes,&numfam,gro);
+ MEDfamily23Info(fid,meshName.c_str(),i+1,nomfam,attide,attval,attdes,&numfam,gro);
std::string famName=MEDLoaderBase::buildStringFromFortran(nomfam,MED_NAME_SIZE);
fams[famName]=numfam;
for(int j=0;j<ngro;j++)
}
}
-void MEDFileMeshL2::WriteFamiliesAndGrps(med_idt fid, const char *mname, const std::map<std::string,int>& fams, const std::map<std::string, std::vector<std::string> >& grps, int tooLongStrPol)
+void MEDFileMeshL2::WriteFamiliesAndGrps(med_idt fid, const std::string& mname, const std::map<std::string,int>& fams, const std::map<std::string, std::vector<std::string> >& grps, int tooLongStrPol)
{
for(std::map<std::string,int>::const_iterator it=fams.begin();it!=fams.end();it++)
{
MEDLoaderBase::safeStrCpy2((*it2).c_str(),MED_LNAME_SIZE-1,groName+i*MED_LNAME_SIZE,tooLongStrPol);
INTERP_KERNEL::AutoPtr<char> famName=MEDLoaderBase::buildEmptyString(MED_NAME_SIZE);
MEDLoaderBase::safeStrCpy((*it).first.c_str(),MED_NAME_SIZE,famName,tooLongStrPol);
- int ret=MEDfamilyCr(fid,mname,famName,(*it).second,ngro,groName);
+ int ret=MEDfamilyCr(fid,mname.c_str(),famName,(*it).second,ngro,groName);
ret++;
}
}
{
}
-void MEDFileUMeshL2::loadAll(med_idt fid, int mId, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs)
+void MEDFileUMeshL2::loadAll(med_idt fid, int mId, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs)
{
- _name.set(mName);
+ _name.set(mName.c_str());
int nstep;
int Mdim;
ParaMEDMEM::MEDCouplingMeshType meshType;
- std::vector<std::string> infosOnComp=getAxisInfoOnMesh(fid,mId,mName,meshType,nstep,Mdim);
+ std::vector<std::string> infosOnComp=getAxisInfoOnMesh(fid,mId,mName.c_str(),meshType,nstep,Mdim);
if(meshType!=UNSTRUCTURED)
throw INTERP_KERNEL::Exception("Invalid mesh type ! You are expected an unstructured one whereas in file it is not an unstructured !");
_time=CheckMeshTimeStep(fid,mName,nstep,dt,it);
loadCoords(fid,mId,infosOnComp,mName,dt,it);
}
-void MEDFileUMeshL2::loadConnectivity(med_idt fid, int mdim, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs)
+void MEDFileUMeshL2::loadConnectivity(med_idt fid, int mdim, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs)
{
_per_type_mesh.resize(1);
_per_type_mesh[0].clear();
for(int j=0;j<MED_N_CELL_FIXED_GEO;j++)
{
- MEDFileUMeshPerType *tmp=MEDFileUMeshPerType::New(fid,mName,dt,it,mdim,typmai[j],typmai2[j],mrs);
+ MEDFileUMeshPerType *tmp=MEDFileUMeshPerType::New(fid,mName.c_str(),dt,it,mdim,typmai[j],typmai2[j],mrs);
if(tmp)
_per_type_mesh[0].push_back(tmp);
}
sortTypes();
}
-void MEDFileUMeshL2::loadCoords(med_idt fid, int mId, const std::vector<std::string>& infosOnComp, const char *mName, int dt, int it)
+void MEDFileUMeshL2::loadCoords(med_idt fid, int mId, const std::vector<std::string>& infosOnComp, const std::string& mName, int dt, int it)
{
int spaceDim=infosOnComp.size();
med_bool changement,transformation;
- int nCoords=MEDmeshnEntity(fid,mName,dt,it,MED_NODE,MED_NONE,MED_COORDINATE,MED_NO_CMODE,&changement,&transformation);
+ int nCoords=MEDmeshnEntity(fid,mName.c_str(),dt,it,MED_NODE,MED_NONE,MED_COORDINATE,MED_NO_CMODE,&changement,&transformation);
_coords=DataArrayDouble::New();
_coords->alloc(nCoords,spaceDim);
double *coordsPtr=_coords->getPointer();
- MEDmeshNodeCoordinateRd(fid,mName,dt,it,MED_FULL_INTERLACE,coordsPtr);
- if(MEDmeshnEntity(fid,mName,dt,it,MED_NODE,MED_NO_GEOTYPE,MED_FAMILY_NUMBER,MED_NODAL,&changement,&transformation)>0)
+ MEDmeshNodeCoordinateRd(fid,mName.c_str(),dt,it,MED_FULL_INTERLACE,coordsPtr);
+ if(MEDmeshnEntity(fid,mName.c_str(),dt,it,MED_NODE,MED_NO_GEOTYPE,MED_FAMILY_NUMBER,MED_NODAL,&changement,&transformation)>0)
{
_fam_coords=DataArrayInt::New();
_fam_coords->alloc(nCoords,1);
- MEDmeshEntityFamilyNumberRd(fid,mName,dt,it,MED_NODE,MED_NO_GEOTYPE,_fam_coords->getPointer());
+ MEDmeshEntityFamilyNumberRd(fid,mName.c_str(),dt,it,MED_NODE,MED_NO_GEOTYPE,_fam_coords->getPointer());
}
else
_fam_coords=0;
- if(MEDmeshnEntity(fid,mName,dt,it,MED_NODE,MED_NO_GEOTYPE,MED_NUMBER,MED_NODAL,&changement,&transformation)>0)
+ if(MEDmeshnEntity(fid,mName.c_str(),dt,it,MED_NODE,MED_NO_GEOTYPE,MED_NUMBER,MED_NODAL,&changement,&transformation)>0)
{
_num_coords=DataArrayInt::New();
_num_coords->alloc(nCoords,1);
- MEDmeshEntityNumberRd(fid,mName,dt,it,MED_NODE,MED_NO_GEOTYPE,_num_coords->getPointer());
+ MEDmeshEntityNumberRd(fid,mName.c_str(),dt,it,MED_NODE,MED_NO_GEOTYPE,_num_coords->getPointer());
}
else
_num_coords=0;
- if(MEDmeshnEntity(fid,mName,dt,it,MED_NODE,MED_NO_GEOTYPE,MED_NAME,MED_NODAL,&changement,&transformation)>0)
+ if(MEDmeshnEntity(fid,mName.c_str(),dt,it,MED_NODE,MED_NO_GEOTYPE,MED_NAME,MED_NODAL,&changement,&transformation)>0)
{
_name_coords=DataArrayAsciiChar::New();
_name_coords->alloc(nCoords+1,MED_SNAME_SIZE);//not a bug to avoid the memory corruption due to last \0 at the end
- MEDmeshEntityNameRd(fid,mName,dt,it,MED_NODE,MED_NO_GEOTYPE,_name_coords->getPointer());
+ MEDmeshEntityNameRd(fid,mName.c_str(),dt,it,MED_NODE,MED_NO_GEOTYPE,_name_coords->getPointer());
_name_coords->reAlloc(nCoords);//not a bug to avoid the memory corruption due to last \0 at the end
}
else
_name_coords=0;
for(int i=0;i<spaceDim;i++)
- _coords->setInfoOnComponent(i,infosOnComp[i].c_str());
+ _coords->setInfoOnComponent(i,infosOnComp[i]);
}
void MEDFileUMeshL2::sortTypes()
_per_type_mesh.resize(_per_type_mesh.size()-nbOfUselessLev);
}
-void MEDFileUMeshL2::WriteCoords(med_idt fid, const char *mname, int dt, int it, double time, const DataArrayDouble *coords, const DataArrayInt *famCoords, const DataArrayInt *numCoords, const DataArrayAsciiChar *nameCoords)
+void MEDFileUMeshL2::WriteCoords(med_idt fid, const std::string& mname, int dt, int it, double time, const DataArrayDouble *coords, const DataArrayInt *famCoords, const DataArrayInt *numCoords, const DataArrayAsciiChar *nameCoords)
{
if(!coords)
return ;
- MEDmeshNodeCoordinateWr(fid,mname,dt,it,time,MED_FULL_INTERLACE,coords->getNumberOfTuples(),coords->getConstPointer());
+ MEDmeshNodeCoordinateWr(fid,mname.c_str(),dt,it,time,MED_FULL_INTERLACE,coords->getNumberOfTuples(),coords->getConstPointer());
if(famCoords)
- MEDmeshEntityFamilyNumberWr(fid,mname,dt,it,MED_NODE,MED_NO_GEOTYPE,famCoords->getNumberOfTuples(),famCoords->getConstPointer());
+ MEDmeshEntityFamilyNumberWr(fid,mname.c_str(),dt,it,MED_NODE,MED_NO_GEOTYPE,famCoords->getNumberOfTuples(),famCoords->getConstPointer());
if(numCoords)
- MEDmeshEntityNumberWr(fid,mname,dt,it,MED_NODE,MED_NO_GEOTYPE,numCoords->getNumberOfTuples(),numCoords->getConstPointer());
+ MEDmeshEntityNumberWr(fid,mname.c_str(),dt,it,MED_NODE,MED_NO_GEOTYPE,numCoords->getNumberOfTuples(),numCoords->getConstPointer());
if(nameCoords)
{
if(nameCoords->getNumberOfComponents()!=MED_SNAME_SIZE)
oss << " ! The array has " << nameCoords->getNumberOfComponents() << " components !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
- MEDmeshEntityNameWr(fid,mname,dt,it,MED_NODE,MED_NO_GEOTYPE,nameCoords->getNumberOfTuples(),nameCoords->getConstPointer());
+ MEDmeshEntityNameWr(fid,mname.c_str(),dt,it,MED_NODE,MED_NO_GEOTYPE,nameCoords->getNumberOfTuples(),nameCoords->getConstPointer());
}
}
{
}
-void MEDFileCMeshL2::loadAll(med_idt fid, int mId, const char *mName, int dt, int it)
+void MEDFileCMeshL2::loadAll(med_idt fid, int mId, const std::string& mName, int dt, int it)
{
- _name.set(mName);
+ _name.set(mName.c_str());
int nstep;
int Mdim;
ParaMEDMEM::MEDCouplingMeshType meshType;
- std::vector<std::string> infosOnComp=getAxisInfoOnMesh(fid,mId,mName,meshType,nstep,Mdim);
+ std::vector<std::string> infosOnComp=getAxisInfoOnMesh(fid,mId,mName.c_str(),meshType,nstep,Mdim);
if(meshType!=CARTESIAN)
throw INTERP_KERNEL::Exception("Invalid mesh type ! You are expected a structured one whereas in file it is not a structured !");
_time=CheckMeshTimeStep(fid,mName,nstep,dt,it);
_order=it;
//
med_grid_type gridtype;
- MEDmeshGridTypeRd(fid,mName,&gridtype);
+ MEDmeshGridTypeRd(fid,mName.c_str(),&gridtype);
if(gridtype!=MED_CARTESIAN_GRID)
throw INTERP_KERNEL::Exception("Invalid structured mesh ! Expected cartesian mesh type !");
_cmesh=MEDCouplingCMesh::New();
{
med_data_type dataTypeReq=GetDataTypeCorrespondingToSpaceId(i);
med_bool chgt=MED_FALSE,trsf=MED_FALSE;
- int nbOfElt=MEDmeshnEntity(fid,mName,dt,it,MED_NODE,MED_NONE,dataTypeReq,MED_NO_CMODE,&chgt,&trsf);
+ int nbOfElt=MEDmeshnEntity(fid,mName.c_str(),dt,it,MED_NODE,MED_NONE,dataTypeReq,MED_NO_CMODE,&chgt,&trsf);
MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> da=DataArrayDouble::New();
da->alloc(nbOfElt,1);
- da->setInfoOnComponent(0,infosOnComp[i].c_str());
- MEDmeshGridIndexCoordinateRd(fid,mName,dt,it,i+1,da->getPointer());
+ da->setInfoOnComponent(0,infosOnComp[i]);
+ MEDmeshGridIndexCoordinateRd(fid,mName.c_str(),dt,it,i+1,da->getPointer());
_cmesh->setCoordsAt(i,da);
}
}
{
}
-void MEDFileCLMeshL2::loadAll(med_idt fid, int mId, const char *mName, int dt, int it)
+void MEDFileCLMeshL2::loadAll(med_idt fid, int mId, const std::string& mName, int dt, int it)
{
- _name.set(mName);
+ _name.set(mName.c_str());
int nstep;
int Mdim;
ParaMEDMEM::MEDCouplingMeshType meshType;
//
_clmesh=MEDCouplingCurveLinearMesh::New();
INTERP_KERNEL::AutoPtr<int> stGrid=new int[Mdim];
- MEDmeshGridStructRd(fid,mName,dt,it,stGrid);
+ MEDmeshGridStructRd(fid,mName.c_str(),dt,it,stGrid);
_clmesh->setNodeGridStructure(stGrid,((int *)stGrid)+Mdim);
med_bool chgt=MED_FALSE,trsf=MED_FALSE;
- int nbNodes=MEDmeshnEntity(fid,mName,dt,it,MED_NODE,MED_NONE,MED_COORDINATE,MED_NO_CMODE,&chgt,&trsf);
+ int nbNodes=MEDmeshnEntity(fid,mName.c_str(),dt,it,MED_NODE,MED_NONE,MED_COORDINATE,MED_NO_CMODE,&chgt,&trsf);
MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> da=DataArrayDouble::New();
da->alloc(nbNodes,infosOnComp.size());
da->setInfoOnComponents(infosOnComp);
- MEDmeshNodeCoordinateRd(fid,mName,dt,it,MED_FULL_INTERLACE,da->getPointer());
+ MEDmeshNodeCoordinateRd(fid,mName.c_str(),dt,it,MED_FULL_INTERLACE,da->getPointer());
_clmesh->setCoords(da);
}
{
}
-MEDFileUMeshSplitL1::MEDFileUMeshSplitL1(const MEDFileUMeshL2& l2, const char *mName, int id):_m(this)
+MEDFileUMeshSplitL1::MEDFileUMeshSplitL1(const MEDFileUMeshL2& l2, const std::string& mName, int id):_m(this)
{
const std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshPerType> >& v=l2.getLev(id);
if(v.empty())
*w=famIdTrad[*w];
}
-void MEDFileUMeshSplitL1::write(med_idt fid, const char *mName, int mdim) const
+void MEDFileUMeshSplitL1::write(med_idt fid, const std::string& mName, int mdim) const
{
std::vector<MEDCoupling1GTUMesh *> ms(_m_by_types.getParts());
int start=0;
int getIteration() const { return _iteration; }
int getOrder() const { return _order; }
double getTime() { return _time; }
- std::vector<std::string> getAxisInfoOnMesh(med_idt fid, int mId, const char *mName, ParaMEDMEM::MEDCouplingMeshType& meshType, int& nstep, int& Mdim);
- static int GetMeshIdFromName(med_idt fid, const char *mName, ParaMEDMEM::MEDCouplingMeshType& meshType, int& dt, int& it, std::string& dtunit1);
- static double CheckMeshTimeStep(med_idt fid, const char *mname, int nstep, int dt, int it);
- static void ReadFamiliesAndGrps(med_idt fid, const char *mname, std::map<std::string,int>& fams, std::map<std::string, std::vector<std::string> >& grps, MEDFileMeshReadSelector *mrs);
- static void WriteFamiliesAndGrps(med_idt fid, const char *mname, const std::map<std::string,int>& fams, const std::map<std::string, std::vector<std::string> >& grps, int tooLongStrPol);
+ std::vector<std::string> getAxisInfoOnMesh(med_idt fid, int mId, const std::string& mName, ParaMEDMEM::MEDCouplingMeshType& meshType, int& nstep, int& Mdim);
+ static int GetMeshIdFromName(med_idt fid, const std::string& mName, ParaMEDMEM::MEDCouplingMeshType& meshType, int& dt, int& it, std::string& dtunit1);
+ static double CheckMeshTimeStep(med_idt fid, const std::string& mname, int nstep, int dt, int it);
+ static void ReadFamiliesAndGrps(med_idt fid, const std::string& mname, std::map<std::string,int>& fams, std::map<std::string, std::vector<std::string> >& grps, MEDFileMeshReadSelector *mrs);
+ static void WriteFamiliesAndGrps(med_idt fid, const std::string& mname, const std::map<std::string,int>& fams, const std::map<std::string, std::vector<std::string> >& grps, int tooLongStrPol);
protected:
MEDFileString _name;
MEDFileString _description;
{
public:
MEDFileUMeshL2();
- void loadAll(med_idt fid, int mId, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs);
- void loadConnectivity(med_idt fid, int mdim, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs);
- void loadCoords(med_idt fid, int mId, const std::vector<std::string>& infosOnComp, const char *mName, int dt, int it);
+ void loadAll(med_idt fid, int mId, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs);
+ void loadConnectivity(med_idt fid, int mdim, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs);
+ void loadCoords(med_idt fid, int mId, const std::vector<std::string>& infosOnComp, const std::string& mName, int dt, int it);
int getNumberOfLevels() const { return _per_type_mesh.size(); }
bool emptyLev(int levId) const { return _per_type_mesh[levId].empty(); }
const std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshPerType> >& getLev(int levId) const { return _per_type_mesh[levId]; }
MEDCouplingAutoRefCountObjectPtr<DataArrayInt> getCoordsFamily() const { return _fam_coords; }
MEDCouplingAutoRefCountObjectPtr<DataArrayInt> getCoordsNum() const { return _num_coords; }
MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> getCoordsName() const { return _name_coords; }
- static void WriteCoords(med_idt fid, const char *mname, int dt, int it, double time, const DataArrayDouble *coords, const DataArrayInt *famCoords, const DataArrayInt *numCoords, const DataArrayAsciiChar *nameCoords);
+ static void WriteCoords(med_idt fid, const std::string& mname, int dt, int it, double time, const DataArrayDouble *coords, const DataArrayInt *famCoords, const DataArrayInt *numCoords, const DataArrayAsciiChar *nameCoords);
private:
void sortTypes();
private:
{
public:
MEDFileCMeshL2();
- void loadAll(med_idt fid, int mId, const char *mName, int dt, int it);
+ void loadAll(med_idt fid, int mId, const std::string& mName, int dt, int it);
MEDCouplingCMesh *getMesh() { return _cmesh; }
private:
static med_data_type GetDataTypeCorrespondingToSpaceId(int id);
{
public:
MEDFileCLMeshL2();
- void loadAll(med_idt fid, int mId, const char *mName, int dt, int it);
+ void loadAll(med_idt fid, int mId, const std::string& mName, int dt, int it);
MEDCouplingCurveLinearMesh *getMesh() { return _clmesh; }
private:
MEDCouplingAutoRefCountObjectPtr<MEDCouplingCurveLinearMesh> _clmesh;
friend class MEDFileUMeshPermCompute;
public:
MEDFileUMeshSplitL1(const MEDFileUMeshSplitL1& other);
- MEDFileUMeshSplitL1(const MEDFileUMeshL2& l2, const char *mName, int id);
+ MEDFileUMeshSplitL1(const MEDFileUMeshL2& l2, const std::string& mName, int id);
MEDFileUMeshSplitL1(MEDCoupling1GTUMesh *m);
MEDFileUMeshSplitL1(MEDCouplingUMesh *m);
MEDFileUMeshSplitL1(MEDCouplingUMesh *m, bool newOrOld);
void eraseFamilyField();
void setGroupsFromScratch(const std::vector<const MEDCouplingUMesh *>& ms, std::map<std::string,int>& familyIds,
std::map<std::string, std::vector<std::string> >& groups) throw(INTERP_KERNEL::Exception);
- void write(med_idt fid, const char *mName, int mdim) const;
+ void write(med_idt fid, const std::string& mName, int mdim) const;
//
void setFamilyArr(DataArrayInt *famArr);
void setRenumArr(DataArrayInt *renumArr);
return new MEDFileParameterDouble1TS;
}
-MEDFileParameterDouble1TS *MEDFileParameterDouble1TS::New(const char *fileName)
+MEDFileParameterDouble1TS *MEDFileParameterDouble1TS::New(const std::string& fileName)
{
return new MEDFileParameterDouble1TS(fileName);
}
-MEDFileParameterDouble1TS *MEDFileParameterDouble1TS::New(const char *fileName, const char *paramName)
+MEDFileParameterDouble1TS *MEDFileParameterDouble1TS::New(const std::string& fileName, const std::string& paramName)
{
return new MEDFileParameterDouble1TS(fileName,paramName);
}
-MEDFileParameterDouble1TS *MEDFileParameterDouble1TS::New(const char *fileName, const char *paramName, int dt, int it)
+MEDFileParameterDouble1TS *MEDFileParameterDouble1TS::New(const std::string& fileName, const std::string& paramName, int dt, int it)
{
return new MEDFileParameterDouble1TS(fileName,paramName,dt,it);
}
{
}
-MEDFileParameterDouble1TS::MEDFileParameterDouble1TS(const char *fileName, const char *paramName, int dt, int it)
+MEDFileParameterDouble1TS::MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it)
{
MEDFileUtilities::CheckFileForRead(fileName);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
int nbPar=MEDnParameter(fid);
std::ostringstream oss; oss << "MEDFileParameterDouble1TS : no double param name \"" << paramName << "\" ! Double Parameters available are : ";
INTERP_KERNEL::AutoPtr<char> pName=MEDLoaderBase::buildEmptyString(MED_NAME_SIZE);
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
-MEDFileParameterDouble1TS::MEDFileParameterDouble1TS(const char *fileName, const char *paramName)
+MEDFileParameterDouble1TS::MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName)
{
MEDFileUtilities::CheckFileForRead(fileName);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
int nbPar=MEDnParameter(fid);
std::ostringstream oss; oss << "MEDFileParameterDouble1TS : no double param name \"" << paramName << "\" ! Double Parameters available are : ";
INTERP_KERNEL::AutoPtr<char> pName=MEDLoaderBase::buildEmptyString(MED_NAME_SIZE);
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
-MEDFileParameterDouble1TS::MEDFileParameterDouble1TS(const char *fileName)
+MEDFileParameterDouble1TS::MEDFileParameterDouble1TS(const std::string& fileName)
{
MEDFileUtilities::CheckFileForRead(fileName);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
int nbPar=MEDnParameter(fid);
if(nbPar<1)
{
return std::vector<const BigMemoryObject *>();
}
-void MEDFileParameterDouble1TS::write(const char *fileName, int mode) const
+void MEDFileParameterDouble1TS::write(const std::string& fileName, int mode) const
{
med_access_mode medmod=MEDFileUtilities::TraduceWriteMode(mode);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,medmod);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),medmod);
MEDFileParameterTinyInfo::writeLLHeader(fid,MED_FLOAT64);
MEDFileParameterDouble1TSWTI::writeLL(fid,_name,*this);
}
return new MEDFileParameterMultiTS;
}
-MEDFileParameterMultiTS *MEDFileParameterMultiTS::New(const char *fileName)
+MEDFileParameterMultiTS *MEDFileParameterMultiTS::New(const std::string& fileName)
{
return new MEDFileParameterMultiTS(fileName);
}
-MEDFileParameterMultiTS *MEDFileParameterMultiTS::New(const char *fileName, const char *paramName)
+MEDFileParameterMultiTS *MEDFileParameterMultiTS::New(const std::string& fileName, const std::string& paramName)
{
return new MEDFileParameterMultiTS(fileName,paramName);
}
}
}
-MEDFileParameterMultiTS::MEDFileParameterMultiTS(const char *fileName)
+MEDFileParameterMultiTS::MEDFileParameterMultiTS(const std::string& fileName)
{
MEDFileUtilities::CheckFileForRead(fileName);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
int nbPar=MEDnParameter(fid);
if(nbPar<1)
{
finishLoading(fid,paramType,nbOfSteps);
}
-MEDFileParameterMultiTS::MEDFileParameterMultiTS(const char *fileName, const char *paramName)
+MEDFileParameterMultiTS::MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
{
MEDFileUtilities::CheckFileForRead(fileName);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
int nbPar=MEDnParameter(fid);
std::ostringstream oss; oss << "MEDFileParameterDouble1TS : no double param name \"" << paramName << "\" ! Double Parameters available are : ";
INTERP_KERNEL::AutoPtr<char> pName=MEDLoaderBase::buildEmptyString(MED_NAME_SIZE);
return true;
}
-void MEDFileParameterMultiTS::write(const char *fileName, int mode) const
+void MEDFileParameterMultiTS::write(const std::string& fileName, int mode) const
{
med_access_mode medmod=MEDFileUtilities::TraduceWriteMode(mode);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,medmod);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),medmod);
writeLL(fid,*this);
}
return new MEDFileParameters;
}
-MEDFileParameters *MEDFileParameters::New(const char *fileName)
+MEDFileParameters *MEDFileParameters::New(const std::string& fileName)
{
return new MEDFileParameters(fileName);
}
-MEDFileParameters::MEDFileParameters(const char *fileName)
+MEDFileParameters::MEDFileParameters(const std::string& fileName)
{
MEDFileUtilities::CheckFileForRead(fileName);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
int nbPar=MEDnParameter(fid);
_params.resize(nbPar);
INTERP_KERNEL::AutoPtr<char> pName=MEDLoaderBase::buildEmptyString(MED_NAME_SIZE);
int nbOfSteps;
MEDparameterInfo(fid,i+1,pName,¶mType,descName,unitName,&nbOfSteps);
std::string paramNameCpp=MEDLoaderBase::buildStringFromFortran(pName,MED_NAME_SIZE);
- _params[i]=MEDFileParameterMultiTS::New(fileName,paramNameCpp.c_str());
+ _params[i]=MEDFileParameterMultiTS::New(fileName,paramNameCpp);
}
}
}
}
-void MEDFileParameters::write(const char *fileName, int mode) const
+void MEDFileParameters::write(const std::string& fileName, int mode) const
{
med_access_mode medmod=MEDFileUtilities::TraduceWriteMode(mode);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,medmod);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),medmod);
writeLL(fid);
}
/*!
* \return an internal pointer that can be null. Warning the caller is \b not responsible of the returned pointer.
*/
-MEDFileParameterMultiTS *MEDFileParameters::getParamWithName(const char *paramName) const
+MEDFileParameterMultiTS *MEDFileParameters::getParamWithName(const std::string& paramName) const
{
int pos=getPosFromParamName(paramName);
return getParamAtPos(pos);
_params[i]=MEDCouplingAutoRefCountObjectPtr<MEDFileParameterMultiTS>(0);
}
-int MEDFileParameters::getPosFromParamName(const char *paramName) const
+int MEDFileParameters::getPosFromParamName(const std::string& paramName) const
{
std::ostringstream oss; oss << "MEDFileParameters::getPosFromParamName : no such name=" << paramName << " ! Possibilities are :";
int ret=0;
class MEDFileParameterTinyInfo : public MEDFileWritable
{
public:
- MEDLOADER_EXPORT void setDescription(const char *name) { _desc_name=name; }
+ MEDLOADER_EXPORT void setDescription(const std::string& name) { _desc_name=name; }
MEDLOADER_EXPORT std::string getDescription() const { return _desc_name; }
- MEDLOADER_EXPORT void setTimeUnit(const char *unit) { _dt_unit=unit; }
+ MEDLOADER_EXPORT void setTimeUnit(const std::string& unit) { _dt_unit=unit; }
MEDLOADER_EXPORT std::string getTimeUnit() const { return _dt_unit; }
MEDLOADER_EXPORT std::size_t getHeapMemSizeOfStrings() const;
MEDLOADER_EXPORT bool isEqualStrings(const MEDFileParameterTinyInfo& other, std::string& what) const;
{
public:
MEDLOADER_EXPORT static MEDFileParameterDouble1TS *New();
- MEDLOADER_EXPORT static MEDFileParameterDouble1TS *New(const char *fileName);
- MEDLOADER_EXPORT static MEDFileParameterDouble1TS *New(const char *fileName, const char *paramName);
- MEDLOADER_EXPORT static MEDFileParameterDouble1TS *New(const char *fileName, const char *paramName, int dt, int it);
+ MEDLOADER_EXPORT static MEDFileParameterDouble1TS *New(const std::string& fileName);
+ MEDLOADER_EXPORT static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName);
+ MEDLOADER_EXPORT static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it);
MEDLOADER_EXPORT virtual MEDFileParameter1TS *deepCpy() const;
MEDLOADER_EXPORT virtual bool isEqual(const MEDFileParameter1TS *other, double eps, std::string& what) const;
MEDLOADER_EXPORT virtual std::string simpleRepr() const;
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
- MEDLOADER_EXPORT void setName(const char *name) { _name=name; }
+ MEDLOADER_EXPORT void setName(const std::string& name) { _name=name; }
MEDLOADER_EXPORT std::string getName() const { return _name; }
- MEDLOADER_EXPORT void write(const char *fileName, int mode) const;
+ MEDLOADER_EXPORT void write(const std::string& fileName, int mode) const;
private:
MEDFileParameterDouble1TS();
- MEDFileParameterDouble1TS(const char *fileName);
- MEDFileParameterDouble1TS(const char *fileName, const char *paramName);
- MEDFileParameterDouble1TS(const char *fileName, const char *paramName, int dt, int it);
+ MEDFileParameterDouble1TS(const std::string& fileName);
+ MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName);
+ MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it);
};
class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
{
public:
MEDLOADER_EXPORT static MEDFileParameterMultiTS *New();
- MEDLOADER_EXPORT static MEDFileParameterMultiTS *New(const char *fileName);
- MEDLOADER_EXPORT static MEDFileParameterMultiTS *New(const char *fileName, const char *paramName);
+ MEDLOADER_EXPORT static MEDFileParameterMultiTS *New(const std::string& fileName);
+ MEDLOADER_EXPORT static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName);
MEDLOADER_EXPORT std::string getName() const { return _name; }
- MEDLOADER_EXPORT void setName(const char *name) { _name=name; }
+ MEDLOADER_EXPORT void setName(const std::string& name) { _name=name; }
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
MEDLOADER_EXPORT MEDFileParameterMultiTS *deepCpy() const;
MEDLOADER_EXPORT bool isEqual(const MEDFileParameterMultiTS *other, double eps, std::string& what) const;
- MEDLOADER_EXPORT void write(const char *fileName, int mode) const;
+ MEDLOADER_EXPORT void write(const std::string& fileName, int mode) const;
MEDLOADER_EXPORT void writeLL(med_idt fid, const MEDFileWritable& mw) const;
MEDLOADER_EXPORT std::string simpleRepr() const;
MEDLOADER_EXPORT void appendValue(int dt, int it, double time, double val);
protected:
MEDFileParameterMultiTS();
MEDFileParameterMultiTS(const MEDFileParameterMultiTS& other, bool deepCopy);
- MEDFileParameterMultiTS(const char *fileName);
- MEDFileParameterMultiTS(const char *fileName, const char *paramName);
+ MEDFileParameterMultiTS(const std::string& fileName);
+ MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName);
void finishLoading(med_idt fid, med_parameter_type typ, int nbOfSteps);
protected:
std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileParameter1TS> > _param_per_ts;
{
public:
MEDLOADER_EXPORT static MEDFileParameters *New();
- MEDLOADER_EXPORT static MEDFileParameters *New(const char *fileName);
+ MEDLOADER_EXPORT static MEDFileParameters *New(const std::string& fileName);
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
MEDLOADER_EXPORT MEDFileParameters *deepCpy() const;
MEDLOADER_EXPORT bool isEqual(const MEDFileParameters *other, double eps, std::string& what) const;
- MEDLOADER_EXPORT void write(const char *fileName, int mode) const;
+ MEDLOADER_EXPORT void write(const std::string& fileName, int mode) const;
MEDLOADER_EXPORT void writeLL(med_idt fid) const;
MEDLOADER_EXPORT std::vector<std::string> getParamsNames() const;
MEDLOADER_EXPORT std::string simpleRepr() const;
MEDLOADER_EXPORT void pushParam(MEDFileParameterMultiTS *param);
MEDLOADER_EXPORT void setParamAtPos(int i, MEDFileParameterMultiTS *param);
MEDLOADER_EXPORT MEDFileParameterMultiTS *getParamAtPos(int i) const;
- MEDLOADER_EXPORT MEDFileParameterMultiTS *getParamWithName(const char *paramName) const;
+ MEDLOADER_EXPORT MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const;
MEDLOADER_EXPORT void destroyParamAtPos(int i);
- MEDLOADER_EXPORT int getPosFromParamName(const char *paramName) const;
+ MEDLOADER_EXPORT int getPosFromParamName(const std::string& paramName) const;
MEDLOADER_EXPORT int getNumberOfParams() const;
protected:
void simpleRepr2(int bkOffset, std::ostream& oss) const;
- MEDFileParameters(const char *fileName);
+ MEDFileParameters(const std::string& fileName);
MEDFileParameters(const MEDFileParameters& other, bool deepCopy);
MEDFileParameters();
protected:
}
}
-void MEDFileUtilities::CheckMEDCode(int code, med_idt fid, const char *msg)
+void MEDFileUtilities::CheckMEDCode(int code, med_idt fid, const std::string& msg)
{
if(code<0)
{
}
}
-void MEDFileUtilities::CheckFileForRead(const char *fileName)
+void MEDFileUtilities::CheckFileForRead(const std::string& fileName)
{
int status=MEDLoaderBase::getStatusOfFile(fileName);
std::ostringstream oss;
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
}
- AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
+ AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
if(fid<0)
{
oss << " has been detected as unreadable by MED file : impossible to read anything !";
{
med_access_mode TraduceWriteMode(int medloaderwritemode);
const char *GetReadableMEDFieldType(med_field_type ft);
- void CheckMEDCode(int code, med_idt fid, const char *msg);
- void CheckFileForRead(const char *fileName);
+ void CheckMEDCode(int code, med_idt fid, const std::string& msg);
+ void CheckFileForRead(const std::string& fileName);
class AutoFid
{
namespace MEDLoaderNS
{
- int readUMeshDimFromFile(const char *fileName, const char *meshName, std::vector<int>& possibilities);
+ int readUMeshDimFromFile(const std::string& fileName, const std::string& meshName, std::vector<int>& possibilities);
void dispatchElems(int nbOfElemCell, int nbOfElemFace, int& nbOfElem, med_entity_type& whichEntity);
- void writeFieldWithoutReadingAndMappingOfMeshInFile(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch);
- med_int getIdFromMeshName(med_idt fid, const char *meshName, std::string& trueMeshName) throw(INTERP_KERNEL::Exception);
+ void writeFieldWithoutReadingAndMappingOfMeshInFile(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch);
+ med_int getIdFromMeshName(med_idt fid, const std::string& meshName, std::string& trueMeshName) throw(INTERP_KERNEL::Exception);
std::vector<std::string> getMeshNamesFid(med_idt fid);
}
/// @cond INTERNAL
/*!
- * This method returns a first quick overview of mesh with name 'meshName' into the file 'fileName'.
+ * This method returns a first quick overview of mesh with name \a meshName into the file \a fileName.
* @param possibilities the relativeToMeshDim authorized to returned maxdim. This vector is systematically cleared at the begin of this method.
* @return the maximal mesh dimension of specified mesh. If nothing found -1 is returned.
*/
-int MEDLoaderNS::readUMeshDimFromFile(const char *fileName, const char *meshName, std::vector<int>& possibilities)
+int MEDLoaderNS::readUMeshDimFromFile(const std::string& fileName, const std::string& meshName, std::vector<int>& possibilities)
{
possibilities.clear();
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
int ret;
std::set<int> poss;
char nommaa[MED_NAME_SIZE+1];
return ret;
}
-med_int MEDLoaderNS::getIdFromMeshName(med_idt fid, const char *meshName, std::string& trueMeshName) throw(INTERP_KERNEL::Exception)
+med_int MEDLoaderNS::getIdFromMeshName(med_idt fid, const std::string& meshName, std::string& trueMeshName) throw(INTERP_KERNEL::Exception)
{
- if(meshName==0)
+ if(meshName.empty())
{
std::vector<std::string> meshes=getMeshNamesFid(fid);
if(meshes.empty())
* - the space dimension
* - the number of nodes
*/
-std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > MEDLoader::GetUMeshGlobalInfo(const char *fileName, const char *meshName, int &meshDim, int& spaceDim, int& numberOfNodes)
+std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > MEDLoader::GetUMeshGlobalInfo(const std::string& fileName, const std::string& meshName, int &meshDim, int& spaceDim, int& numberOfNodes)
{
CheckFileForRead(fileName);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
std::set<int> poss;
char nommaa[MED_NAME_SIZE+1];
char maillage_description[MED_COMMENT_SIZE+1];
return ret;
}
-void MEDLoader::CheckFileForRead(const char *fileName)
+void MEDLoader::CheckFileForRead(const std::string& fileName)
{
MEDFileUtilities::CheckFileForRead(fileName);
}
-std::vector<std::string> MEDLoader::GetMeshNames(const char *fileName)
+std::vector<std::string> MEDLoader::GetMeshNames(const std::string& fileName)
{
CheckFileForRead(fileName);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
std::vector<std::string> ret=MEDLoaderNS::getMeshNamesFid(fid);
return ret;
}
-std::vector< std::pair<std::string,std::string> > MEDLoader::GetComponentsNamesOfField(const char *fileName, const char *fieldName)
+std::vector< std::pair<std::string,std::string> > MEDLoader::GetComponentsNamesOfField(const std::string& fileName, const std::string& fieldName)
{
CheckFileForRead(fileName);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
med_int nbFields=MEDnField(fid);
std::vector<std::string> fields(nbFields);
med_field_type typcha;
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
-std::vector<std::string> MEDLoader::GetMeshNamesOnField(const char *fileName, const char *fieldName)
+std::vector<std::string> MEDLoader::GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName)
{
CheckFileForRead(fileName);
std::vector<std::string> ret;
//
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
med_int nbFields=MEDnField(fid);
//
med_field_type typcha;
return ret;
}
-std::vector<std::string> MEDLoader::GetMeshFamiliesNames(const char *fileName, const char *meshName)
+std::vector<std::string> MEDLoader::GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName)
{
CheckFileForRead(fileName);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
- med_int nfam=MEDnFamily(fid,meshName);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
+ med_int nfam=MEDnFamily(fid,meshName.c_str());
std::vector<std::string> ret(nfam);
char nomfam[MED_NAME_SIZE+1];
med_int numfam;
for(int i=0;i<nfam;i++)
{
- int ngro=MEDnFamilyGroup(fid,meshName,i+1);
- med_int natt=MEDnFamily23Attribute(fid,meshName,i+1);
+ int ngro=MEDnFamilyGroup(fid,meshName.c_str(),i+1);
+ med_int natt=MEDnFamily23Attribute(fid,meshName.c_str(),i+1);
INTERP_KERNEL::AutoPtr<med_int> attide=new med_int[natt];
INTERP_KERNEL::AutoPtr<med_int> attval=new med_int[natt];
INTERP_KERNEL::AutoPtr<char> attdes=new char[MED_COMMENT_SIZE*natt+1];
INTERP_KERNEL::AutoPtr<char> gro=new char[MED_LNAME_SIZE*ngro+1];
- MEDfamily23Info(fid,meshName,i+1,nomfam,attide,attval,attdes,&numfam,gro);
+ MEDfamily23Info(fid,meshName.c_str(),i+1,nomfam,attide,attval,attdes,&numfam,gro);
std::string cur=MEDLoaderBase::buildStringFromFortran(nomfam,sizeof(nomfam));
ret[i]=cur;
}
}
-std::vector<std::string> MEDLoader::GetMeshFamiliesNamesOnGroup(const char *fileName, const char *meshName, const char *grpName)
+std::vector<std::string> MEDLoader::GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName)
{
CheckFileForRead(fileName);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
- med_int nfam=MEDnFamily(fid,meshName);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
+ med_int nfam=MEDnFamily(fid,meshName.c_str());
std::vector<std::string> ret;
char nomfam[MED_NAME_SIZE+1];
med_int numfam;
for(int i=0;i<nfam;i++)
{
- int ngro=MEDnFamilyGroup(fid,meshName,i+1);
- med_int natt=MEDnFamily23Attribute(fid,meshName,i+1);
+ int ngro=MEDnFamilyGroup(fid,meshName.c_str(),i+1);
+ med_int natt=MEDnFamily23Attribute(fid,meshName.c_str(),i+1);
INTERP_KERNEL::AutoPtr<med_int> attide=new med_int[natt];
INTERP_KERNEL::AutoPtr<med_int> attval=new med_int[natt];
INTERP_KERNEL::AutoPtr<char> attdes=new char[MED_COMMENT_SIZE*natt+1];
INTERP_KERNEL::AutoPtr<char> gro=new char[MED_LNAME_SIZE*ngro+1];
- MEDfamily23Info(fid,meshName,i+1,nomfam,attide,attval,attdes,&numfam,gro);
+ MEDfamily23Info(fid,meshName.c_str(),i+1,nomfam,attide,attval,attdes,&numfam,gro);
std::string cur=MEDLoaderBase::buildStringFromFortran(nomfam,sizeof(nomfam));
for(int j=0;j<ngro;j++)
{
return ret;
}
-std::vector<std::string> MEDLoader::GetMeshGroupsNamesOnFamily(const char *fileName, const char *meshName, const char *famName)
+std::vector<std::string> MEDLoader::GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName)
{
CheckFileForRead(fileName);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
- med_int nfam=MEDnFamily(fid,meshName);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
+ med_int nfam=MEDnFamily(fid,meshName.c_str());
std::vector<std::string> ret;
char nomfam[MED_NAME_SIZE+1];
med_int numfam;
bool found=false;
for(int i=0;i<nfam && !found;i++)
{
- int ngro=MEDnFamilyGroup(fid,meshName,i+1);
- med_int natt=MEDnFamily23Attribute(fid,meshName,i+1);
+ int ngro=MEDnFamilyGroup(fid,meshName.c_str(),i+1);
+ med_int natt=MEDnFamily23Attribute(fid,meshName.c_str(),i+1);
INTERP_KERNEL::AutoPtr<med_int> attide=new med_int[natt];
INTERP_KERNEL::AutoPtr<med_int> attval=new med_int[natt];
INTERP_KERNEL::AutoPtr<char> attdes=new char[MED_COMMENT_SIZE*natt+1];
INTERP_KERNEL::AutoPtr<char> gro=new char[MED_LNAME_SIZE*ngro+1];
- MEDfamily23Info(fid,meshName,i+1,nomfam,attide,attval,attdes,&numfam,gro);
+ MEDfamily23Info(fid,meshName.c_str(),i+1,nomfam,attide,attval,attdes,&numfam,gro);
std::string cur=MEDLoaderBase::buildStringFromFortran(nomfam,sizeof(nomfam));
found=(cur==famName);
if(found)
}
-std::vector<std::string> MEDLoader::GetMeshGroupsNames(const char *fileName, const char *meshName)
+std::vector<std::string> MEDLoader::GetMeshGroupsNames(const std::string& fileName, const std::string& meshName)
{
CheckFileForRead(fileName);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
- med_int nfam=MEDnFamily(fid,meshName);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
+ med_int nfam=MEDnFamily(fid,meshName.c_str());
std::vector<std::string> ret;
char nomfam[MED_NAME_SIZE+1];
med_int numfam;
for(int i=0;i<nfam;i++)
{
- int ngro=MEDnFamilyGroup(fid,meshName,i+1);
- med_int natt=MEDnFamily23Attribute(fid,meshName,i+1);
+ int ngro=MEDnFamilyGroup(fid,meshName.c_str(),i+1);
+ med_int natt=MEDnFamily23Attribute(fid,meshName.c_str(),i+1);
INTERP_KERNEL::AutoPtr<med_int> attide=new med_int[natt];
INTERP_KERNEL::AutoPtr<med_int> attval=new med_int[natt];
INTERP_KERNEL::AutoPtr<char> attdes=new char[MED_COMMENT_SIZE*natt+1];
INTERP_KERNEL::AutoPtr<char> gro=new char[MED_LNAME_SIZE*ngro+1];
- MEDfamily23Info(fid,meshName,i+1,nomfam,attide,attval,attdes,&numfam,gro);
+ MEDfamily23Info(fid,meshName.c_str(),i+1,nomfam,attide,attval,attdes,&numfam,gro);
for(int j=0;j<ngro;j++)
{
std::string cur=MEDLoaderBase::buildStringFromFortran(gro+j*MED_LNAME_SIZE,MED_LNAME_SIZE);
}
return ret;
}
-std::vector<ParaMEDMEM::TypeOfField> MEDLoader::GetTypesOfField(const char *fileName, const char *meshName, const char *fieldName)
+std::vector<ParaMEDMEM::TypeOfField> MEDLoader::GetTypesOfField(const std::string& fileName, const std::string& meshName, const std::string& fieldName)
{
CheckFileForRead(fileName);
std::vector<ParaMEDMEM::TypeOfField> ret;
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
med_int nbFields=MEDnField(fid);
//
med_field_type typcha;
return ret;
}
-std::vector<std::string> MEDLoader::GetAllFieldNames(const char *fileName)
+std::vector<std::string> MEDLoader::GetAllFieldNames(const std::string& fileName)
{
CheckFileForRead(fileName);
std::vector<std::string> ret;
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
med_int nbFields=MEDnField(fid);
med_field_type typcha;
for(int i=0;i<nbFields;i++)
return ret;
}
-std::vector<std::string> MEDLoader::GetAllFieldNamesOnMesh(const char *fileName, const char *meshName)
+std::vector<std::string> MEDLoader::GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName)
{
CheckFileForRead(fileName);
std::vector<std::string> ret;
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
med_int nbFields=MEDnField(fid);
//
med_field_type typcha;
return ret;
}
-std::vector<std::string> MEDLoader::GetFieldNamesOnMesh(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName)
+std::vector<std::string> MEDLoader::GetFieldNamesOnMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName)
{
CheckFileForRead(fileName);
switch(type)
}
}
-std::vector<std::string> MEDLoader::GetCellFieldNamesOnMesh(const char *fileName, const char *meshName)
+std::vector<std::string> MEDLoader::GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName)
{
CheckFileForRead(fileName);
std::vector<std::string> ret;
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
med_int nbFields=MEDnField(fid);
//
med_field_type typcha;
return ret;
}
-std::vector<std::string> MEDLoader::GetNodeFieldNamesOnMesh(const char *fileName, const char *meshName)
+std::vector<std::string> MEDLoader::GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName)
{
CheckFileForRead(fileName);
std::vector<std::string> ret;
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
med_int nbFields=MEDnField(fid);
char pflname[MED_NAME_SIZE+1]="";
char locname[MED_NAME_SIZE+1]="";
return ret;
}
-std::vector< std::pair< std::pair<int,int>, double> > MEDLoader::GetAllFieldIterations(const char *fileName, const char *fieldName)
+std::vector< std::pair< std::pair<int,int>, double> > MEDLoader::GetAllFieldIterations(const std::string& fileName, const std::string& fieldName)
{
CheckFileForRead(fileName);
std::vector< std::pair< std::pair<int,int>, double > > ret;
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
med_int nbFields=MEDnField(fid);
//
med_field_type typcha;
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
-double MEDLoader::GetTimeAttachedOnFieldIteration(const char *fileName, const char *fieldName, int iteration, int order)
+double MEDLoader::GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order)
{
CheckFileForRead(fileName);
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
med_int nbFields=MEDnField(fid);
//
med_field_type typcha;
return ret;
}
-std::vector< std::pair<int,int> > MEDLoader::GetFieldIterations(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName, const char *fieldName)
+std::vector< std::pair<int,int> > MEDLoader::GetFieldIterations(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName)
{
CheckFileForRead(fileName);
switch(type)
}
}
-std::vector< std::pair<int,int> > MEDLoader::GetCellFieldIterations(const char *fileName, const char *meshName, const char *fieldName)
+std::vector< std::pair<int,int> > MEDLoader::GetCellFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName)
{
CheckFileForRead(fileName);
std::string meshNameCpp(meshName);
std::vector< std::pair<int,int> > ret;
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
med_int nbFields=MEDnField(fid);
//
med_field_type typcha;
return ret;
}
-std::vector< std::pair<int,int> > MEDLoader::GetNodeFieldIterations(const char *fileName, const char *meshName, const char *fieldName)
+std::vector< std::pair<int,int> > MEDLoader::GetNodeFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName)
{
CheckFileForRead(fileName);
std::string meshNameCpp(meshName);
std::vector< std::pair<int,int> > ret;
- MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
+ MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
med_int nbFields=MEDnField(fid);
//
med_field_type typcha;
return ret;
}
-ParaMEDMEM::MEDCouplingMesh *MEDLoader::ReadMeshFromFile(const char *fileName, const char *meshName, int meshDimRelToMax)
+ParaMEDMEM::MEDCouplingMesh *MEDLoader::ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax)
{
CheckFileForRead(fileName);
MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm(MEDFileMesh::New(fileName,meshName));
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
-ParaMEDMEM::MEDCouplingMesh *MEDLoader::ReadMeshFromFile(const char *fileName, int meshDimRelToMax)
+ParaMEDMEM::MEDCouplingMesh *MEDLoader::ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax)
{
CheckFileForRead(fileName);
MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm(MEDFileMesh::New(fileName));
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
-ParaMEDMEM::MEDCouplingUMesh *MEDLoader::ReadUMeshFromFile(const char *fileName, const char *meshName, int meshDimRelToMax)
+ParaMEDMEM::MEDCouplingUMesh *MEDLoader::ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax)
{
CheckFileForRead(fileName);
MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm(MEDFileMesh::New(fileName,meshName));
return mmuPtr->getMeshAtLevel(meshDimRelToMax,true);
}
-ParaMEDMEM::MEDCouplingUMesh *MEDLoader::ReadUMeshFromFile(const char *fileName, int meshDimRelToMax)
+ParaMEDMEM::MEDCouplingUMesh *MEDLoader::ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax)
{
CheckFileForRead(fileName);
MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm(MEDFileMesh::New(fileName));
return mmuPtr->getMeshAtLevel(meshDimRelToMax,true);
}
-int MEDLoader::ReadUMeshDimFromFile(const char *fileName, const char *meshName)
+int MEDLoader::ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName)
{
CheckFileForRead(fileName);
std::vector<int> poss;
return MEDLoaderNS::readUMeshDimFromFile(fileName,meshName,poss);
}
-ParaMEDMEM::MEDCouplingUMesh *MEDLoader::ReadUMeshFromFamilies(const char *fileName, const char *meshName, int meshDimRelToMax, const std::vector<std::string>& fams)
+ParaMEDMEM::MEDCouplingUMesh *MEDLoader::ReadUMeshFromFamilies(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::vector<std::string>& fams)
{
CheckFileForRead(fileName);
MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm(MEDFileMesh::New(fileName,meshName));
return mmuPtr->getFamilies(meshDimRelToMax,fams,true);
}
-ParaMEDMEM::MEDCouplingUMesh *MEDLoader::ReadUMeshFromGroups(const char *fileName, const char *meshName, int meshDimRelToMax, const std::vector<std::string>& grps)
+ParaMEDMEM::MEDCouplingUMesh *MEDLoader::ReadUMeshFromGroups(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::vector<std::string>& grps)
{
CheckFileForRead(fileName);
MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm=MEDFileMesh::New(fileName,meshName);
return mmuPtr->getGroups(meshDimRelToMax,grps,true);
}
-ParaMEDMEM::MEDCouplingFieldDouble *MEDLoader::ReadField(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order)
+ParaMEDMEM::MEDCouplingFieldDouble *MEDLoader::ReadField(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order)
{
CheckFileForRead(fileName);
switch(type)
}
}
-std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> MEDLoader::ReadFieldsOnSameMesh(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName,
+std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> MEDLoader::ReadFieldsOnSameMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName,
const std::vector<std::pair<int,int> >& its) throw(INTERP_KERNEL::Exception)
{
if(its.empty())
return ret;
}
-std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> MEDLoader::ReadFieldsCellOnSameMesh(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName,
+std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> MEDLoader::ReadFieldsCellOnSameMesh(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName,
const std::vector<std::pair<int,int> >& its) throw(INTERP_KERNEL::Exception)
{
return ReadFieldsOnSameMesh(ON_CELLS,fileName,meshName,meshDimRelToMax,fieldName,its);
}
-std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> MEDLoader::ReadFieldsNodeOnSameMesh(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName,
+std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> MEDLoader::ReadFieldsNodeOnSameMesh(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName,
const std::vector<std::pair<int,int> >& its) throw(INTERP_KERNEL::Exception)
{
return ReadFieldsOnSameMesh(ON_NODES,fileName,meshName,meshDimRelToMax,fieldName,its);
}
-std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> MEDLoader::ReadFieldsGaussOnSameMesh(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName,
+std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> MEDLoader::ReadFieldsGaussOnSameMesh(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName,
const std::vector<std::pair<int,int> >& its) throw(INTERP_KERNEL::Exception)
{
return ReadFieldsOnSameMesh(ON_GAUSS_PT,fileName,meshName,meshDimRelToMax,fieldName,its);
}
-std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> MEDLoader::ReadFieldsGaussNEOnSameMesh(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName,
+std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> MEDLoader::ReadFieldsGaussNEOnSameMesh(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName,
const std::vector<std::pair<int,int> >& its) throw(INTERP_KERNEL::Exception)
{
return ReadFieldsOnSameMesh(ON_GAUSS_NE,fileName,meshName,meshDimRelToMax,fieldName,its);
}
-ParaMEDMEM::MEDCouplingFieldDouble *MEDLoader::ReadFieldCell(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order)
+ParaMEDMEM::MEDCouplingFieldDouble *MEDLoader::ReadFieldCell(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order)
{
MEDCouplingAutoRefCountObjectPtr<MEDFileField1TS> ff=MEDFileField1TS::New(fileName,fieldName,iteration,order);
MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm=MEDFileMesh::New(fileName,meshName);
return ret.retn();
}
-ParaMEDMEM::MEDCouplingFieldDouble *MEDLoader::ReadFieldNode(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order)
+ParaMEDMEM::MEDCouplingFieldDouble *MEDLoader::ReadFieldNode(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order)
{
MEDCouplingAutoRefCountObjectPtr<MEDFileField1TS> ff=MEDFileField1TS::New(fileName,fieldName,iteration,order);
MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm=MEDFileMesh::New(fileName,meshName);
return ret.retn();
}
-ParaMEDMEM::MEDCouplingFieldDouble *MEDLoader::ReadFieldGauss(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order)
+ParaMEDMEM::MEDCouplingFieldDouble *MEDLoader::ReadFieldGauss(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order)
{
MEDCouplingAutoRefCountObjectPtr<MEDFileField1TS> ff=MEDFileField1TS::New(fileName,fieldName,iteration,order);
MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm=MEDFileMesh::New(fileName,meshName);
return ret.retn();
}
-ParaMEDMEM::MEDCouplingFieldDouble *MEDLoader::ReadFieldGaussNE(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order)
+ParaMEDMEM::MEDCouplingFieldDouble *MEDLoader::ReadFieldGaussNE(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order)
{
MEDCouplingAutoRefCountObjectPtr<MEDFileField1TS> ff=MEDFileField1TS::New(fileName,fieldName,iteration,order);
MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm=MEDFileMesh::New(fileName,meshName);
return ret.retn();
}
-void MEDLoader::WriteMesh(const char *fileName, const ParaMEDMEM::MEDCouplingMesh *mesh, bool writeFromScratch)
+void MEDLoader::WriteMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingMesh *mesh, bool writeFromScratch)
{
if(!mesh)
throw INTERP_KERNEL::Exception("MEDLoader::WriteMesh : input mesh is null !");
throw INTERP_KERNEL::Exception("MEDLoader::WriteMesh : only MEDCouplingUMesh, MEDCoupling1GTUMesh, MEDCouplingCMesh, MEDCouplingCurveLinear are dealed in this API for the moment !");
}
-void MEDLoader::WriteUMesh(const char *fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch)
+void MEDLoader::WriteUMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch)
{
if(!mesh)
throw INTERP_KERNEL::Exception("MEDLoader::WriteUMesh : input mesh is null !");
m->write(fileName,mod);
}
-void MEDLoader::WriteUMeshDep(const char *fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch)
+void MEDLoader::WriteUMeshDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch)
{
MEDLoader::WriteUMesh(fileName,mesh,writeFromScratch);
}
-void MEDLoader::WriteUMeshesPartition(const char *fileName, const char *meshNameC, const std::vector<const ParaMEDMEM::MEDCouplingUMesh *>& meshes, bool writeFromScratch)
+void MEDLoader::WriteUMeshesPartition(const std::string& fileName, const std::string& meshNameC, const std::vector<const ParaMEDMEM::MEDCouplingUMesh *>& meshes, bool writeFromScratch)
{
std::string meshName(meshNameC);
if(meshName.empty())
m->write(fileName,mod);
}
-void MEDLoader::WriteUMeshesPartitionDep(const char *fileName, const char *meshNameC, const std::vector<const ParaMEDMEM::MEDCouplingUMesh *>& meshes, bool writeFromScratch)
+void MEDLoader::WriteUMeshesPartitionDep(const std::string& fileName, const std::string& meshNameC, const std::vector<const ParaMEDMEM::MEDCouplingUMesh *>& meshes, bool writeFromScratch)
{
WriteUMeshesPartition(fileName,meshNameC,meshes,writeFromScratch);
}
-void MEDLoader::WriteUMeshes(const char *fileName, const std::vector<const ParaMEDMEM::MEDCouplingUMesh *>& meshes, bool writeFromScratch)
+void MEDLoader::WriteUMeshes(const std::string& fileName, const std::vector<const ParaMEDMEM::MEDCouplingUMesh *>& meshes, bool writeFromScratch)
{
int mod=writeFromScratch?2:0;
MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> m(MEDFileUMesh::New());
m->write(fileName,mod);
}
-void MEDLoaderNS::writeFieldWithoutReadingAndMappingOfMeshInFile(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch)
+void MEDLoaderNS::writeFieldWithoutReadingAndMappingOfMeshInFile(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch)
{
MEDCouplingAutoRefCountObjectPtr<MEDFileField1TS> ff(MEDFileField1TS::New());
MEDLoader::AssignStaticWritePropertiesTo(*ff);
ff->write(fileName,0);
}
-void MEDLoader::WriteField(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch)
+void MEDLoader::WriteField(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch)
{
if(!f)
throw INTERP_KERNEL::Exception("MEDLoader::WriteField : input field is NULL !");
}
}
-void MEDLoader::WriteFieldDep(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch)
+void MEDLoader::WriteFieldDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch)
{
WriteField(fileName,f,writeFromScratch);
}
-void MEDLoader::WriteFieldUsingAlreadyWrittenMesh(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f)
+void MEDLoader::WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f)
{
if(!f)
throw INTERP_KERNEL::Exception("MEDLoader::WriteFieldUsingAlreadyWrittenMesh : input field is null !");
static bool HasXDR();
static std::string MEDFileVersionStr();
static void MEDFileVersion(int& major, int& minor, int& release);
- static void CheckFileForRead(const char *fileName);
- static std::vector<std::string> GetMeshNames(const char *fileName);
- static std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > GetUMeshGlobalInfo(const char *fileName, const char *meshName, int &meshDim, int& spaceDim, int& numberOfNodes);
- static std::vector< std::pair<std::string,std::string> > GetComponentsNamesOfField(const char *fileName, const char *fieldName);
- static std::vector<std::string> GetMeshNamesOnField(const char *fileName, const char *fieldName);
- static std::vector<std::string> GetMeshGroupsNames(const char *fileName, const char *meshName);
- static std::vector<std::string> GetMeshFamiliesNames(const char *fileName, const char *meshName);
- static std::vector<std::string> GetMeshFamiliesNamesOnGroup(const char *fileName, const char *meshName, const char *grpName);
- static std::vector<std::string> GetMeshGroupsNamesOnFamily(const char *fileName, const char *meshName, const char *famName);
- static std::vector<std::string> GetAllFieldNames(const char *fileName);
- static std::vector<std::string> GetAllFieldNamesOnMesh(const char *fileName, const char *meshName);
- static std::vector<ParaMEDMEM::TypeOfField> GetTypesOfField(const char *fileName, const char *meshName, const char *fieldName);
- static std::vector<std::string> GetFieldNamesOnMesh(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName);
- static std::vector<std::string> GetCellFieldNamesOnMesh(const char *fileName, const char *meshName);
- static std::vector<std::string> GetNodeFieldNamesOnMesh(const char *fileName, const char *meshName);
- static std::vector< std::pair<int,int> > GetFieldIterations(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName, const char *fieldName);
- static std::vector< std::pair<int,int> > GetCellFieldIterations(const char *fileName, const char *meshName, const char *fieldName);
- static std::vector< std::pair<int,int> > GetNodeFieldIterations(const char *fileName, const char *meshName, const char *fieldName);
- static std::vector< std::pair< std::pair<int,int>, double> > GetAllFieldIterations(const char *fileName, const char *fieldName);
- static double GetTimeAttachedOnFieldIteration(const char *fileName, const char *fieldName, int iteration, int order);
- static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFamilies(const char *fileName, const char *meshName, int meshDimRelToMax, const std::vector<std::string>& fams);
- static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromGroups(const char *fileName, const char *meshName, int meshDimRelToMax, const std::vector<std::string>& grps);
- static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const char *fileName, const char *meshName, int meshDimRelToMax=0);
- static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const char *fileName, int meshDimRelToMax=0);
- static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const char *fileName, const char *meshName, int meshDimRelToMax=0);
- static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const char *fileName, int meshDimRelToMax=0);
- static int ReadUMeshDimFromFile(const char *fileName, const char *meshName);
- static ParaMEDMEM::MEDCouplingFieldDouble *ReadField(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order);
- static std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> ReadFieldsOnSameMesh(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName,
+ static void CheckFileForRead(const std::string& fileName);
+ static std::vector<std::string> GetMeshNames(const std::string& fileName);
+ static std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > GetUMeshGlobalInfo(const std::string& fileName, const std::string& meshName, int &meshDim, int& spaceDim, int& numberOfNodes);
+ static std::vector< std::pair<std::string,std::string> > GetComponentsNamesOfField(const std::string& fileName, const std::string& fieldName);
+ static std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName);
+ static std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName);
+ static std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName);
+ static std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName);
+ static std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName);
+ static std::vector<std::string> GetAllFieldNames(const std::string& fileName);
+ static std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName);
+ static std::vector<ParaMEDMEM::TypeOfField> GetTypesOfField(const std::string& fileName, const std::string& meshName, const std::string& fieldName);
+ static std::vector<std::string> GetFieldNamesOnMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName);
+ static std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName);
+ static std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName);
+ static std::vector< std::pair<int,int> > GetFieldIterations(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName);
+ static std::vector< std::pair<int,int> > GetCellFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName);
+ static std::vector< std::pair<int,int> > GetNodeFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName);
+ static std::vector< std::pair< std::pair<int,int>, double> > GetAllFieldIterations(const std::string& fileName, const std::string& fieldName);
+ static double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order);
+ static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFamilies(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::vector<std::string>& fams);
+ static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromGroups(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::vector<std::string>& grps);
+ static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0);
+ static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0);
+ static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0);
+ static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0);
+ static int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName);
+ static ParaMEDMEM::MEDCouplingFieldDouble *ReadField(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
+ static std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> ReadFieldsOnSameMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName,
const std::vector<std::pair<int,int> >& its) throw(INTERP_KERNEL::Exception);
- static std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> ReadFieldsCellOnSameMesh(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName,
+ static std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> ReadFieldsCellOnSameMesh(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName,
const std::vector<std::pair<int,int> >& its) throw(INTERP_KERNEL::Exception);
- static std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> ReadFieldsNodeOnSameMesh(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName,
+ static std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> ReadFieldsNodeOnSameMesh(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName,
const std::vector<std::pair<int,int> >& its) throw(INTERP_KERNEL::Exception);
- static std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> ReadFieldsGaussOnSameMesh(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName,
+ static std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> ReadFieldsGaussOnSameMesh(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName,
const std::vector<std::pair<int,int> >& its) throw(INTERP_KERNEL::Exception);
- static std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> ReadFieldsGaussNEOnSameMesh(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName,
+ static std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> ReadFieldsGaussNEOnSameMesh(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName,
const std::vector<std::pair<int,int> >& its) throw(INTERP_KERNEL::Exception);
- static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldCell(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order);
- static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldNode(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order);
- static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGauss(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order);
- static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGaussNE(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order);
- static void WriteMesh(const char *fileName, const ParaMEDMEM::MEDCouplingMesh *mesh, bool writeFromScratch);
- static void WriteUMesh(const char *fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch);
- static void WriteUMeshDep(const char *fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch);
- static void WriteUMeshesPartition(const char *fileName, const char *meshName, const std::vector<const ParaMEDMEM::MEDCouplingUMesh *>& meshes, bool writeFromScratch);
- static void WriteUMeshesPartitionDep(const char *fileName, const char *meshName, const std::vector<const ParaMEDMEM::MEDCouplingUMesh *>& meshes, bool writeFromScratch);
- static void WriteUMeshes(const char *fileName, const std::vector<const ParaMEDMEM::MEDCouplingUMesh *>& meshes, bool writeFromScratch);
- static void WriteField(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch);
- static void WriteFieldDep(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch);
- static void WriteFieldUsingAlreadyWrittenMesh(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f);
+ static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldCell(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
+ static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldNode(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
+ static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGauss(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
+ static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGaussNE(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
+ static void WriteMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingMesh *mesh, bool writeFromScratch);
+ static void WriteUMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch);
+ static void WriteUMeshDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch);
+ static void WriteUMeshesPartition(const std::string& fileName, const std::string& meshName, const std::vector<const ParaMEDMEM::MEDCouplingUMesh *>& meshes, bool writeFromScratch);
+ static void WriteUMeshesPartitionDep(const std::string& fileName, const std::string& meshName, const std::vector<const ParaMEDMEM::MEDCouplingUMesh *>& meshes, bool writeFromScratch);
+ static void WriteUMeshes(const std::string& fileName, const std::vector<const ParaMEDMEM::MEDCouplingUMesh *>& meshes, bool writeFromScratch);
+ static void WriteField(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch);
+ static void WriteFieldDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch);
+ static void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f);
public:
static void AssignStaticWritePropertiesTo(ParaMEDMEM::MEDFileWritable& obj);
private:
const char MEDLoaderBase::WHITE_SPACES[]=" \n";
-int MEDLoaderBase::getStatusOfFile(const char *fileName)
+int MEDLoaderBase::getStatusOfFile(const std::string& fileName)
{
std::ifstream ifs;
- ifs.open(fileName);
+ ifs.open(fileName.c_str());
if((ifs.rdstate() & std::ifstream::failbit)!=0)
{
ifs.close();
return NOT_EXIST;
}
- std::ofstream ofs(fileName,std::ios_base::app);
+ std::ofstream ofs(fileName.c_str(),std::ios_base::app);
if((ofs.rdstate() & std::ofstream::failbit)!=0)
{
return EXIST_RDONLY;
* This method given the target size to respect 'sizeToRespect' tries to reduce size of 'src' string.
* This method uses several soft methods to do its job. But if it fails a simple cut of string will be performed.
*/
-std::string MEDLoaderBase::zipString(const char *src, int sizeToRespect)
+std::string MEDLoaderBase::zipString(const std::string& src, int sizeToRespect)
{
std::string s(src);
strip(s);
class MEDLOADER_EXPORT MEDLoaderBase
{
public:
- static int getStatusOfFile(const char *fileName);
+ static int getStatusOfFile(const std::string& fileName);
static char *buildEmptyString(int lgth);
static void getDirAndBaseName(const std::string& fullName, std::string& dirName, std::string& baseName);
static std::string getPathSep();
static void safeStrCpy2(const char *src, int maxLgth, char *dest, int behaviour);
static std::string buildStringFromFortran(const char *expr, int lgth);
static void zipEqualConsChar(std::string& s, int minConsSmChar);
- static std::string zipString(const char *src, int sizeToRespect);
+ static std::string zipString(const std::string& src, int sizeToRespect);
public:
static const int EXIST_RW=0;
static const int NOT_EXIST=1;
*/
//================================================================================
-SauvReader* SauvReader::New(const char *fileName)
+SauvReader* SauvReader::New(const std::string& fileName)
{
- if ( !fileName || strlen(fileName) < 1 ) THROW_IK_EXCEPTION("Invalid file name");
+ if ( fileName.empty() ) THROW_IK_EXCEPTION("Invalid file name");
ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr< SauvUtilities::FileReader> parser;
// try to open as XRD
- parser = new XDRReader( fileName );
+ parser = new XDRReader( fileName.c_str() );
if ( parser->open() )
{
SauvReader* reader = new SauvReader;
}
// try to open as ASCII
- parser = new ASCIIReader( fileName );
+ parser = new ASCIIReader( fileName.c_str() );
if ( parser->open() )
{
SauvReader* reader = new SauvReader;
class SauvReader : public ParaMEDMEM::RefCountObject
{
public:
- MEDLOADER_EXPORT static SauvReader* New(const char *fileName);
+ MEDLOADER_EXPORT static SauvReader* New(const std::string& fileName);
MEDLOADER_EXPORT ParaMEDMEM::MEDFileData * loadInMEDFileDS();
MEDLOADER_EXPORT ~SauvReader();
*/
//================================================================================
-void SauvWriter::write(const char* fileName)
+void SauvWriter::write(const std::string& fileName)
{
std::fstream fileStream;
- fileStream.open( fileName, ios::out);
+ fileStream.open( fileName.c_str(), ios::out);
if
#ifdef WIN32
( !fileStream || !fileStream.is_open() )
public:
MEDLOADER_EXPORT static SauvWriter *New();
MEDLOADER_EXPORT void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0);
- MEDLOADER_EXPORT void write(const char* fileName);
+ MEDLOADER_EXPORT void write(const std::string& fileName);
MEDLOADER_EXPORT void setCpyGrpIfOnASingleFamilyStatus(bool status);
MEDLOADER_EXPORT bool getCpyGrpIfOnASingleFamilyStatus() const;
private:
static void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
static void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
static void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
- static void CheckFileForRead(const char *fileName) throw(INTERP_KERNEL::Exception);
- static std::vector<std::string> GetMeshNames(const char *fileName) throw(INTERP_KERNEL::Exception);
- static std::vector<std::string> GetMeshNamesOnField(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception);
- static std::vector<std::string> GetMeshGroupsNames(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
- static std::vector<std::string> GetMeshFamiliesNames(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
- static std::vector<std::string> GetMeshFamiliesNamesOnGroup(const char *fileName, const char *meshName, const char *grpName) throw(INTERP_KERNEL::Exception);
- static std::vector<std::string> GetMeshGroupsNamesOnFamily(const char *fileName, const char *meshName, const char *famName) throw(INTERP_KERNEL::Exception);
- static std::vector<std::string> GetAllFieldNamesOnMesh(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
- static std::vector<std::string> GetAllFieldNames(const char *fileName) throw(INTERP_KERNEL::Exception);
- static std::vector<std::string> GetFieldNamesOnMesh(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
- static std::vector<std::string> GetCellFieldNamesOnMesh(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
- static std::vector<std::string> GetNodeFieldNamesOnMesh(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
- static double GetTimeAttachedOnFieldIteration(const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
+ static void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
+ static std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
+ static std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
+ static std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
+ static std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
+ static std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
+ static std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
+ static std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
+ static std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
+ static std::vector<std::string> GetFieldNamesOnMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
+ static std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
+ static std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
+ static double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
static void AssignStaticWritePropertiesTo(ParaMEDMEM::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
%extend
{
return ret;
}
- static PyObject *GetFieldIterations(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName, const char *fieldName) throw(INTERP_KERNEL::Exception)
+ static PyObject *GetFieldIterations(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
{
std::vector< std::pair<int,int> > res=MEDLoader::GetFieldIterations(type,fileName,meshName,fieldName);
PyObject *ret=PyList_New(res.size());
return ret;
}
- static PyObject *GetAllFieldIterations(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception)
+ static PyObject *GetAllFieldIterations(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
{
std::vector< std::pair< std::pair<int,int>, double> > res=MEDLoader::GetAllFieldIterations(fileName,fieldName);
PyObject *ret=PyList_New(res.size());
return ret;
}
- static PyObject *GetCellFieldIterations(const char *fileName, const char *meshName, const char *fieldName) throw(INTERP_KERNEL::Exception)
+ static PyObject *GetCellFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
{
std::vector< std::pair<int,int> > res=MEDLoader::GetCellFieldIterations(fileName,meshName,fieldName);
PyObject *ret=PyList_New(res.size());
}
return ret;
}
- static PyObject *GetNodeFieldIterations(const char *fileName, const char *meshName, const char *fieldName) throw(INTERP_KERNEL::Exception)
+ static PyObject *GetNodeFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
{
std::vector< std::pair<int,int> > res=MEDLoader::GetNodeFieldIterations(fileName,meshName,fieldName);
PyObject *ret=PyList_New(res.size());
}
return ret;
}
- static PyObject *GetComponentsNamesOfField(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception)
+ static PyObject *GetComponentsNamesOfField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
{
std::vector< std::pair<std::string,std::string> > res=MEDLoader::GetComponentsNamesOfField(fileName,fieldName);
PyObject *ret=PyList_New(res.size());
}
return ret;
}
- static PyObject *GetUMeshGlobalInfo(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception)
+ static PyObject *GetUMeshGlobalInfo(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
{
int meshDim,spaceDim,numberOfNodes;
std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDLoader::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
return ret;
}
- static PyObject *ReadFieldsOnSameMesh(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName, int meshDimRelToMax,
- const char *fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
+ static PyObject *ReadFieldsOnSameMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
+ const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
{
std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> res=MEDLoader::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
return convertFieldDoubleVecToPy(res);
}
- static void WriteUMeshesPartition(const char *fileName, const char *meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
+ static void WriteUMeshesPartition(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
{
std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
MEDLoader::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
}
- static void WriteUMeshesPartitionDep(const char *fileName, const char *meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
+ static void WriteUMeshesPartitionDep(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
{
std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
MEDLoader::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
}
- static void WriteUMeshes(const char *fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
+ static void WriteUMeshes(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
{
std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
MEDLoader::WriteUMeshes(fileName,v,writeFromScratch);
}
- static PyObject *GetTypesOfField(const char *fileName, const char *meshName, const char *fieldName) throw(INTERP_KERNEL::Exception)
+ static PyObject *GetTypesOfField(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
{
std::vector< ParaMEDMEM::TypeOfField > v=MEDLoader::GetTypesOfField(fileName,meshName,fieldName);
int size=v.size();
PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
return ret;
}
- static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromGroups(const char *fileName, const char *meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
+ static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromGroups(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
{
std::vector<std::string> grps;
converPyListToVecString(li,grps);
return MEDLoader::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
}
- static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFamilies(const char *fileName, const char *meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
+ static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFamilies(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
{
std::vector<std::string> fams;
converPyListToVecString(li,fams);
return MEDLoader::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
}
}
- static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const char *fileName, const char *meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
- static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const char *fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
- static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const char *fileName, const char *meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
- static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const char *fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
- static int ReadUMeshDimFromFile(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
- static ParaMEDMEM::MEDCouplingFieldDouble *ReadField(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
- static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldCell(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
- static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldNode(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
- static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGauss(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
- static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGaussNE(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
- static void WriteMesh(const char *fileName, const ParaMEDMEM::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
- static void WriteUMesh(const char *fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
- static void WriteUMeshDep(const char *fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
- static void WriteField(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
- static void WriteFieldDep(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
- static void WriteFieldUsingAlreadyWrittenMesh(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
+ static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
+ static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
+ static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
+ static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
+ static int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
+ static ParaMEDMEM::MEDCouplingFieldDouble *ReadField(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
+ static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldCell(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
+ static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldNode(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
+ static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGauss(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
+ static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGaussNE(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
+ static void WriteMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
+ static void WriteUMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
+ static void WriteUMeshDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
+ static void WriteField(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
+ static void WriteFieldDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
+ static void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
};
namespace ParaMEDMEM
class MEDFileMesh : public RefCountObject, public MEDFileWritable
{
public:
- static MEDFileMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
- static MEDFileMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
+ static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
+ static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
virtual MEDFileMesh *deepCpy() const throw(INTERP_KERNEL::Exception);
virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
- void setName(const char *name);
+ void setName(const std::string& name);
std::string getName();
- const char *getUnivName() const;
+ std::string getUnivName() const;
bool getUnivNameWrStatus() const;
void setUnivNameWrStatus(bool newStatus);
- void setDescription(const char *name);
+ void setDescription(const std::string& name);
std::string getDescription() const;
void setOrder(int order);
int getOrder() const;
void setTimeValue(double time);
void setTime(int dt, int it, double time);
double getTimeValue() const;
- void setTimeUnit(const char *unit);
- const char *getTimeUnit() const;
+ void setTimeUnit(const std::string& unit);
+ std::string getTimeUnit() const;
virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
- void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
+ void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
//
- bool existsGroup(const char *groupName) const throw(INTERP_KERNEL::Exception);
+ bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
- bool existsFamily(const char *familyName) const throw(INTERP_KERNEL::Exception);
- void setFamilyId(const char *familyName, int id) throw(INTERP_KERNEL::Exception);
- void setFamilyIdUnique(const char *familyName, int id) throw(INTERP_KERNEL::Exception);
- void addFamily(const char *familyName, int id) throw(INTERP_KERNEL::Exception);
- void addFamilyOnGrp(const char *grpName, const char *famName) throw(INTERP_KERNEL::Exception);
- virtual void createGroupOnAll(int meshDimRelToMaxExt, const char *groupName) throw(INTERP_KERNEL::Exception);
+ bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
+ void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
+ void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
+ void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
+ void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
+ virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
void clearGrpMap() throw(INTERP_KERNEL::Exception);
void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
- std::vector<std::string> getFamiliesOnGroup(const char *name) const throw(INTERP_KERNEL::Exception);
+ std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
- std::vector<int> getFamiliesIdsOnGroup(const char *name) const throw(INTERP_KERNEL::Exception);
- void setFamiliesOnGroup(const char *name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
- void setFamiliesIdsOnGroup(const char *name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
- std::vector<std::string> getGroupsOnFamily(const char *name) const throw(INTERP_KERNEL::Exception);
- void setGroupsOnFamily(const char *famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
+ std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
+ void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
+ void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
+ std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
+ void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
- void removeGroup(const char *name) throw(INTERP_KERNEL::Exception);
- void removeFamily(const char *name) throw(INTERP_KERNEL::Exception);
+ void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
+ void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
- void changeGroupName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
- void changeFamilyName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
+ void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
+ void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
- void changeAllGroupsContainingFamily(const char *familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
+ void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
void setFamilyInfo(const std::map<std::string,int>& info);
void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
- int getFamilyId(const char *name) const throw(INTERP_KERNEL::Exception);
+ int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
- virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
- virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
- virtual DataArrayInt *getNodeGroupArr(const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
+ virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
+ virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
+ virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
- virtual DataArrayInt *getNodeFamilyArr(const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
+ virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
%extend
{
class MEDFileUMesh : public MEDFileMesh
{
public:
- static MEDFileUMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
- static MEDFileUMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
+ static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
+ static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
static MEDFileUMesh *New();
~MEDFileUMesh();
int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
//
- std::vector<int> getGrpNonEmptyLevels(const char *grp) const throw(INTERP_KERNEL::Exception);
- std::vector<int> getGrpNonEmptyLevelsExt(const char *grp) const throw(INTERP_KERNEL::Exception);
- std::vector<int> getFamNonEmptyLevels(const char *fam) const throw(INTERP_KERNEL::Exception);
- std::vector<int> getFamNonEmptyLevelsExt(const char *fam) const throw(INTERP_KERNEL::Exception);
+ std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
+ std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
+ std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
+ std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
- MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
- DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
+ MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
+ DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
- MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
- DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
+ MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
+ DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
- DataArrayInt *getNodeGroupArr(const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
+ DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
- DataArrayInt *getNodeFamilyArr(const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
+ DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
MEDCouplingUMesh *getMeshAtLevel(int meshDimRelToMaxExt, bool renum=false) const throw(INTERP_KERNEL::Exception);
MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
%extend
{
- MEDFileUMesh(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
+ MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
{
return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
}
- MEDFileUMesh(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
+ MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
{
return MEDFileUMesh::New(fileName,mrs);
}
return ret;
}
- PyObject *duplicateNodesOnM1Group(const char *grpNameM1) throw(INTERP_KERNEL::Exception)
+ PyObject *duplicateNodesOnM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
{
DataArrayInt *ret0=0,*ret1=0,*ret2=0;
self->duplicateNodesOnM1Group(grpNameM1,ret0,ret1,ret2);
{
public:
static MEDFileCMesh *New();
- static MEDFileCMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
- static MEDFileCMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
+ static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
+ static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
%extend
{
return MEDFileCMesh::New();
}
- MEDFileCMesh(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
+ MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
{
return MEDFileCMesh::New(fileName,mrs);
}
- MEDFileCMesh(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
+ MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
{
return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
}
{
public:
static MEDFileCurveLinearMesh *New();
- static MEDFileCurveLinearMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
- static MEDFileCurveLinearMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
+ static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
+ static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
%extend
{
return MEDFileCurveLinearMesh::New();
}
- MEDFileCurveLinearMesh(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
+ MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
{
return MEDFileCurveLinearMesh::New(fileName,mrs);
}
- MEDFileCurveLinearMesh(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
+ MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
{
return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
}
{
public:
static MEDFileMeshMultiTS *New();
- static MEDFileMeshMultiTS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
- static MEDFileMeshMultiTS *New(const char *fileName, const char *mName) throw(INTERP_KERNEL::Exception);
+ static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
+ static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
MEDFileMeshMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
std::string getName() const throw(INTERP_KERNEL::Exception);
- void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
+ void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
%extend
{
return MEDFileMeshMultiTS::New();
}
- MEDFileMeshMultiTS(const char *fileName) throw(INTERP_KERNEL::Exception)
+ MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
{
return MEDFileMeshMultiTS::New(fileName);
}
- MEDFileMeshMultiTS(const char *fileName, const char *mName) throw(INTERP_KERNEL::Exception)
+ MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
{
return MEDFileMeshMultiTS::New(fileName,mName);
}
{
public:
static MEDFileMeshes *New();
- static MEDFileMeshes *New(const char *fileName) throw(INTERP_KERNEL::Exception);
+ static MEDFileMeshes *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
MEDFileMeshes *deepCpy() const throw(INTERP_KERNEL::Exception);
- void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
+ void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
//
return MEDFileMeshes::New();
}
- MEDFileMeshes(const char *fileName) throw(INTERP_KERNEL::Exception)
+ MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
{
return MEDFileMeshes::New(fileName);
}
ret->incrRef();
return ret;
}
- MEDFileMesh *getMeshWithName(const char *mname) const throw(INTERP_KERNEL::Exception)
+ MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
{
MEDFileMesh *ret=self->getMeshWithName(mname);
if(ret)
void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
- bool existsPfl(const char *pflName) const throw(INTERP_KERNEL::Exception);
- bool existsLoc(const char *locName) const throw(INTERP_KERNEL::Exception);
+ bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
+ bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
- void changePflName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
- void changeLocName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
+ void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
+ void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
- int getLocalizationId(const char *loc) const throw(INTERP_KERNEL::Exception);
+ int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
%extend
{
- PyObject *getProfile(const char *pflName) const throw(INTERP_KERNEL::Exception)
+ PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
{
const DataArrayInt *ret=self->getProfile(pflName);
if(ret)
return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
}
- PyObject *getLocalization(const char *locName) const throw(INTERP_KERNEL::Exception)
+ PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
{
const MEDFileFieldLoc *loc=&self->getLocalization(locName);
if(loc)
class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
{
public:
- static MEDFileAnyTypeField1TS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
- static MEDFileAnyTypeField1TS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
- static MEDFileAnyTypeField1TS *New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
- void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
+ static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
+ static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
+ static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
+ void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
void loadArrays() throw(INTERP_KERNEL::Exception);
void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
void unloadArrays() throw(INTERP_KERNEL::Exception);
int getIteration() const throw(INTERP_KERNEL::Exception);
int getOrder() const throw(INTERP_KERNEL::Exception);
std::string getName() throw(INTERP_KERNEL::Exception);
- void setName(const char *name) throw(INTERP_KERNEL::Exception);
+ void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
std::string getMeshName() throw(INTERP_KERNEL::Exception);
- void setMeshName(const char *newMeshName) throw(INTERP_KERNEL::Exception);
+ void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
int getMeshIteration() const throw(INTERP_KERNEL::Exception);
int getMeshOrder() const throw(INTERP_KERNEL::Exception);
int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
MEDFileAnyTypeField1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
- void setDtUnit(const char *dtUnit) throw(INTERP_KERNEL::Exception);
+ void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
%extend
{
PyObject *getTime() throw(INTERP_KERNEL::Exception)
return elt;
}
- void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
+ void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
{
self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
}
- void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
+ void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
{
self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
}
return ret2;
}
- PyObject *getNonEmptyLevels(const char *mname=0) const throw(INTERP_KERNEL::Exception)
+ PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
{
std::vector<int> ret1;
int ret0=self->getNonEmptyLevels(mname,ret1);
return elt;
}
- PyObject *getFieldSplitedByType(const char *mname=0) const throw(INTERP_KERNEL::Exception)
+ PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
{
std::vector<INTERP_KERNEL::NormalizedCellType> types;
std::vector< std::vector<TypeOfField> > typesF;
class MEDFileField1TS : public MEDFileAnyTypeField1TS
{
public:
- static MEDFileField1TS *New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
- static MEDFileField1TS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
- static MEDFileField1TS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
+ static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
+ static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
+ static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
static MEDFileField1TS *New();
ParaMEDMEM::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const char *mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
//
void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
- void setProfileNameOnLeaf(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
- void setLocNameOnLeaf(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
+ void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
+ void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
%extend
{
- MEDFileField1TS(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
+ MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
{
return MEDFileField1TS::New(fileName,loadAll);
}
- MEDFileField1TS(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
+ MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
{
return MEDFileField1TS::New(fileName,fieldName,loadAll);
}
- MEDFileField1TS(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
+ MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
{
return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
}
return ret;
}
- PyObject *getFieldSplitedByType2(const char *mname=0) const throw(INTERP_KERNEL::Exception)
+ PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
{
std::vector<INTERP_KERNEL::NormalizedCellType> types;
std::vector< std::vector<TypeOfField> > typesF;
{
public:
static MEDFileIntField1TS *New();
- static MEDFileIntField1TS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
- static MEDFileIntField1TS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
- static MEDFileIntField1TS *New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
+ static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
+ static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
+ static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
ParaMEDMEM::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
//
void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
return MEDFileIntField1TS::New();
}
- MEDFileIntField1TS(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
+ MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
{
return MEDFileIntField1TS::New(fileName,loadAll);
}
- MEDFileIntField1TS(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
+ MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
{
return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
}
- MEDFileIntField1TS(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
+ MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
{
return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
}
return ret;
}
- PyObject *getFieldAtLevelOld(TypeOfField type, const char *mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
+ PyObject *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
{
DataArrayInt *ret1=0;
MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,mname,meshDimRelToMax,ret1,renumPol);
class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
{
public:
- static MEDFileAnyTypeFieldMultiTS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
- static MEDFileAnyTypeFieldMultiTS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
+ static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
+ static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
MEDFileAnyTypeFieldMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
std::string getName() const throw(INTERP_KERNEL::Exception);
- void setName(const char *name) throw(INTERP_KERNEL::Exception);
+ void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
- void setDtUnit(const char *dtUnit) throw(INTERP_KERNEL::Exception);
+ void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
std::string getMeshName() const throw(INTERP_KERNEL::Exception);
- void setMeshName(const char *newMeshName) throw(INTERP_KERNEL::Exception);
+ void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
- void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
+ void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
void loadArrays() throw(INTERP_KERNEL::Exception);
void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
void unloadArrays() throw(INTERP_KERNEL::Exception);
return ret2;
}
- PyObject *getNonEmptyLevels(int iteration, int order, const char *mname=0) const throw(INTERP_KERNEL::Exception)
+ PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
{
std::vector<int> ret1;
int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
return elt;
}
- PyObject *getFieldSplitedByType(int iteration, int order, const char *mname=0) const throw(INTERP_KERNEL::Exception)
+ PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
{
std::vector<INTERP_KERNEL::NormalizedCellType> types;
std::vector< std::vector<TypeOfField> > typesF;
{
public:
static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
- static MEDFileFieldMultiTS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
- static MEDFileFieldMultiTS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
+ static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
+ static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
//
MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
- MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const char *mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
//
void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
return MEDFileFieldMultiTS::New();
}
- MEDFileFieldMultiTS(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
+ MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
{
return MEDFileFieldMultiTS::New(fileName,loadAll);
}
- MEDFileFieldMultiTS(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
+ MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
{
return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
}
return ret;
}
- PyObject *getFieldSplitedByType2(int iteration, int order, const char *mname=0) const throw(INTERP_KERNEL::Exception)
+ PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
{
std::vector<INTERP_KERNEL::NormalizedCellType> types;
std::vector< std::vector<TypeOfField> > typesF;
{
public:
static MEDFileIntFieldMultiTS *New();
- static MEDFileIntFieldMultiTS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
- static MEDFileIntFieldMultiTS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
+ static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
+ static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
//
void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
return MEDFileIntFieldMultiTS::New();
}
- MEDFileIntFieldMultiTS(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
+ MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
{
return MEDFileIntFieldMultiTS::New(fileName,loadAll);
}
- MEDFileIntFieldMultiTS(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
+ MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
{
return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
}
return ret;
}
- PyObject *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const char *mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
+ PyObject *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
{
DataArrayInt *ret1=0;
MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,iteration,order,mname,meshDimRelToMax,ret1,renumPol);
{
public:
static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
- static MEDFileFields *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
+ static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
MEDFileFields *deepCpy() const throw(INTERP_KERNEL::Exception);
MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
void loadArrays() throw(INTERP_KERNEL::Exception);
void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
void unloadArrays() throw(INTERP_KERNEL::Exception);
- void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
+ void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
int getNumberOfFields() const;
std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
void resize(int newSize) throw(INTERP_KERNEL::Exception);
void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
- int getPosFromFieldName(const char *fieldName) const throw(INTERP_KERNEL::Exception);
+ int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
- MEDFileAnyTypeFieldMultiTS *getFieldWithName(const char *fieldName) const throw(INTERP_KERNEL::Exception);
- MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const char *meshName) const throw(INTERP_KERNEL::Exception);
+ MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
+ MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
%extend
{
return MEDFileFields::New();
}
- MEDFileFields(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
+ MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
{
return MEDFileFields::New(fileName,loadAll);
}
class MEDFileParameterTinyInfo : public MEDFileWritable
{
public:
- void setDescription(const char *name);
+ void setDescription(const std::string& name);
std::string getDescription() const;
- void setTimeUnit(const char *unit);
+ void setTimeUnit(const std::string& unit);
std::string getTimeUnit() const;
};
{
public:
static MEDFileParameterDouble1TS *New();
- static MEDFileParameterDouble1TS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
- static MEDFileParameterDouble1TS *New(const char *fileName, const char *paramName) throw(INTERP_KERNEL::Exception);
- static MEDFileParameterDouble1TS *New(const char *fileName, const char *paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
+ static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
+ static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
+ static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
virtual MEDFileParameter1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
- void setName(const char *name) throw(INTERP_KERNEL::Exception);
+ void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
std::string getName() const throw(INTERP_KERNEL::Exception);
- void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
+ void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
%extend
{
MEDFileParameterDouble1TS()
return MEDFileParameterDouble1TS::New();
}
- MEDFileParameterDouble1TS(const char *fileName) throw(INTERP_KERNEL::Exception)
+ MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
{
return MEDFileParameterDouble1TS::New(fileName);
}
- MEDFileParameterDouble1TS(const char *fileName, const char *paramName) throw(INTERP_KERNEL::Exception)
+ MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
{
return MEDFileParameterDouble1TS::New(fileName,paramName);
}
- MEDFileParameterDouble1TS(const char *fileName, const char *paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
+ MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
{
return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
}
{
public:
static MEDFileParameterMultiTS *New();
- static MEDFileParameterMultiTS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
- static MEDFileParameterMultiTS *New(const char *fileName, const char *paramName) throw(INTERP_KERNEL::Exception);
+ static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
+ static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
std::string getName() const;
- void setName(const char *name);
+ void setName(const std::string& name);
MEDFileParameterMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
- void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
+ void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
return MEDFileParameterMultiTS::New();
}
- MEDFileParameterMultiTS(const char *fileName)
+ MEDFileParameterMultiTS(const std::string& fileName)
{
return MEDFileParameterMultiTS::New(fileName);
}
- MEDFileParameterMultiTS(const char *fileName, const char *paramName)
+ MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
{
return MEDFileParameterMultiTS::New(fileName,paramName);
}
{
public:
static MEDFileParameters *New();
- static MEDFileParameters *New(const char *fileName) throw(INTERP_KERNEL::Exception);
+ static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
MEDFileParameters *deepCpy() const throw(INTERP_KERNEL::Exception);
- void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
+ void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
void resize(int newSize) throw(INTERP_KERNEL::Exception);
void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
- int getPosFromParamName(const char *paramName) const throw(INTERP_KERNEL::Exception);
+ int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
%extend
{
return MEDFileParameters::New();
}
- MEDFileParameters(const char *fileName)
+ MEDFileParameters(const std::string& fileName)
{
return MEDFileParameters::New(fileName);
}
return ret;
}
- MEDFileParameterMultiTS *getParamWithName(const char *paramName) const throw(INTERP_KERNEL::Exception)
+ MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
{
MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
if(ret)
class MEDFileData : public RefCountObject, public MEDFileWritable
{
public:
- static MEDFileData *New(const char *fileName) throw(INTERP_KERNEL::Exception);
+ static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
static MEDFileData *New();
MEDFileData *deepCpy() const throw(INTERP_KERNEL::Exception);
void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
//
- bool changeMeshName(const char *oldMeshName, const char *newMeshName) throw(INTERP_KERNEL::Exception);
+ bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
//
- void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
+ void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
%extend
{
- MEDFileData(const char *fileName) throw(INTERP_KERNEL::Exception)
+ MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
{
return MEDFileData::New(fileName);
}
class SauvReader : public RefCountObject
{
public:
- static SauvReader* New(const char *fileName) throw(INTERP_KERNEL::Exception);
+ static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
%extend
{
- SauvReader(const char *fileName) throw(INTERP_KERNEL::Exception)
+ SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
{
return SauvReader::New(fileName);
}
public:
static SauvWriter * New();
void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
- void write(const char* fileName) throw(INTERP_KERNEL::Exception);
+ void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
%extend
</mesh>\n \
</mapping>\n \
</root>\n";
- std::vector<std::string> meshNames=MEDLoader::GetMeshNames(myfile.c_str());
+ std::vector<std::string> meshNames=MEDLoader::GetMeshNames(myfile);
xml.replace(xml.find("$fileName"),9,myfile);
xml.replace(xml.find("$meshName"),9,meshNames[0]);
xml.replace(xml.find("$meshName"),9,meshNames[0]);
std::ostringstream oss;
oss<<name<<"_"<<i;
if (!isParallelMode() || _domain_selector->isMyDomain(i))
- _mesh[i]->setName(oss.str().c_str());
+ _mesh[i]->setName(oss.str());
}
}
ParaMEDMEM::DataArrayDouble *MEDPARTITIONER::MeshCollection::getField(std::string descriptionField, int iold)
//getField look for and read it if not done, and assume decrRef() in ~MeshCollection;
-//something like MEDCouplingFieldDouble *f2=MEDLoader::ReadFieldCell(name.c_str(),f1->getMesh()->getName(),0,f1->getName(),0,1);
+//something like MEDCouplingFieldDouble *f2=MEDLoader::ReadFieldCell(name,f1->getMesh()->getName(),0,f1->getName(),0,1);
{
int rank=MyGlobals::_Rank;
std::string tag="ioldFieldDouble="+IntToStr(iold);
meshName=MyGlobals::_Mesh_Names[iold];
ParaMEDMEM::MEDCouplingFieldDouble* f2=MEDLoader::ReadField((ParaMEDMEM::TypeOfField) typeField,
- fileName.c_str(), meshName.c_str(), 0, fieldName.c_str(), DT, IT);
+ fileName, meshName, 0, fieldName, DT, IT);
ParaMEDMEM::DataArrayDouble* res=f2->getArray();
//to know names of components
std::string meshname=MyGlobals::_Mesh_Names[idomain];
std::string file=MyGlobals::_File_Names[idomain];
- ParaMEDMEM::MEDFileUMesh* mfm=ParaMEDMEM::MEDFileUMesh::New(file.c_str(),meshname.c_str());
+ ParaMEDMEM::MEDFileUMesh* mfm=ParaMEDMEM::MEDFileUMesh::New(file,meshname);
std::vector<int> nonEmpty=mfm->getNonEmptyLevels();
try
std::string meshname=MyGlobals::_Mesh_Names[idomain];
std::string file=MyGlobals::_File_Names[idomain];
- ParaMEDMEM::MEDFileUMesh* mfm=ParaMEDMEM::MEDFileUMesh::New(file.c_str(),meshname.c_str());
+ ParaMEDMEM::MEDFileUMesh* mfm=ParaMEDMEM::MEDFileUMesh::New(file,meshname);
std::vector<int> nonEmpty=mfm->getNonEmptyLevels();
try
// faceMeshFilter=(ParaMEDMEM::MEDCouplingUMesh *) faceMesh->buildPartOfMySelf(index,index+filter->getNbOfElems(),true);
// faceMesh=faceMeshFilter;
// }
- cellMesh->setName(finalMeshName.c_str());
+ cellMesh->setName(finalMeshName);
meshes.push_back(cellMesh);
faceMesh->checkCoherency();
// boundaryMesh->setName("boundaryMesh");
// }
- MEDLoader::WriteUMeshes(distfilename.c_str(), meshes, true);
+ MEDLoader::WriteUMeshes(distfilename, meshes, true);
// if (faceMeshFilter!=0)
// faceMeshFilter->decrRef();
// if (boundaryMesh!=0)
// {
// //doing that testMesh becomes second mesh sorted by alphabetical order of name
- // MEDLoader::WriteUMesh(distfilename.c_str(), boundaryMesh, false);
+ // MEDLoader::WriteUMesh(distfilename, boundaryMesh, false);
// boundaryMesh->decrRef();
// }
- ParaMEDMEM::MEDFileUMesh* mfm=ParaMEDMEM::MEDFileUMesh::New(distfilename.c_str(), _collection->getMesh(idomain)->getName().c_str());
+ ParaMEDMEM::MEDFileUMesh* mfm=ParaMEDMEM::MEDFileUMesh::New(distfilename, _collection->getMesh(idomain)->getName());
mfm->setFamilyInfo(_collection->getFamilyInfo());
mfm->setGroupInfo(_collection->getGroupInfo());
if (_collection->getMapDataArrayInt().find(key)!=_collection->getMapDataArrayInt().end())
mfm->setFamilyFieldArr(0,_collection->getMapDataArrayInt().find(key)->second);
- mfm->write(distfilename.c_str(),0);
+ mfm->write(distfilename,0);
key="/inewFieldDouble="+IntToStr(idomain)+"/";
std::map<std::string,ParaMEDMEM::DataArrayDouble*>::iterator it;
continue;
}
nbfFieldFound++;
- field->setName(fieldName.c_str());
+ field->setName(fieldName);
field->setMesh(mfm->getLevel0Mesh(false));
ParaMEDMEM::DataArrayDouble *da=(*it).second;
r1=SelectTagsInVectorOfString(r1,"typeField="+IntToStr(typeField));
r1=SelectTagsInVectorOfString(r1,"DT="+IntToStr(DT));
r1=SelectTagsInVectorOfString(r1,"IT="+IntToStr(IT));
- //not saved in file? field->setDescription(ExtractFromDescription(r1[0], "fieldDescription=").c_str());
+ //not saved in file? field->setDescription(ExtractFromDescription(r1[0], "fieldDescription="));
int nbc=StrToInt(ExtractFromDescription(r1[0], "nbComponents="));
if (nbc==da->getNumberOfComponents())
{
for (int i=0; i<nbc; i++)
- da->setInfoOnComponent(i,ExtractFromDescription(r1[0], "componentInfo"+IntToStr(i)+"=").c_str());
+ da->setInfoOnComponent(i,ExtractFromDescription(r1[0], "componentInfo"+IntToStr(i)+"="));
}
else
{
field->checkCoherency();
try
{
- MEDLoader::WriteField(distfilename.c_str(),field,false);
+ MEDLoader::WriteField(distfilename,field,false);
}
catch(INTERP_KERNEL::Exception& e)
{
tmp+="_"+fieldName+"_"+IntToStr(nbfFieldFound)+".med";
newName.replace(newName.find(".med"),4,tmp);
std::cout << "WARNING : writeMedFile : create a new file name with only one field because MEDLoader::WriteField throw:" << newName << std::endl;
- MEDLoader::WriteField(newName.c_str(),field,true);
+ MEDLoader::WriteField(newName,field,true);
}
}
mfm->decrRef();
std::vector<std::string> MEDPARTITIONER::BrowseAllFields(const std::string& myfile)
{
std::vector<std::string> res;
- std::vector<std::string> meshNames=MEDLoader::GetMeshNames(myfile.c_str());
+ std::vector<std::string> meshNames=MEDLoader::GetMeshNames(myfile);
for (std::size_t i=0; i<meshNames.size(); i++)
{
std::vector<std::string> fieldNames=
- MEDLoader::GetAllFieldNamesOnMesh(myfile.c_str(),meshNames[i].c_str());
+ MEDLoader::GetAllFieldNamesOnMesh(myfile,meshNames[i]);
for (std::size_t j = 0; j < fieldNames.size(); j++)
{
std::vector< ParaMEDMEM::TypeOfField > typeFields=
- MEDLoader::GetTypesOfField(myfile.c_str(), meshNames[i].c_str(), fieldNames[j].c_str());
+ MEDLoader::GetTypesOfField(myfile, meshNames[i], fieldNames[j]);
for (std::size_t k = 0; k < typeFields.size(); k++)
{
std::vector< std::pair< int, int > > its=
- MEDLoader::GetFieldIterations(typeFields[k], myfile.c_str(), meshNames[i].c_str(), fieldNames[j].c_str());
+ MEDLoader::GetFieldIterations(typeFields[k], myfile, meshNames[i], fieldNames[j]);
if (MyGlobals::_Is0verbose>100)
std::cout<< "fieldName " << fieldNames[j] << " typeField " << typeFields[k] << " its.size() " << its.size() << std::endl;
for (std::size_t m = 0; m < its.size(); m++)
{
MEDCouplingNormalizedUnstructuredMesh<2,2> source_mesh_wrapper(source_supportC);
INTERP_KERNEL::Interpolation2D interpolation(*this);
- interpolation.fromIntegralUniform(source_mesh_wrapper,surfaces,srcMeth.c_str());
+ interpolation.fromIntegralUniform(source_mesh_wrapper,surfaces,srcMeth);
}
else if(source_supportC->getMeshDimension()==3 && source_supportC->getSpaceDimension()==3)
{
MEDCouplingNormalizedUnstructuredMesh<3,3> source_mesh_wrapper(source_supportC);
INTERP_KERNEL::Interpolation3D interpolation(*this);
- interpolation.fromIntegralUniform(source_mesh_wrapper,surfaces,srcMeth.c_str());
+ interpolation.fromIntegralUniform(source_mesh_wrapper,surfaces,srcMeth);
}
else if(source_supportC->getMeshDimension()==2 && source_supportC->getSpaceDimension()==3)
{
MEDCouplingNormalizedUnstructuredMesh<3,2> source_mesh_wrapper(source_supportC);
INTERP_KERNEL::Interpolation3DSurf interpolation(*this);
- interpolation.fromIntegralUniform(source_mesh_wrapper,surfaces,srcMeth.c_str());
+ interpolation.fromIntegralUniform(source_mesh_wrapper,surfaces,srcMeth);
}
else
throw INTERP_KERNEL::Exception("No para interpolation available for the given mesh and space dimension of source mesh to -1D targetMesh");
{
MEDCouplingNormalizedUnstructuredMesh<2,2> distant_mesh_wrapper(distant_supportC);
INTERP_KERNEL::Interpolation2D interpolation(*this);
- interpolation.toIntegralUniform(distant_mesh_wrapper,surfaces,srcMeth.c_str());
+ interpolation.toIntegralUniform(distant_mesh_wrapper,surfaces,srcMeth);
}
else if(distant_supportC->getMeshDimension()==3 && distant_supportC->getSpaceDimension()==3)
{
MEDCouplingNormalizedUnstructuredMesh<3,3> distant_mesh_wrapper(distant_supportC);
INTERP_KERNEL::Interpolation3D interpolation(*this);
- interpolation.toIntegralUniform(distant_mesh_wrapper,surfaces,srcMeth.c_str());
+ interpolation.toIntegralUniform(distant_mesh_wrapper,surfaces,srcMeth);
}
else if(distant_supportC->getMeshDimension()==2 && distant_supportC->getSpaceDimension()==3)
{
MEDCouplingNormalizedUnstructuredMesh<3,2> distant_mesh_wrapper(distant_supportC);
INTERP_KERNEL::Interpolation3DSurf interpolation(*this);
- interpolation.toIntegralUniform(distant_mesh_wrapper,surfaces,srcMeth.c_str());
+ interpolation.toIntegralUniform(distant_mesh_wrapper,surfaces,srcMeth);
}
else
throw INTERP_KERNEL::Exception("No para interpolation available for the given mesh and space dimension of distant mesh to -1D sourceMesh");
MEDCouplingNormalizedUnstructuredMesh<3,3> target_wrapper(distant_supportC);
MEDCouplingNormalizedUnstructuredMesh<3,3> source_wrapper(source_supportC);
INTERP_KERNEL::Interpolation3D2D interpolator (*this);
- interpolator.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod.c_str());
+ interpolator.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod);
target_wrapper.releaseTempArrays();
source_wrapper.releaseTempArrays();
}
MEDCouplingNormalizedUnstructuredMesh<2,2> target_wrapper(distant_supportC);
MEDCouplingNormalizedUnstructuredMesh<2,2> source_wrapper(source_supportC);
INTERP_KERNEL::Interpolation2D1D interpolator (*this);
- interpolator.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod.c_str());
+ interpolator.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod);
target_wrapper.releaseTempArrays();
source_wrapper.releaseTempArrays();
}
MEDCouplingNormalizedUnstructuredMesh<1,1> source_wrapper(source_supportC);
INTERP_KERNEL::Interpolation1D interpolation(*this);
- interpolation.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod.c_str());
+ interpolation.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod);
target_wrapper.releaseTempArrays();
source_wrapper.releaseTempArrays();
}
MEDCouplingNormalizedUnstructuredMesh<2,1> source_wrapper(source_supportC);
INTERP_KERNEL::Interpolation2DCurve interpolation(*this);
- interpolation.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod.c_str());
+ interpolation.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod);
target_wrapper.releaseTempArrays();
source_wrapper.releaseTempArrays();
}
MEDCouplingNormalizedUnstructuredMesh<3,2> source_wrapper(source_supportC);
INTERP_KERNEL::Interpolation3DSurf interpolator (*this);
- interpolator.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod.c_str());
+ interpolator.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod);
target_wrapper.releaseTempArrays();
source_wrapper.releaseTempArrays();
}
MEDCouplingNormalizedUnstructuredMesh<2,2> source_wrapper(source_supportC);
INTERP_KERNEL::Interpolation2D interpolator (*this);
- interpolator.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod.c_str());
+ interpolator.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod);
target_wrapper.releaseTempArrays();
source_wrapper.releaseTempArrays();
}
MEDCouplingNormalizedUnstructuredMesh<3,3> source_wrapper(source_supportC);
INTERP_KERNEL::Interpolation3D interpolator (*this);
- interpolator.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod.c_str());
+ interpolator.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod);
target_wrapper.releaseTempArrays();
source_wrapper.releaseTempArrays();
}
fvm_nodal_t* medmemMeshToFVMMesh(const MEDMEM::MESH* mesh)
{
// create an FVM structure from the paramesh structure
- fvm_nodal_t * fvm_nodal = fvm_nodal_create(mesh->getName().c_str(),mesh->getMeshDimension());
+ std::string meshName(mesh->getName());//this line avoid that mesh->getName() object killed before fvm_nodal_create read the const char *.
+ fvm_nodal_t * fvm_nodal = fvm_nodal_create(meshName.c_str(),mesh->getMeshDimension());
//loop on cell types
int nbtypes = mesh->getNumberOfTypes(MED_EN::MED_CELL);
{
// create an FVM structure from the paramesh structure
- fvm_nodal_t * fvm_nodal = fvm_nodal_create(support->getName().c_str(),1);
+ std::string supportName(support->getName());//this line avoid that support->getName() object killed before fvm_nodal_create read the const char *.
+ fvm_nodal_t * fvm_nodal = fvm_nodal_create(supportName.c_str(),1);
const MEDMEM::MESH* mesh= support->getMesh();
{
MEDCouplingNormalizedUnstructuredMesh<2,2> target_mesh_wrapper(trgC);
INTERP_KERNEL::Interpolation2D interpolation(*this);
- colSize=interpolation.fromIntegralUniform(target_mesh_wrapper,surfaces,trgMeth.c_str());
+ colSize=interpolation.fromIntegralUniform(target_mesh_wrapper,surfaces,trgMeth);
}
else if(trgC->getMeshDimension()==3 && trgC->getSpaceDimension()==3)
{
MEDCouplingNormalizedUnstructuredMesh<3,3> target_mesh_wrapper(trgC);
INTERP_KERNEL::Interpolation3D interpolation(*this);
- colSize=interpolation.fromIntegralUniform(target_mesh_wrapper,surfaces,trgMeth.c_str());
+ colSize=interpolation.fromIntegralUniform(target_mesh_wrapper,surfaces,trgMeth);
}
else if(trgC->getMeshDimension()==2 && trgC->getSpaceDimension()==3)
{
MEDCouplingNormalizedUnstructuredMesh<3,2> target_mesh_wrapper(trgC);
INTERP_KERNEL::Interpolation3DSurf interpolation(*this);
- colSize=interpolation.fromIntegralUniform(target_mesh_wrapper,surfaces,trgMeth.c_str());
+ colSize=interpolation.fromIntegralUniform(target_mesh_wrapper,surfaces,trgMeth);
}
else
throw INTERP_KERNEL::Exception("No para interpolation available for the given mesh and space dimension of source mesh to -1D targetMesh");
{
MEDCouplingNormalizedUnstructuredMesh<2,2> local_mesh_wrapper(srcC);
INTERP_KERNEL::Interpolation2D interpolation(*this);
- colSize=interpolation.toIntegralUniform(local_mesh_wrapper,surfaces,srcMeth.c_str());
+ colSize=interpolation.toIntegralUniform(local_mesh_wrapper,surfaces,srcMeth);
}
else if(srcC->getMeshDimension()==3 && srcC->getSpaceDimension()==3)
{
MEDCouplingNormalizedUnstructuredMesh<3,3> local_mesh_wrapper(srcC);
INTERP_KERNEL::Interpolation3D interpolation(*this);
- colSize=interpolation.toIntegralUniform(local_mesh_wrapper,surfaces,srcMeth.c_str());
+ colSize=interpolation.toIntegralUniform(local_mesh_wrapper,surfaces,srcMeth);
}
else if(srcC->getMeshDimension()==2 && srcC->getSpaceDimension()==3)
{
MEDCouplingNormalizedUnstructuredMesh<3,2> local_mesh_wrapper(srcC);
INTERP_KERNEL::Interpolation3DSurf interpolation(*this);
- colSize=interpolation.toIntegralUniform(local_mesh_wrapper,surfaces,srcMeth.c_str());
+ colSize=interpolation.toIntegralUniform(local_mesh_wrapper,surfaces,srcMeth);
}
else
throw INTERP_KERNEL::Exception("No para interpolation available for the given mesh and space dimension of distant mesh to -1D sourceMesh");
MEDCouplingNormalizedUnstructuredMesh<3,3> source_wrapper(srcC);
INTERP_KERNEL::Interpolation3D2D interpolator (*this);
- colSize=interpolator.interpolateMeshes(source_wrapper,target_wrapper,surfaces,interpMethod.c_str());
+ colSize=interpolator.interpolateMeshes(source_wrapper,target_wrapper,surfaces,interpMethod);
target_wrapper.releaseTempArrays();
source_wrapper.releaseTempArrays();
}
INTERP_KERNEL::Interpolation3D2D interpolator (*this);
vector<map<int,double> > surfacesTranspose;
- colSize=interpolator.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod.c_str());//not a bug target in source.
+ colSize=interpolator.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod);//not a bug target in source.
TransposeMatrix(surfacesTranspose,colSize,surfaces);
colSize=surfacesTranspose.size();
target_wrapper.releaseTempArrays();
MEDCouplingNormalizedUnstructuredMesh<2,2> source_wrapper(srcC);
INTERP_KERNEL::Interpolation2D1D interpolator (*this);
- colSize=interpolator.interpolateMeshes(source_wrapper,target_wrapper,surfaces,interpMethod.c_str());
+ colSize=interpolator.interpolateMeshes(source_wrapper,target_wrapper,surfaces,interpMethod);
target_wrapper.releaseTempArrays();
source_wrapper.releaseTempArrays();
}
INTERP_KERNEL::Interpolation2D1D interpolator (*this);
vector<map<int,double> > surfacesTranspose;
- colSize=interpolator.interpolateMeshes(target_wrapper,source_wrapper,surfacesTranspose,interpMethod.c_str());//not a bug target in source.
+ colSize=interpolator.interpolateMeshes(target_wrapper,source_wrapper,surfacesTranspose,interpMethod);//not a bug target in source.
TransposeMatrix(surfacesTranspose,colSize,surfaces);
colSize=surfacesTranspose.size();
target_wrapper.releaseTempArrays();
MEDCouplingNormalizedUnstructuredMesh<1,1> source_wrapper(srcC);
INTERP_KERNEL::Interpolation1D interpolation(*this);
- colSize=interpolation.interpolateMeshes(source_wrapper,target_wrapper,surfaces,interpMethod.c_str());
+ colSize=interpolation.interpolateMeshes(source_wrapper,target_wrapper,surfaces,interpMethod);
target_wrapper.releaseTempArrays();
source_wrapper.releaseTempArrays();
}
MEDCouplingNormalizedUnstructuredMesh<2,1> source_wrapper(srcC);
INTERP_KERNEL::Interpolation2DCurve interpolation(*this);
- colSize=interpolation.interpolateMeshes(source_wrapper,target_wrapper,surfaces,interpMethod.c_str());
+ colSize=interpolation.interpolateMeshes(source_wrapper,target_wrapper,surfaces,interpMethod);
target_wrapper.releaseTempArrays();
source_wrapper.releaseTempArrays();
}
MEDCouplingNormalizedUnstructuredMesh<3,2> source_wrapper(srcC);
INTERP_KERNEL::Interpolation3DSurf interpolator (*this);
- colSize=interpolator.interpolateMeshes(source_wrapper,target_wrapper,surfaces,interpMethod.c_str());
+ colSize=interpolator.interpolateMeshes(source_wrapper,target_wrapper,surfaces,interpMethod);
target_wrapper.releaseTempArrays();
source_wrapper.releaseTempArrays();
}
MEDCouplingNormalizedUnstructuredMesh<2,2> source_wrapper(srcC);
INTERP_KERNEL::Interpolation2D interpolator (*this);
- colSize=interpolator.interpolateMeshes(source_wrapper,target_wrapper,surfaces,interpMethod.c_str());
+ colSize=interpolator.interpolateMeshes(source_wrapper,target_wrapper,surfaces,interpMethod);
target_wrapper.releaseTempArrays();
source_wrapper.releaseTempArrays();
}
MEDCouplingNormalizedUnstructuredMesh<3,3> source_wrapper(srcC);
INTERP_KERNEL::Interpolation3D interpolator (*this);
- colSize=interpolator.interpolateMeshes(source_wrapper,target_wrapper,surfaces,interpMethod.c_str());
+ colSize=interpolator.interpolateMeshes(source_wrapper,target_wrapper,surfaces,interpMethod);
target_wrapper.releaseTempArrays();
source_wrapper.releaseTempArrays();
}
}
// Reading file structure
cout << "Reading : " << flush;
- MEDCouplingAutoRefCountObjectPtr<MEDFileData> fd=MEDFileData::New(filename_in.c_str());
- MEDFileMesh *m=fd->getMeshes()->getMeshWithName(meshname.c_str());
+ MEDCouplingAutoRefCountObjectPtr<MEDFileData> fd(MEDFileData::New(filename_in));
+ MEDFileMesh *m=fd->getMeshes()->getMeshWithName(meshname);
MEDFileUMesh *mc=dynamic_cast<MEDFileUMesh *>(m);
if(!mc)
{
MEDCouplingAutoRefCountObjectPtr<DataArrayInt> famField2=famField->renumber(perm->begin());
mc->setFamilyFieldArr(0,famField2);
}
- mc->write(filename_out.c_str(),2);
+ mc->write(filename_out,2);
t_family=clock();
cout << " : " << (t_family-t_compute_graph)/(double) CLOCKS_PER_SEC << "s" << endl << flush;
// Fields
}
}
}
- fs->write(filename_out.c_str(),0);
- //fs->renumberEntitiesLyingOnMesh(meshname.c_str(),code,code,o2n); bugged
+ fs->write(filename_out,0);
+ //fs->renumberEntitiesLyingOnMesh(meshname,code,code,o2n); bugged
}
t_field=clock();
cout << " : " << (t_field-t_family)/(double) CLOCKS_PER_SEC << "s" << endl << flush;