--- /dev/null
+// Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// This file contains some code used only for
+// generation of documentation for inline methods.
+
+
+namespace ParaMEDMEM
+{
+ /*!
+ * Checks if \a this field is correctly defined, else an exception is thrown.
+ * \throw If the mesh is not set.
+ * \throw If the data array is not set.
+ * \throw If the spatial discretization of \a this field is NULL.
+ * \throw If \a this->getTimeTolerance() < 0.
+ * \throw If the temporal discretization data is incorrect.
+ * \throw If mesh data does not correspond to field data.
+ */
+ void MEDCouplingField::checkCoherency() const throw(INTERP_KERNEL::Exception) {}
+ /*!
+ * Returns the underlying mesh of \a this field.
+ * \return const ParaMEDMEM::MEDCouplingMesh * - a const pointer to the underlying mesh.
+ */
+ const ParaMEDMEM::MEDCouplingMesh *MEDCouplingField::getMesh() const {}
+ /*!
+ * Returns the description of \a this field.
+ * \return const char * - a string containing the field description.
+ */
+ const char *MEDCouplingField::getDescription() const {}
+ /*!
+ * Sets the description of \a this field.
+ * \param [in] desc - a string containing the field description.
+ */
+ void MEDCouplingField::setDescription(const char *desc) {}
+ /*!
+ * Returns the name of \a this field.
+ * \return const char * - a string containing the field name.
+ */
+ const char *MEDCouplingField::getName() const {}
+}
*/
void MEDCouplingPointSet::tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception) {}
- //! This method returns directly the array in \a this \b without incrementing ref counter. The pointer is dealed by the mesh. The caller should not deal (decrRef) with this pointer
+ /*!
+ * Returns a const pointer to the node coordinates array of \a this mesh \b without
+ * incrementing its reference counter, thus there is no need to decrRef() it by the caller.
+ */
const DataArrayDouble *MEDCouplingPointSet::getCoords() const { return _coords; }
- //! This method returns directly the array in \a this \b without incrementing ref counter. The pointer is dealed by the mesh. The caller should not deal (decrRef) with this pointer
+ /*!
+ * Returns a pointer to the node coordinates array of \a this mesh \b without
+ * incrementing its reference counter, thus there is no need to decrRef() it by the caller.
+ */
DataArrayDouble *MEDCouplingPointSet::getCoords() { return _coords; }
--- /dev/null
+// MEDFileFieldGlobsReal::Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// This file contains some code used only for
+// generation of documentation for inline methods.
+
+
+namespace ParaMEDMEM // inline methods of MEDFileField1TSWithoutSDA
+{
+ /*!
+ * Returns the number of iteration where \a this field has been calculated.
+ * \return int - the iteration number.
+ */
+ int MEDFileField1TSWithoutSDA::getIteration() const {}
+ /*!
+ * Returns the order number of iteration where \a this field has been calculated.
+ * \return int - the order number.
+ */
+ int MEDFileField1TSWithoutSDA::getOrder() const {}
+ /*!
+ * Returns time, number of iteration and order number of iteration when
+ * \a this field has been calculated.
+ * \param [out] iteration - the iteration number.
+ * \param [out] order - the order number.
+ * \return double - the time value.
+ */
+ double MEDFileField1TSWithoutSDA::getTime(int& iteration, int& order) const {}
+ /*!
+ * Sets time, number of iteration and order number of iteration when
+ * \a this field has been calculated.
+ * \param [in] val - the time value.
+ * \param [in] iteration - the iteration number.
+ * \param [in] order - the order number.
+ */
+ void MEDFileField1TSWithoutSDA::setTime(int iteration, int order, double val) {}
+ /*!
+ * Returns units in which the time is measured.
+ * \return const char * - the time unit name.
+ */
+ const std::string& MEDFileField1TSWithoutSDA::getDtUnit() const {}
+}
+
+namespace ParaMEDMEM // inline methods of MEDFileFieldGlobsReal
+{
+ /*!
+ * Returns non empty names of all used profiles. To get all profiles call getPfls().
+ * \warning If a profile is used several times, its name is returned **only once**.
+ * To have a profile name in the result each time it is used, call
+ * getPflsReallyUsedMulti().
+ * \return std::vector<std::string> - a sequence of names of used profiles.
+ */
+ std::vector<std::string> MEDFileFieldGlobsReal::getPflsReallyUsed() const {}
+ /*!
+ * Returns non empty names of all used localizations. To get all localizations call getLocs().
+ * \warning If a localization is used several times, its name is returned **only once**.
+ * To have a localization name in the result each time it is used, call
+ * getLocsReallyUsedMulti().
+ * \return std::vector<std::string> - a sequence of names of used localizations.
+ */
+ std::vector<std::string> MEDFileFieldGlobsReal::getLocsReallyUsed() const {}
+ /*!
+ * Returns non empty names of all used profiles as many times as they are used.
+ * \return std::vector<std::string> - a sequence of names of used profiles.
+ */
+ std::vector<std::string> MEDFileFieldGlobsReal::getPflsReallyUsedMulti() const {}
+ /*!
+ * Returns non empty names of all used localizations as many times as they are used.
+ * \return std::vector<std::string> - a sequence of names of used localizations.
+ */
+ std::vector<std::string> MEDFileFieldGlobsReal::getLocsReallyUsedMulti() const {}
+ /*!
+ * Replaces references to some profiles (a reference is a profile name) by references
+ * to other profiles.
+ * \param [in] mapOfModif - a sequence describing required replacements. Each element of
+ * this sequence is a pair whose
+ * - the first item is a vector of profile names to replace by the second item,
+ * - the second item is a profile name to replace every profile of the first item.
+ */
+ void MEDFileFieldGlobsReal::changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception) {}
+ /*!
+ * Replaces references to some localizations (a reference is a localization name) by references
+ * to other localizations.
+ * \param [in] mapOfModif - a sequence describing required replacements. Each element of
+ * this sequence is a pair whose
+ * - the first item is a vector of localization names to replace by the second item,
+ * - the second item is a localization name to replace every localization of the first
+ * item.
+ */
+ void MEDFileFieldGlobsReal::changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception) {}
+}
--- /dev/null
+// Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// This file contains some code used only for
+// * generation of documentation for inline methods,
+// * groupping methods into "Basic API", "Advanced" and "Others..." sections
+
+
+namespace ParaMEDMEM
+{
+ /*!
+ * Sets the name of \a this mesh.
+ * \param [in] name - the new mesh name.
+ */
+ void MEDFileMesh::setName(const char *name) {}
+ /*!
+ * Returns the name of \a this mesh.
+ * \return const char* name - the mesh name.
+ */
+ const char *MEDFileMesh::getName() const {}
+ /*!
+ * Sets the universal name of \a this mesh. The universal name uniquely identifies the mesh.
+ * \param [in] name - the new universal mesh name.
+ */
+ void MEDFileMesh::setUnivName(const char *name) {}
+ /*!
+ * Returns the universal name of \a this mesh. The universal name uniquely identifies the mesh.
+ * \return const char * - the universal mesh name.
+ */
+ const char *MEDFileMesh::getUnivName() const {}
+ /*!
+ * Sets the description of \a this mesh.
+ * \param [in] name - the new mesh description.
+ */
+ void MEDFileMesh::setDescription(const char *name) {}
+ /*!
+ * Returns the description of \a this mesh.
+ * \return const char* - the mesh description.
+ */
+ const char *MEDFileMesh::getDescription() const {}
+ /*!
+ * Sets the order number of iteration of \a this mesh state.
+ * \param [in] order - the order number.
+ */
+ void MEDFileMesh::setOrder(int order) {}
+ /*!
+ * Returns the order number of iteration of \a this mesh state.
+ * \return int - the order number.
+ */
+ int MEDFileMesh::getOrder() const {}
+ /*!
+ * Sets the number of iteration of \a this mesh state.
+ * \param [in] it - the iteration number.
+ */
+ void MEDFileMesh::setIteration(int it) {}
+ /*!
+ * Returns the number of iteration of \a this mesh state.
+ * \return int - the iteration number.
+ */
+ int MEDFileMesh::getIteration() const {}
+ /*!
+ * Sets the time of \a this mesh state.
+ * \param [in] val - the time value.
+ */
+ void MEDFileMesh::setTimeValue(double time) {}
+ /*!
+ * Sets time, the number of iteration and the order number of iteration
+ * of \a this mesh state.
+ * \param [in] val - the time value.
+ * \param [in] iteration - the iteration number.
+ * \param [in] order - the order number.
+ */
+ void MEDFileMesh::setTime(int dt, int it, double time) {}
+ /*!
+ * Returns time, the number of iteration and the order number of iteration
+ * of \a this mesh state.
+ * \param [out] iteration - the iteration number.
+ * \param [out] order - the order number.
+ * \return double - the time value.
+ */
+ double MEDFileMesh::getTime(int& dt, int& it) {}
+ /*!
+ * Returns the time of \a this mesh state.
+ * \return double - the time value.
+ */
+ double MEDFileMesh::getTimeValue() const {}
+ /*!
+ * Sets units in which the time is measured.
+ * \param [in] unit - the time unit name.
+ */
+ void MEDFileMesh::setTimeUnit(const char *unit) {}
+ /*!
+ * Returns units in which the time is measured.
+ * \return const char * - the time unit name.
+ */
+ const char *MEDFileMesh::getTimeUnit() const {}
+ /*!
+ * Returns names and ids of all families in \a this mesh.
+ * \return const std::map<std::string,int>& - a map of a family name to a family id.
+ */
+ const std::map<std::string,int>& MEDFileMesh::getFamilyInfo() const {}
+ /*!
+ * Returns names of all groups and families constituting them in \a this mesh.
+ * \return const std::map<std::string, std::vector<std::string> >& -
+ * a map of a group name to a vector of names of families constituting the group.
+ */
+ const std::map<std::string, std::vector<std::string> >& MEDFileMesh::getGroupInfo() const {}
+ /*!
+ * Returns relative dimensions of mesh entities (excluding nodes) present in \a this mesh.
+ * \return std::vector<int> - a sequence of the relative dimensions.
+ */
+ std::vector<int> MEDFileMesh::getNonEmptyLevels() const {}
+ /*!
+ * Returns relative dimensions of mesh entities (including nodes) present in \a this mesh.
+ * \return std::vector<int> - a sequence of the relative dimensions.
+ */
+ std::vector<int> MEDFileMesh::getNonEmptyLevelsExt() const {}
+ /*!
+ * Returns number of mesh entities of a given relative dimension in \a this mesh.
+ * \param [in] meshDimRelToMaxExt - the relative dimension of interest.
+ * \return int - the number of entities.
+ * \throw If no mesh entities of dimension \a meshDimRelToMaxExt are available in \a this mesh.
+ */
+ int MEDFileMesh::getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception) {}
+ /*!
+ * Returns a MEDCouplingMesh of a given relative dimension.
+ * \param [in] meshDimRelToMax - the relative dimension of interest.
+ * \param [in] renum - if \c true, the returned mesh is permuted according to the
+ * optional numbers of mesh entities.
+ * \return MEDCouplingMesh * - a pointer to MEDCouplingMesh that the caller is to
+ * delete using decrRef() as it is no more needed.
+ * \throw If there are no mesh entities of \a meshDimRelToMaxExt dimension in \a this mesh.
+ * \throw If \a renum == \c true but permutation is impossible.
+ */
+ MEDCouplingMesh *MEDFileMesh::getGenMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception) {}
+ /*!
+ * Returns the dimension on cells in \a this mesh.
+ * \return int - the mesh dimension.
+ * \throw If there are no cells in this mesh.
+ */
+ int MEDFileMesh::getMeshDimension() const throw(INTERP_KERNEL::Exception) {}
+ /*!
+ * Returns a full textual description of \a this mesh.
+ * \return std::string - the string holding the mesh description.
+ */
+ std::string MEDFileMesh::advancedRepr() const {}
+ /*!
+ * Sets the family field of a given relative dimension.
+ * \param [in] meshDimRelToMaxExt - the relative dimension of entities for which
+ * the family field is set.
+ * \param [in] famArr - the array of the family field.
+ * \throw If there are no mesh entities of \a meshDimRelToMaxExt dimension in \a this mesh.
+ * \throw If \a famArr has an invalid size.
+ */
+ void MEDFileMesh::setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception) {}
+ /*!
+ * Sets the optional numbers of mesh entities of a given dimension.
+ * \param [in] meshDimRelToMaxExt - the relative dimension of mesh entities.
+ * \param [in] renumArr - the array of the numbers.
+ * \throw If there are no mesh entities of \a meshDimRelToMaxExt dimension in \a this mesh.
+ * \throw If \a renumArr has an invalid size.
+ */
+ void MEDFileMesh::setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception) {}
+ /*!
+ * Returns the family field for mesh entities of a given dimension.
+ * \param [in] meshDimRelToMaxExt - the relative dimension of mesh entities.
+ * \return const DataArrayInt * - the family field. It is an array of ids of families
+ * each mesh entity belongs to. It can be NULL.
+ */
+ const DataArrayInt *MEDFileMesh::getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception) {}
+ /*!
+ * Returns the optional numbers of mesh entities of a given dimension.
+ * \param [in] meshDimRelToMaxExt - the relative dimension of mesh entities.
+ * \return const DataArrayInt * - the array of the entity numbers.
+ * \throw If there are no mesh entities of \a meshDimRelToMaxExt dimension in \a this mesh.
+ */
+ const DataArrayInt *MEDFileMesh::getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception) {}
+ /*!
+ * Returns the optional numbers of mesh entities of a given dimension transformed using
+ * DataArrayInt::invertArrayN2O2O2N().
+ * \param [in] meshDimRelToMaxExt - the relative dimension of mesh entities.
+ * \return const DataArrayInt * - the array of the entity numbers transformed using
+ * DataArrayInt::invertArrayN2O2O2N().
+ * \throw If there are no mesh entities of \a meshDimRelToMaxExt dimension in \a this mesh.
+ */
+ const DataArrayInt *MEDFileMesh::getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception) {}
+ /*!
+ * Returns ids of mesh entities contained in given families of a given dimension.
+ * \param [in] meshDimRelToMaxExt - a relative dimension of the mesh entities whose ids
+ * are required.
+ * \param [in] fams - the names of the families of interest.
+ * \param [in] renum - if \c true, the optional numbers of entities, if available, are
+ * returned instead of ids.
+ * \return DataArrayInt * - a new instance of DataArrayInt holding either ids or
+ * numbers, if available and required, of mesh entities of the families. The caller
+ * 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::getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception) {}
+}
+
+
+namespace ParaMEDMEM
+{
+ /*! \name Basic API */
+ ///@{
+ MEDFileMesh::FindOrCreateAndGiveFamilyWithId(std::map<std::string,int>& families, int id, bool& created);
+MEDFileMesh::New(const char *fileName);
+MEDFileMesh::New(const char *fileName, const char *mName, int dt=-1, int it=-1);
+MEDFileMesh::addFamily(const char *familyName, int id);
+MEDFileMesh::addFamilyOnGrp(const char *grpName, const char *famName);
+MEDFileMesh::advancedRepr() const = 0;
+MEDFileMesh::areFamsEqual(const MEDFileMesh *other, std::string& what) const;
+MEDFileMesh::areGrpsEqual(const MEDFileMesh *other, std::string& what) const;
+MEDFileMesh::assignFamilyNameWithGroupName();
+MEDFileMesh::changeFamilyId(int oldId, int newId);
+MEDFileMesh::changeFamilyName(const char *oldName, const char *newName);
+MEDFileMesh::changeGroupName(const char *oldName, const char *newName);
+MEDFileMesh::copyFamGrpMapsFrom(const MEDFileMesh& other);
+MEDFileMesh::createGroupOnAll(int meshDimRelToMaxExt, const char *groupName);
+MEDFileMesh::existsFamily(const char *familyName) const;
+MEDFileMesh::existsFamily(int famId) const;
+MEDFileMesh::existsGroup(const char *groupName) const;
+MEDFileMesh::findOrCreateAndGiveFamilyWithId(int id, bool& created);
+MEDFileMesh::getDescription() const;
+MEDFileMesh::getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const;
+MEDFileMesh::getFamiliesIds(const std::vector<std::string>& famNames) const;
+MEDFileMesh::getFamiliesIdsOnGroup(const char *name) const;
+MEDFileMesh::getFamiliesNames() const;
+MEDFileMesh::getFamiliesOnGroup(const char *name) const;
+MEDFileMesh::getFamiliesOnGroups(const std::vector<std::string>& grps) const;
+MEDFileMesh::getFamilyArr(int meshDimRelToMaxExt, const char *fam, bool renum=false) const;
+MEDFileMesh::getFamilyFieldAtLevel(int meshDimRelToMaxExt) const;
+MEDFileMesh::getFamilyId(const char *name) const;
+MEDFileMesh::getFamilyInfo() const;
+MEDFileMesh::getFamilyNameGivenId(int id) const;
+MEDFileMesh::getGenMeshAtLevel(int meshDimRelToMax, bool renum=false) const;
+MEDFileMesh::getGroupArr(int meshDimRelToMaxExt, const char *grp, bool renum=false) const;
+MEDFileMesh::getGroupInfo() const;
+MEDFileMesh::getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const;
+MEDFileMesh::getGroupsNames() const;
+MEDFileMesh::getGroupsOnFamily(const char *name) const;
+MEDFileMesh::getIteration() const;
+MEDFileMesh::getMaxFamilyId() const;
+MEDFileMesh::getMeshDimension() const;
+MEDFileMesh::getName() const;
+MEDFileMesh::getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const;
+MEDFileMesh::getNodeFamilyArr(const char *fam, bool renum=false) const;
+MEDFileMesh::getNodeGroupArr(const char *grp, bool renum=false) const;
+MEDFileMesh::getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const;
+MEDFileMesh::getNonEmptyLevels() const = 0;
+MEDFileMesh::getNonEmptyLevelsExt() const = 0;
+MEDFileMesh::getNumberFieldAtLevel(int meshDimRelToMaxExt) const;
+MEDFileMesh::getOrder() const;
+MEDFileMesh::getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const;
+MEDFileMesh::getSizeAtLevel(int meshDimRelToMaxExt) const;
+MEDFileMesh::getTime(int& dt, int& it);
+MEDFileMesh::getTimeUnit() const;
+MEDFileMesh::getTimeValue() const;
+MEDFileMesh::getUnivName() const;
+MEDFileMesh::isEqual(const MEDFileMesh *other, double eps, std::string& what) const;
+MEDFileMesh::keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs);
+MEDFileMesh::removeFamily(const char *name);
+MEDFileMesh::removeGroup(const char *name);
+MEDFileMesh::setDescription(const char *name);
+MEDFileMesh::setFamiliesIdsOnGroup(const char *name, const std::vector<int>& famIds);
+MEDFileMesh::setFamiliesOnGroup(const char *name, const std::vector<std::string>& fams);
+MEDFileMesh::setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr);
+MEDFileMesh::setFamilyId(const char *familyName, int id);
+MEDFileMesh::setFamilyInfo(const std::map<std::string,int>& info);
+MEDFileMesh::setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
+MEDFileMesh::setGroupsAtLevel(int meshDimRelToMaxExt, const std::vector<const DataArrayInt *>& grps, bool renum=false);
+MEDFileMesh::setGroupsOnFamily(const char *famName, const std::vector<std::string>& grps);
+MEDFileMesh::setIteration(int it);
+MEDFileMesh::setName(const char *name);
+MEDFileMesh::setOrder(int order);
+MEDFileMesh::setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr);
+MEDFileMesh::setTime(int dt, int it, double time);
+MEDFileMesh::setTimeUnit(const char *unit);
+MEDFileMesh::setTimeValue(double time);
+MEDFileMesh::setUnivName(const char *name);
+MEDFileMesh::simpleRepr() const;
+MEDFileMesh::write(const char *fileName, int mode) const;
+MEDFileMesh::write(med_idt fid) const;
+///@}
+
+/*! \name Advanced API */
+///@{
+MEDFileMesh::clearNonDiscrAttributes() const;
+///@}
+
+/*! \name Others... */
+///@{
+MEDFileMesh::ChangeAllGroupsContainingFamily(std::map<std::string, std::vector<std::string> >& groups, const char *familyNameToChange, const std::vector<std::string>& newFamiliesNames);
+MEDFileMesh::CreateNameNotIn(const std::string& nameTry, const std::vector<std::string>& namesToAvoid);
+MEDFileMesh::MEDFileMesh();
+MEDFileMesh::PutInThirdComponentOfCodeOffset(std::vector<int>& code, int strt);
+MEDFileMesh::TranslateFamilyIds(int offset, DataArrayInt *famArr, std::vector< std::vector<int> >& famIdsPerGrp);
+MEDFileMesh::addFamilyOnAllGroupsHaving(const char *famName, const char *otherFamName);
+MEDFileMesh::appendFamilyEntries(const DataArrayInt *famIds, const std::vector< std::vector<int> >& fidsOfGrps, const std::vector<std::string>& grpNames);
+MEDFileMesh::changeAllGroupsContainingFamily(const char *familyNameToChange, const std::vector<std::string>& newFamiliesNames);
+MEDFileMesh::changeFamilyIdArr(int oldId, int newId);
+MEDFileMesh::changeNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
+MEDFileMesh::dealWithTinyInfo(const MEDCouplingMesh *m);
+MEDFileMesh::deepCpy() const;
+MEDFileMesh::ensureDifferentFamIdsPerLevel();
+MEDFileMesh::getAllFamiliesIdsReferenced() const;
+MEDFileMesh::getFamilyRepr(std::ostream& oss) const;
+MEDFileMesh::getHeapMemorySize() const;
+MEDFileMesh::getMaxFamilyIdInArrays() const;
+MEDFileMesh::getMinFamilyId() const;
+MEDFileMesh::getMinFamilyIdInArrays() const;
+MEDFileMesh::getNameFieldAtLevel(int meshDimRelToMaxExt) const;
+MEDFileMesh::getNumberOfNodes() const;
+MEDFileMesh::getTheMaxFamilyId() const;
+MEDFileMesh::getTheMinFamilyId() const;
+MEDFileMesh::normalizeFamIdsMEDFile();
+MEDFileMesh::normalizeFamIdsTrio();
+MEDFileMesh::setFamilyIdUnique(const char *familyName, int id);
+MEDFileMesh::setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr);
+MEDFileMesh::shallowCpy() const;
+MEDFileMesh::synchronizeTinyInfoOnLeaves() const = 0;
+MEDFileMesh::unPolyze(std::vector<int>& oldCode, std::vector<int>& newCode, DataArrayInt *& o2nRenumCell);
+MEDFileMesh::writeLL(med_idt fid) const;
+int MEDFileMesh::_order;
+int MEDFileMesh::_iteration;
+double MEDFileMesh::_time;
+std::string MEDFileMesh::_dt_unit;
+std::string MEDFileMesh::_name;
+std::string MEDFileMesh::_univ_name;
+std::string MEDFileMesh::_desc_name;
+std::map<std::string, std::vector<std::string> > MEDFileMesh::_groups;
+std::map<std::string,int> MEDFileMesh::_families;
+static const char MEDFileMesh::DFT_FAM_NAME[];
+///@}
+}
+
</pre>
-\anchor cpp_mcdataarraydouble_setselectedcomponents
+\anchor py_mcdataarraydouble_setselectedcomponents
<br><h2> Set part of values of DataArrayDouble </h2>
<h3> setSelectedComponents() </h3>
First, we create a 'source' array.
is not copied):
\snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setSelectedComponents3
-\anchor cpp_mcdataarraydouble_setpartofvalues1
+\anchor py_mcdataarraydouble_setpartofvalues1
<br><h3> setPartOfValues1() </h3>
We create two arrays:
- a "large" (4x4) zero array \b da to assign to and
-\anchor cpp_mcdataarraydouble_setpartofvaluessimple1
+\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
\snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValuesSimple1_6
-\anchor cpp_mcdataarraydouble_setpartofvaluessimple2
+\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
be explicitly called in Python.
-\anchor cpp_mcdataarraydouble_setpartofvaluessimple3
+\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
be explicitly called in Python.
-\anchor cpp_mcdataarraydouble_setpartofvalues2
+\anchor py_mcdataarraydouble_setpartofvalues2
<br><h3> setPartOfValues2() </h3>
We create two arrays:
- a "large" (4x7) zero array \b da to assign to,
be explicitly called in Python.
-\anchor cpp_mcdataarraydouble_setpartofvalues3
+\anchor py_mcdataarraydouble_setpartofvalues3
<br><h3> setPartOfValues3() </h3>
We create two arrays:
- a "large" (4x7) zero array \b da to assign to,
be explicitly called in Python.
-\anchor cpp_mcdataarrayint_setselectedcomponents
+\anchor py_mcdataarrayint_setselectedcomponents
<br><h2> Set part of values of DataArrayInt </h2>
<h3> setSelectedComponents() </h3>
First, we create a 'source' array.
is not copied):
\snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setSelectedComponents3
-\anchor cpp_mcdataarrayint_setpartofvalues1
+\anchor py_mcdataarrayint_setpartofvalues1
<br><h3> setPartOfValues1() </h3>
We create two arrays:
-- a "large" (4x4) zero array \b da to assign to and
+- 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
-\anchor cpp_mcdataarrayint_setpartofvaluessimple1
+\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
\snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValuesSimple1_6
-\anchor cpp_mcdataarrayint_setpartofvaluessimple2
+\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
be explicitly called in Python.
-\anchor cpp_mcdataarrayint_setpartofvaluessimple3
+\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
be explicitly called in Python.
-\anchor cpp_mcdataarrayint_setpartofvalues2
+\anchor py_mcdataarrayint_setpartofvalues2
<br><h3> setPartOfValues2() </h3>
We create two arrays:
- a "large" (4x7) zero array \b da to assign to,
be explicitly called in Python.
-\anchor cpp_mcdataarrayint_setpartofvalues3
+\anchor py_mcdataarrayint_setpartofvalues3
<br><h3> setPartOfValues3() </h3>
We create two arrays:
- a "large" (4x7) zero array \b da to assign to,
be explicitly called in Python.
-\anchor cpp_mcdataarraydouble_getdifferentvalues
+\anchor py_mcdataarraydouble_getdifferentvalues
<br><h2> Excluding coincident tuples from DataArrayDouble</h2>
The code below creates an array of real values and than an array of
each. Its components are: "c0da1","c1da1","c0da2".
-\anchor cpp_mcdataarraydouble_KeepSelectedComponents
+\anchor py_mcdataarraydouble_KeepSelectedComponents
<br><h2>Creation of a sub-part of the DataArrayDouble by selecting components</h2>
the result array \b a2 includes 30 elements (5 tuples per 6 components).
-\anchor cpp_mcdataarrayint_keepselectedcomponents
+\anchor py_mcdataarrayint_keepselectedcomponents
<br><h2>Creation of a sub-part of the DataArrayInt by selecting components</h2>
--- /dev/null
+/*!
+\page medcouplingexamplescpponly MEDCoupling C++ examples
+
+\anchor cpp_mcfielddouble_fillFromAnalytic_c_func
+<br><h2> Filling a field using a C function</h2>
+
+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 cpp_mcfielddouble_applyFunc_c_func
+<br><h2> Changing a field by applying a C function</h2>
+
+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.
+
+
+*/
* \throw If a component index (\a i) is not valid:
* \a i < 0 || \a i >= \a this->getNumberOfComponents().
*
- * \ref cpp_mcdataarraydouble_keepselectedcomponents "Here is a Python example".
+ * \ref py_mcdataarraydouble_KeepSelectedComponents "Here is a Python example".
*/
DataArrayDouble *DataArrayDouble::keepSelectedComponents(const std::vector<int>& compoIds) const throw(INTERP_KERNEL::Exception)
{
* \throw If \a this is not allocated.
* \throw If the number of components is not in [1,2,3].
*
- * \ref cpp_mcdataarraydouble_getdifferentvalues "Here is a Python example".
+ * \ref py_mcdataarraydouble_getdifferentvalues "Here is a Python example".
*/
DataArrayDouble *DataArrayDouble::getDifferentValues(double prec, int limitTupleId) const throw(INTERP_KERNEL::Exception)
{
* \throw If \a compoIds.size() != \a a->getNumberOfComponents().
* \throw If \a compoIds[i] < 0 or \a compoIds[i] > \a this->getNumberOfComponents().
*
- * \ref cpp_mcdataarraydouble_setselectedcomponents "Here is a Python example".
+ * \ref py_mcdataarraydouble_setselectedcomponents "Here is a Python example".
*/
void DataArrayDouble::setSelectedComponents(const DataArrayDouble *a, const std::vector<int>& compoIds) throw(INTERP_KERNEL::Exception)
{
* \throw If \a strictCompoCompare == \a true && \a a->getNumberOfComponents() !=
* \c len(\c range(\a bgComp,\a endComp,\a stepComp)).
*
- * \ref cpp_mcdataarraydouble_setpartofvalues1 "Here is a Python example".
+ * \ref py_mcdataarraydouble_setpartofvalues1 "Here is a Python example".
*/
void DataArrayDouble::setPartOfValues1(const DataArrayDouble *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare) throw(INTERP_KERNEL::Exception)
{
* non-empty range of increasing indices or indices are out of a valid range
* for \this array.
*
- * \ref cpp_mcdataarraydouble_setpartofvaluessimple1 "Here is a Python example".
+ * \ref py_mcdataarraydouble_setpartofvaluessimple1 "Here is a Python example".
*/
void DataArrayDouble::setPartOfValuesSimple1(double a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp) throw(INTERP_KERNEL::Exception)
{
* \throw In the second *mode of usage*, if \a a->getNumberOfTuples() != 1 or
* <em> a->getNumberOfComponents() != (endComp - bgComp)</em>.
*
- * \ref cpp_mcdataarraydouble_setpartofvalues2 "Here is a Python example".
+ * \ref py_mcdataarraydouble_setpartofvalues2 "Here is a Python example".
*/
void DataArrayDouble::setPartOfValues2(const DataArrayDouble *a, const int *bgTuples, const int *endTuples, const int *bgComp, const int *endComp, bool strictCompoCompare) throw(INTERP_KERNEL::Exception)
{
* \throw If any index of tuple/component given by <em>bgTuples / bgComp</em> is
* out of a valid range for \a this array.
*
- * \ref cpp_mcdataarraydouble_setpartofvaluessimple2 "Here is a Python example".
+ * \ref py_mcdataarraydouble_setpartofvaluessimple2 "Here is a Python example".
*/
void DataArrayDouble::setPartOfValuesSimple2(double a, const int *bgTuples, const int *endTuples, const int *bgComp, const int *endComp) throw(INTERP_KERNEL::Exception)
{
* non-empty range of increasing indices or indices are out of a valid range
* for \this array.
*
- * \ref cpp_mcdataarraydouble_setpartofvalues3 "Here is a Python example".
+ * \ref py_mcdataarraydouble_setpartofvalues3 "Here is a Python example".
*/
void DataArrayDouble::setPartOfValues3(const DataArrayDouble *a, const int *bgTuples, const int *endTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare) throw(INTERP_KERNEL::Exception)
{
* non-empty range of increasing indices or indices are out of a valid range
* for \this array.
*
- * \ref cpp_mcdataarraydouble_setpartofvaluessimple3 "Here is a Python example".
+ * \ref py_mcdataarraydouble_setpartofvaluessimple3 "Here is a Python example".
*/
void DataArrayDouble::setPartOfValuesSimple3(double a, const int *bgTuples, const int *endTuples, int bgComp, int endComp, int stepComp) throw(INTERP_KERNEL::Exception)
{
* \throw If a component index (\a i) is not valid:
* \a i < 0 || \a i >= \a this->getNumberOfComponents().
*
- * \ref cpp_mcdataarrayint_keepselectedcomponents "Here is a Python example".
+ * \ref py_mcdataarrayint_keepselectedcomponents "Here is a Python example".
*/
DataArrayInt *DataArrayInt::keepSelectedComponents(const std::vector<int>& compoIds) const throw(INTERP_KERNEL::Exception)
{
* \throw If \a compoIds.size() != \a a->getNumberOfComponents().
* \throw If \a compoIds[i] < 0 or \a compoIds[i] > \a this->getNumberOfComponents().
*
- * \ref cpp_mcdataarrayint_setselectedcomponents "Here is a Python example".
+ * \ref py_mcdataarrayint_setselectedcomponents "Here is a Python example".
*/
void DataArrayInt::setSelectedComponents(const DataArrayInt *a, const std::vector<int>& compoIds) throw(INTERP_KERNEL::Exception)
{
* \throw If \a strictCompoCompare == \a true && \a a->getNumberOfComponents() !=
* \c len(\c range(\a bgComp,\a endComp,\a stepComp)).
*
- * \ref cpp_mcdataarrayint_setpartofvalues1 "Here is a Python example".
+ * \ref py_mcdataarrayint_setpartofvalues1 "Here is a Python example".
*/
void DataArrayInt::setPartOfValues1(const DataArrayInt *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare) throw(INTERP_KERNEL::Exception)
{
* non-empty range of increasing indices or indices are out of a valid range
* for \this array.
*
- * \ref cpp_mcdataarrayint_setpartofvaluessimple1 "Here is a Python example".
+ * \ref py_mcdataarrayint_setpartofvaluessimple1 "Here is a Python example".
*/
void DataArrayInt::setPartOfValuesSimple1(int a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp) throw(INTERP_KERNEL::Exception)
{
* \throw In the second *mode of usage*, if \a a->getNumberOfTuples() != 1 or
* <em> a->getNumberOfComponents() != (endComp - bgComp)</em>.
*
- * \ref cpp_mcdataarrayint_setpartofvalues2 "Here is a Python example".
+ * \ref py_mcdataarrayint_setpartofvalues2 "Here is a Python example".
*/
void DataArrayInt::setPartOfValues2(const DataArrayInt *a, const int *bgTuples, const int *endTuples, const int *bgComp, const int *endComp, bool strictCompoCompare) throw(INTERP_KERNEL::Exception)
{
* \throw If any index of tuple/component given by <em>bgTuples / bgComp</em> is
* out of a valid range for \a this array.
*
- * \ref cpp_mcdataarrayint_setpartofvaluessimple2 "Here is a Python example".
+ * \ref py_mcdataarrayint_setpartofvaluessimple2 "Here is a Python example".
*/
void DataArrayInt::setPartOfValuesSimple2(int a, const int *bgTuples, const int *endTuples, const int *bgComp, const int *endComp) throw(INTERP_KERNEL::Exception)
{
* non-empty range of increasing indices or indices are out of a valid range
* for \this array.
*
- * \ref cpp_mcdataarrayint_setpartofvalues3 "Here is a Python example".
+ * \ref py_mcdataarrayint_setpartofvalues3 "Here is a Python example".
*/
void DataArrayInt::setPartOfValues3(const DataArrayInt *a, const int *bgTuples, const int *endTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare) throw(INTERP_KERNEL::Exception)
{
* non-empty range of increasing indices or indices are out of a valid range
* for \this array.
*
- * \ref cpp_mcdataarrayint_setpartofvaluessimple3 "Here is a Python example".
+ * \ref py_mcdataarrayint_setpartofvaluessimple3 "Here is a Python example".
*/
void DataArrayInt::setPartOfValuesSimple3(int a, const int *bgTuples, const int *endTuples, int bgComp, int endComp, int stepComp) throw(INTERP_KERNEL::Exception)
{
* \throw If a component index (\a i) is not valid:
* \a i < 0 || \a i >= \a this->getNumberOfComponents().
*
- * \ref cpp_mcdataarrayint_keepselectedcomponents "Here is a Python example".
+ * \ref py_mcdataarrayint_keepselectedcomponents "Here is a Python example".
*/
DataArrayChar *DataArrayChar::keepSelectedComponents(const std::vector<int>& compoIds) const throw(INTERP_KERNEL::Exception)
{
* \throw If \a strictCompoCompare == \a true && \a a->getNumberOfComponents() !=
* \c len(\c range(\a bgComp,\a endComp,\a stepComp)).
*
- * \ref cpp_mcdataarrayint_setpartofvalues1 "Here is a Python example".
+ * \ref py_mcdataarrayint_setpartofvalues1 "Here is a Python example".
*/
void DataArrayChar::setPartOfValues1(const DataArrayChar *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare) throw(INTERP_KERNEL::Exception)
{
* non-empty range of increasing indices or indices are out of a valid range
* for \this array.
*
- * \ref cpp_mcdataarrayint_setpartofvaluessimple1 "Here is a Python example".
+ * \ref py_mcdataarrayint_setpartofvaluessimple1 "Here is a Python example".
*/
void DataArrayChar::setPartOfValuesSimple1(char a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp) throw(INTERP_KERNEL::Exception)
{
* \throw In the second *mode of usage*, if \a a->getNumberOfTuples() != 1 or
* <em> a->getNumberOfComponents() != (endComp - bgComp)</em>.
*
- * \ref cpp_mcdataarrayint_setpartofvalues2 "Here is a Python example".
+ * \ref py_mcdataarrayint_setpartofvalues2 "Here is a Python example".
*/
void DataArrayChar::setPartOfValues2(const DataArrayChar *a, const int *bgTuples, const int *endTuples, const int *bgComp, const int *endComp, bool strictCompoCompare) throw(INTERP_KERNEL::Exception)
{
* \throw If any index of tuple/component given by <em>bgTuples / bgComp</em> is
* out of a valid range for \a this array.
*
- * \ref cpp_mcdataarrayint_setpartofvaluessimple2 "Here is a Python example".
+ * \ref py_mcdataarrayint_setpartofvaluessimple2 "Here is a Python example".
*/
void DataArrayChar::setPartOfValuesSimple2(char a, const int *bgTuples, const int *endTuples, const int *bgComp, const int *endComp) throw(INTERP_KERNEL::Exception)
{
* non-empty range of increasing indices or indices are out of a valid range
* for \this array.
*
- * \ref cpp_mcdataarrayint_setpartofvalues3 "Here is a Python example".
+ * \ref py_mcdataarrayint_setpartofvalues3 "Here is a Python example".
*/
void DataArrayChar::setPartOfValues3(const DataArrayChar *a, const int *bgTuples, const int *endTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare) throw(INTERP_KERNEL::Exception)
{
* non-empty range of increasing indices or indices are out of a valid range
* for \this array.
*
- * \ref cpp_mcdataarrayint_setpartofvaluessimple3 "Here is a Python example".
+ * \ref py_mcdataarrayint_setpartofvaluessimple3 "Here is a Python example".
*/
void DataArrayChar::setPartOfValuesSimple3(char a, const int *bgTuples, const int *endTuples, int bgComp, int endComp, int stepComp) throw(INTERP_KERNEL::Exception)
{
}
/*!
- * \brief Checks if data arrays of this mesh (node coordinates, nodal
+ * Checks if data arrays of this mesh (node coordinates, nodal
* connectivity of cells, etc) of two meshes are same. Textual data like name etc. are
* not considered.
* \param [in] other - the mesh to compare with.
mesh->setMeshDimension(2);
mesh->allocateCells(5);
const int conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4};
- mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn); // 0
- mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+4); // 1
- mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+7); // 2
- mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+10); // 3
- mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+14); // 4
+ mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn);
+ mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+4);
+ mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+7);
+ mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+10);
+ mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+14);
mesh->finishInsertingCells();
MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->alloc(9,2);
mesh->setMeshDimension(2);
mesh->allocateCells(5);
const int conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4};
- mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn); // 0
- mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+4); // 1
- mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+7); // 2
- mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+10); // 3
- mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+14); // 4
+ mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn);
+ mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+4);
+ mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+7);
+ mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+10);
+ mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+14);
mesh->finishInsertingCells();
MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->alloc(9,2);
mesh->setMeshDimension(2);
mesh->allocateCells(5);
const int conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4};
- mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn); // 0
- mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+4); // 1
- mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+7); // 2
- mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+10); // 3
- mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+14); // 4
+ mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn);
+ mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+4);
+ mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+7);
+ mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+10);
+ mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+14);
mesh->finishInsertingCells();
MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->alloc(9,2);
mesh->setMeshDimension(2);
mesh->allocateCells(5);
const int conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4};
- mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn); // 0
- mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+4); // 1
- mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+7); // 2
- mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+10); // 3
- mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+14); // 4
+ mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn);
+ mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+4);
+ mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+7);
+ mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+10);
+ mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+14);
mesh->finishInsertingCells();
MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->alloc(9,2);
mesh->setMeshDimension(2);
mesh->allocateCells(5);
const int conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4};
- mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn); // 0
- mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+4); // 1
- mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+7); // 2
- mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+10); // 3
- mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+14); // 4
+ mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn);
+ mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+4);
+ mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+7);
+ mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+10);
+ mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+14);
mesh->finishInsertingCells();
MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->alloc(9,2);
mesh->setMeshDimension(2);
mesh->allocateCells(5);
const int conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4};
- mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn); // 0
- mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+4); // 1
- mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+7); // 2
- mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+10); // 3
- mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+14); // 4
+ mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn);
+ mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+4);
+ mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+7);
+ mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+10);
+ mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+14);
mesh->finishInsertingCells();
MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->alloc(9,2);
mesh.setMeshDimension(2);
mesh.allocateCells(5);
conn=[0,3,4,1, 1,2,4, 4,5,2, 6,7,4,3, 7,8,5,4];
- mesh.insertNextCell(NORM_QUAD4,4,conn[0:4]); # 0
- mesh.insertNextCell(NORM_TRI3,3, conn[4:7]); # 1
- mesh.insertNextCell(NORM_TRI3,3, conn[7:10]); # 2
- mesh.insertNextCell(NORM_QUAD4,4,conn[10:14]); # 3
- mesh.insertNextCell(NORM_QUAD4,4,conn[14:18]); # 4
+ mesh.insertNextCell(NORM_QUAD4,4,conn[0:4]);
+ mesh.insertNextCell(NORM_TRI3,3, conn[4:7]);
+ mesh.insertNextCell(NORM_TRI3,3, conn[7:10]);
+ mesh.insertNextCell(NORM_QUAD4,4,conn[10:14]);
+ mesh.insertNextCell(NORM_QUAD4,4,conn[14:18]);
mesh.finishInsertingCells();
coords=[-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 ];
coordsArr=DataArrayDouble.New();
mesh.setMeshDimension(2);
mesh.allocateCells(5);
conn=[0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4];
- mesh.insertNextCell(NORM_QUAD4,4,conn[0:4]); # 0
- mesh.insertNextCell(NORM_TRI3,3, conn[4:7]); # 1
- mesh.insertNextCell(NORM_TRI3,3, conn[7:10]); # 2
- mesh.insertNextCell(NORM_QUAD4,4,conn[10:14]); # 3
- mesh.insertNextCell(NORM_QUAD4,4,conn[14:18]); # 4
+ mesh.insertNextCell(NORM_QUAD4,4,conn[0:4]);
+ mesh.insertNextCell(NORM_TRI3,3, conn[4:7]);
+ mesh.insertNextCell(NORM_TRI3,3, conn[7:10]);
+ mesh.insertNextCell(NORM_QUAD4,4,conn[10:14]);
+ mesh.insertNextCell(NORM_QUAD4,4,conn[14:18]);
mesh.finishInsertingCells();
coords=[-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 ];
coordsArr=DataArrayDouble.New();
mesh.setMeshDimension(2);
mesh.allocateCells(5);
conn=[0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4];
- mesh.insertNextCell(NORM_QUAD4,4,conn[0:4]); # 0
- mesh.insertNextCell(NORM_TRI3,3, conn[4:7]); # 1
- mesh.insertNextCell(NORM_TRI3,3, conn[7:10]); # 2
- mesh.insertNextCell(NORM_QUAD4,4,conn[10:14]); # 3
- mesh.insertNextCell(NORM_QUAD4,4,conn[14:18]); # 4
+ mesh.insertNextCell(NORM_QUAD4,4,conn[0:4]);
+ mesh.insertNextCell(NORM_TRI3,3, conn[4:7]);
+ mesh.insertNextCell(NORM_TRI3,3, conn[7:10]);
+ mesh.insertNextCell(NORM_QUAD4,4,conn[10:14]);
+ mesh.insertNextCell(NORM_QUAD4,4,conn[14:18]);
mesh.finishInsertingCells();
coords=[-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 ];
coordsArr=DataArrayDouble.New();
mesh.setMeshDimension(2);
mesh.allocateCells(5);
conn=[0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4];
- mesh.insertNextCell(NORM_QUAD4,4,conn[0:4]); # 0
- mesh.insertNextCell(NORM_TRI3,3, conn[4:7]); # 1
- mesh.insertNextCell(NORM_TRI3,3, conn[7:10]); # 2
- mesh.insertNextCell(NORM_QUAD4,4,conn[10:14]); # 3
- mesh.insertNextCell(NORM_QUAD4,4,conn[14:18]); # 4
+ mesh.insertNextCell(NORM_QUAD4,4,conn[0:4]);
+ mesh.insertNextCell(NORM_TRI3,3, conn[4:7]);
+ mesh.insertNextCell(NORM_TRI3,3, conn[7:10]);
+ mesh.insertNextCell(NORM_QUAD4,4,conn[10:14]);
+ mesh.insertNextCell(NORM_QUAD4,4,conn[14:18]);
mesh.finishInsertingCells();
coords=[-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 ];
coordsArr=DataArrayDouble.New();
mesh.setMeshDimension(2);
mesh.allocateCells(5);
conn=[0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4];
- mesh.insertNextCell(NORM_QUAD4,4,conn[0:4]); # 0
- mesh.insertNextCell(NORM_TRI3,3, conn[4:7]); # 1
- mesh.insertNextCell(NORM_TRI3,3, conn[7:10]); # 2
- mesh.insertNextCell(NORM_QUAD4,4,conn[10:14]); # 3
- mesh.insertNextCell(NORM_QUAD4,4,conn[14:18]); # 4
+ mesh.insertNextCell(NORM_QUAD4,4,conn[0:4]);
+ mesh.insertNextCell(NORM_TRI3,3, conn[4:7]);
+ mesh.insertNextCell(NORM_TRI3,3, conn[7:10]);
+ mesh.insertNextCell(NORM_QUAD4,4,conn[10:14]);
+ mesh.insertNextCell(NORM_QUAD4,4,conn[14:18]);
mesh.finishInsertingCells();
coords=[-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 ];
coordsArr=DataArrayDouble.New();
mesh.setMeshDimension(2);
mesh.allocateCells(5);
conn=[0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4];
- mesh.insertNextCell(NORM_QUAD4,4,conn[0:4]); # 0
- mesh.insertNextCell(NORM_TRI3,3, conn[4:7]); # 1
- mesh.insertNextCell(NORM_TRI3,3, conn[7:10]); # 2
- mesh.insertNextCell(NORM_QUAD4,4,conn[10:14]); # 3
- mesh.insertNextCell(NORM_QUAD4,4,conn[14:18]); # 4
+ mesh.insertNextCell(NORM_QUAD4,4,conn[0:4]);
+ mesh.insertNextCell(NORM_TRI3,3, conn[4:7]);
+ mesh.insertNextCell(NORM_TRI3,3, conn[7:10]);
+ mesh.insertNextCell(NORM_QUAD4,4,conn[10:14]);
+ mesh.insertNextCell(NORM_QUAD4,4,conn[14:18]);
mesh.finishInsertingCells();
coords=[-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 ];
coordsArr=DataArrayDouble.New();
throw INTERP_KERNEL::Exception("MEDFileFieldGlobs::CreateNewNameNotIn : impossible to create an additional profile limit of 100000 profiles reached !");
}
+/*!
+ * 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))
{
}
+/*!
+ * Creates an empty MEDFileFieldGlobsReal.
+ */
MEDFileFieldGlobsReal::MEDFileFieldGlobsReal():_globals(MEDFileFieldGlobs::New())
{
}
return ret;
}
+/*!
+ * Returns a string describing profiles and Gauss points held in \a this.
+ * \return std::string - the description string.
+ */
void MEDFileFieldGlobsReal::simpleRepr(std::ostream& oss) const
{
oss << "Globals information on fields :" << "\n*******************************\n\n";
{
}
+/*!
+ * Copies references to profiles and Gauss points from another MEDFileFieldGlobsReal.
+ * \param [in] other - the other MEDFileFieldGlobsReal to copy data from.
+ */
void MEDFileFieldGlobsReal::shallowCpyGlobs(const MEDFileFieldGlobsReal& other)
{
_globals=other._globals;
_globals=other._globals->deepCpy();
}
+/*!
+ * Adds profiles and Gauss points held by another MEDFileFieldGlobsReal to \a this one.
+ * \param [in] other - the MEDFileFieldGlobsReal to copy data from.
+ * \param [in] eps - a precision used to compare Gauss points with same name held by
+ * \a this and \a other MEDFileFieldGlobsReal.
+ * \throw If \a this and \a other hold profiles with equal names but different ids.
+ * \throw If \a this and \a other hold different Gauss points with equal names.
+ */
void MEDFileFieldGlobsReal::appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception)
{
_globals->appendGlobs(*other._globals,eps);
_globals->writeGlobals(fid,opt);
}
+/*!
+ * Returns names of all profiles. To get only used profiles call getPflsReallyUsed()
+ * or getPflsReallyUsedMulti().
+ * \return std::vector<std::string> - a sequence of names of all profiles.
+ */
std::vector<std::string> MEDFileFieldGlobsReal::getPfls() const
{
return _globals->getPfls();
}
+/*!
+ * Returns names of all localizations. To get only used localizations call getLocsReallyUsed()
+ * or getLocsReallyUsedMulti().
+ * \return std::vector<std::string> - a sequence of names of all localizations.
+ */
std::vector<std::string> MEDFileFieldGlobsReal::getLocs() const
{
return _globals->getLocs();
}
+/*!
+ * Checks if the profile with a given name exists.
+ * \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
{
return _globals->existsPfl(pflName);
}
+/*!
+ * Checks if the localization with a given name exists.
+ * \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
{
return _globals->existsLoc(locName);
return _globals->createNewNameOfLoc();
}
+/*!
+ * Sets the name of a MED file.
+ * \param [inout] fileName - the file name.
+ */
void MEDFileFieldGlobsReal::setFileName(const char *fileName)
{
_globals->setFileName(fileName);
}
+/*!
+ * Finds equal profiles. Two profiles are considered equal if they contain the same ids
+ * in the same order.
+ * \return std::vector< std::vector<int> > - a sequence of groups of equal profiles.
+ * Each item of this sequence is a vector containing ids of equal profiles.
+ */
std::vector< std::vector<int> > MEDFileFieldGlobsReal::whichAreEqualProfiles() const
{
return _globals->whichAreEqualProfiles();
}
+/*!
+ * Finds equal localizations.
+ * \param [in] eps - a precision used to compare real values of the localizations.
+ * \return std::vector< std::vector<int> > - a sequence of groups of equal localizations.
+ * Each item of this sequence is a vector containing ids of equal localizations.
+ */
std::vector< std::vector<int> > MEDFileFieldGlobsReal::whichAreEqualLocs(double eps) const
{
return _globals->whichAreEqualLocs(eps);
}
+/*!
+ * Renames the profiles. References to profiles (a reference is a profile name) are not changed.
+ * \param [in] mapOfModif - a sequence describing required renaming. Each element of
+ * this sequence is a pair whose
+ * - the first item is a vector of profile names to replace by the second item,
+ * - the second item is a profile name to replace every profile name of the first item.
+ */
void MEDFileFieldGlobsReal::changePflsNamesInStruct(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception)
{
_globals->changePflsNamesInStruct(mapOfModif);
}
+/*!
+ * Renames the localizations. References to localizations (a reference is a localization name) are not changed.
+ * \param [in] mapOfModif - a sequence describing required renaming. Each element of
+ * this sequence is a pair whose
+ * - the first item is a vector of localization names to replace by the second item,
+ * - the second item is a localization name to replace every localization name of the first item.
+ */
void MEDFileFieldGlobsReal::changeLocsNamesInStruct(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception)
{
_globals->changeLocsNamesInStruct(mapOfModif);
}
/*!
- * This method is a generalization of MEDFileFieldGlobsReal::changePflName.
- * This method contrary to abstract method MEDFileFieldGlobsReal::changePflsRefsNamesGen updates in addition of MEDFileFieldGlobsReal::changePflsRefsNamesGen,
- * the profiles themselves and not only leaves of field.
+ * Replaces references to some profiles (a reference is a profile name) by references
+ * to other profiles and, contrary to changePflsRefsNamesGen(), renames the profiles
+ * them-selves accordingly. <br>
+ * This method is a generalization of changePflName().
+ * \param [in] mapOfModif - a sequence describing required replacements. Each element of
+ * this sequence is a pair whose
+ * - the first item is a vector of profile names to replace by the second item,
+ * - the second item is a profile name to replace every profile of the first item.
+ * \sa changePflsRefsNamesGen()
+ * \sa changePflName()
*/
void MEDFileFieldGlobsReal::changePflsNames(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception)
{
}
/*!
- * This method is a generalization of MEDFileFieldGlobsReal::changePflName.
- * This method contrary to abstract method MEDFileFieldGlobsReal::changeLocsRefsNamesGen updates in addition of MEDFileFieldGlobsReal::changeLocsRefsNamesGen,
- * the localizations themselves and not only leaves of field.
+ * Replaces references to some localizations (a reference is a localization name) by references
+ * to other localizations and, contrary to changeLocsRefsNamesGen(), renames the localizations
+ * them-selves accordingly. <br>
+ * This method is a generalization of changeLocName().
+ * \param [in] mapOfModif - a sequence describing required replacements. Each element of
+ * this sequence is a pair whose
+ * - the first item is a vector of localization names to replace by the second item,
+ * - the second item is a localization name to replace every localization of the first item.
+ * \sa changeLocsRefsNamesGen()
+ * \sa changeLocName()
*/
void MEDFileFieldGlobsReal::changeLocsNames(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception)
{
}
/*!
- * This method is a more friendly API but less general method than MEDFileFieldGlobsReal::changePflsNames.
+ * Renames the profile having a given name and updates references to this profile.
+ * \param [in] oldName - the name of the profile to rename.
+ * \param [in] newName - a new name of the profile.
+ * \sa changePflsNames().
*/
void MEDFileFieldGlobsReal::changePflName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception)
{
}
/*!
- * This method is a more friendly API but less general method than MEDFileFieldGlobsReal::changeLocsNames.
+ * Renames the localization having a given name and updates references to this localization.
+ * \param [in] oldName - the name of the localization to rename.
+ * \param [in] newName - a new name of the localization.
+ * \sa changeLocsNames().
*/
void MEDFileFieldGlobsReal::changeLocName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception)
{
changeLocsNames(mapOfModif);
}
+/*!
+ * Removes duplicated profiles. Returns a map used to update references to removed
+ * profiles via changePflsRefsNamesGen().
+ * Equal profiles are found using whichAreEqualProfiles().
+ * \return std::vector< std::pair<std::vector<std::string>, std::string > > -
+ * a sequence describing the performed replacements of profiles. Each element of
+ * this sequence is a pair whose
+ * - the first item is a vector of profile names replaced by the second item,
+ * - the second item is a profile name replacing every profile of the first item.
+ */
std::vector< std::pair<std::vector<std::string>, std::string > > MEDFileFieldGlobsReal::zipPflsNames() throw(INTERP_KERNEL::Exception)
{
std::vector< std::vector<int> > pseudoRet=whichAreEqualProfiles();
return ret;
}
+/*!
+ * Removes duplicated localizations. Returns a map used to update references to removed
+ * localizations via changeLocsRefsNamesGen().
+ * Equal localizations are found using whichAreEqualLocs().
+ * \param [in] eps - a precision used to compare real values of the localizations.
+ * \return std::vector< std::pair<std::vector<std::string>, std::string > > -
+ * a sequence describing the performed replacements of localizations. Each element of
+ * this sequence is a pair whose
+ * - the first item is a vector of localization names replaced by the second item,
+ * - the second item is a localization name replacing every localization of the first item.
+ */
std::vector< std::pair<std::vector<std::string>, std::string > > MEDFileFieldGlobsReal::zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
{
std::vector< std::vector<int> > pseudoRet=whichAreEqualLocs(eps);
return ret;
}
+/*!
+ * Returns number of Gauss points per cell in a given localization.
+ * \param [in] locId - an id of the localization of interest.
+ * \return int - the number of the Gauss points per cell.
+ */
int MEDFileFieldGlobsReal::getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception)
{
return _globals->getNbOfGaussPtPerCell(locId);
}
+/*!
+ * Returns an id of a localization by its name.
+ * \param [in] loc - the localization name of interest.
+ * \return int - the id of the localization.
+ * \throw If there is no a localization named \a loc.
+ */
int MEDFileFieldGlobsReal::getLocalizationId(const char *loc) const throw(INTERP_KERNEL::Exception)
{
return _globals->getLocalizationId(loc);
}
+/*!
+ * Returns the name of the MED file.
+ * \return const char * - the MED file name.
+ */
const char *MEDFileFieldGlobsReal::getFileName() const
{
return _globals->getFileName();
return _globals->getFileName2();
}
+/*!
+ * Returns a localization object by its name.
+ * \param [in] locName - the name of the localization of interest.
+ * \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 throw(INTERP_KERNEL::Exception)
{
return _globals->getLocalization(locName);
}
+/*!
+ * Returns a localization object by its id.
+ * \param [in] locId - the id of the localization of interest.
+ * \return const MEDFileFieldLoc& - the localization object having the id \a locId.
+ * \throw If there is no a localization with id \a locId.
+ */
const MEDFileFieldLoc& MEDFileFieldGlobsReal::getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
{
return _globals->getLocalizationFromId(locId);
}
+/*!
+ * Returns a profile array by its name.
+ * \param [in] pflName - the name of the profile of interest.
+ * \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 throw(INTERP_KERNEL::Exception)
{
return _globals->getProfile(pflName);
}
+/*!
+ * Returns a profile array by its id.
+ * \param [in] pflId - the id of the profile of interest.
+ * \return const DataArrayInt * - the profile array having the id \a pflId.
+ * \throw If there is no a profile with id \a pflId.
+ */
const DataArrayInt *MEDFileFieldGlobsReal::getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
{
return _globals->getProfileFromId(pflId);
}
+/*!
+ * Returns a localization object, apt for modification, by its id.
+ * \param [in] locId - the id of the localization of interest.
+ * \return MEDFileFieldLoc& - a non-const reference to the localization object
+ * having the id \a locId.
+ * \throw If there is no a localization with id \a locId.
+ */
MEDFileFieldLoc& MEDFileFieldGlobsReal::getLocalizationFromId(int locId) throw(INTERP_KERNEL::Exception)
{
return _globals->getLocalizationFromId(locId);
}
+/*!
+ * Returns a localization object, apt for modification, by its name.
+ * \param [in] locName - the name of the localization of interest.
+ * \return MEDFileFieldLoc& - a non-const reference to the localization object
+ * having the name \a locName.
+ * \throw If there is no a localization named \a locName.
+ */
MEDFileFieldLoc& MEDFileFieldGlobsReal::getLocalization(const char *locName) throw(INTERP_KERNEL::Exception)
{
return _globals->getLocalization(locName);
}
+/*!
+ * Returns a profile array, apt for modification, by its name.
+ * \param [in] pflName - the name of the profile of interest.
+ * \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) throw(INTERP_KERNEL::Exception)
{
return _globals->getProfile(pflName);
}
+/*!
+ * Returns a profile array, apt for modification, by its id.
+ * \param [in] pflId - the id of the profile of interest.
+ * \return DataArrayInt * - a non-const pointer to the profile array having the id \a pflId.
+ * \throw If there is no a profile with id \a pflId.
+ */
DataArrayInt *MEDFileFieldGlobsReal::getProfileFromId(int pflId) throw(INTERP_KERNEL::Exception)
{
return _globals->getProfileFromId(pflId);
}
+/*!
+ * Removes profiles given by their ids. No data is updated to track this removal.
+ * \param [in] pflIds - a sequence of ids of the profiles to remove.
+ */
void MEDFileFieldGlobsReal::killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception)
{
_globals->killProfileIds(pflIds);
}
+/*!
+ * Removes localizations given by their ids. No data is updated to track this removal.
+ * \param [in] locIds - a sequence of ids of the localizations to remove.
+ */
void MEDFileFieldGlobsReal::killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception)
{
_globals->killLocalizationIds(locIds);
}
+/*!
+ * Stores a profile array.
+ * \param [in] pfl - the profile array to store.
+ * \throw If the name of \a pfl is empty.
+ * \throw If a profile with the same name as that of \a pfl already exists but contains
+ * different ids.
+ */
void MEDFileFieldGlobsReal::appendProfile(DataArrayInt *pfl) throw(INTERP_KERNEL::Exception)
{
_globals->appendProfile(pfl);
}
+/*!
+ * Adds a new localization of Gauss points.
+ * \param [in] locName - the name of the new localization.
+ * \param [in] geoType - a geometrical type of the reference cell.
+ * \param [in] refCoo - coordinates of points of the reference cell. Size of this vector
+ * must be \c nbOfNodesPerCell * \c dimOfType.
+ * \param [in] gsCoo - coordinates of Gauss points on the reference cell. Size of this vector
+ * must be _wg_.size() * \c dimOfType.
+ * \param [in] w - the weights of Gauss points.
+ * \throw If \a locName is empty.
+ * \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) throw(INTERP_KERNEL::Exception)
{
_globals->appendLoc(locName,geoType,refCoo,gsCoo,w);
}
/*!
- * This method returns the max dimension of 'this'.
- * This method returns -2 if 'this' is empty, -1 if only nodes are defined.
+ * Returns the maximal dimension of supporting elements. Returns -2 if \a this is
+ * empty. Returns -1 if this in on nodes.
+ * \return int - the dimension of \a this.
*/
int MEDFileField1TSWithoutSDA::getDimension() const
{
return ret;
}
+/*!
+ * Throws if a given value is not a valid (non-extended) relative dimension.
+ * \param [in] meshDimRelToMax - the relative dimension value.
+ * \throw If \a meshDimRelToMax > 0.
+ */
void MEDFileField1TSWithoutSDA::CheckMeshDimRel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
{
if(meshDimRelToMax>0)
throw INTERP_KERNEL::Exception("CheckMeshDimRel : This is a meshDimRel not a meshDimRelExt ! So value should be <=0 !");
}
+/*!
+ * Checks if elements of a given mesh are in the order suitable for writing
+ * to the MED file. If this is not so, an exception is thrown. In a case of success, returns a
+ * vector describing types of elements and their number.
+ * \param [in] mesh - the mesh to check.
+ * \return std::vector<int> - a vector holding for each element type (1) item of
+ * INTERP_KERNEL::NormalizedCellType, (2) number of elements, (3) -1.
+ * These values are in full-interlace mode.
+ * \throw If elements in \a mesh are not in the order suitable for writing to the MED file.
+ */
std::vector<int> MEDFileField1TSWithoutSDA::CheckSBTMesh(const MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception)
{
//
}
/*!
- * This method copyies tiny info but also preallocated the DataArrayDouble instance in this->_arr.
- * This not allocated it allocates to the size of 'field' array. If already allocated it grows the array to
- * the previous size + the size of the array of the input 'field'.
- * This method returns the position (in tuple id) where to start to feed 'this->_arr'
+ * Copies tiny info and allocates \a this->_arr instance of DataArrayDouble to
+ * append data of a given MEDCouplingFieldDouble. So that the size of \a this->_arr becomes
+ * larger by the size of \a field. Returns an id of the first not filled
+ * tuple of \a this->_arr.
+ * \param [in] field - the field to copy the info on components and the name from.
+ * \return int - the id of first not initialized tuple of \a this->_arr.
+ * \throw If the name of \a field is empty.
+ * \throw If the data array of \a field is not set.
+ * \throw If \a this->_arr is already allocated but has different number of components
+ * than \a field.
*/
int MEDFileField1TSWithoutSDA::copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
{
}
}
+/*!
+ * Returns the name of \a this field.
+ * \return std::string - a string containing the field name.
+ */
std::string MEDFileField1TSWithoutSDA::getName() const
{
const DataArrayDouble *arr=getOrCreateAndGetArray();
return arr->getName();
}
+/*!
+ * Sets name of \a this field
+ * \param [in] name - the new field name.
+ */
void MEDFileField1TSWithoutSDA::setName(const char *name)
{
DataArrayDouble *arr=getOrCreateAndGetArray();
arr->setName(name);
}
+/*!
+ * Prints a string describing \a this field into a stream. This string is outputted
+ * by \c print Python command.
+ * \param [in] bkOffset - number of white spaces printed at the beginning of each line.
+ * \param [in,out] oss - the out stream.
+ * \param [in] f1tsId - the field index within a MED file. If \a f1tsId < 0, the tiny
+ * info id printed, else, not.
+ */
void MEDFileField1TSWithoutSDA::simpleRepr(int bkOffset, std::ostream& oss, int f1tsId) const
{
std::string startOfLine(bkOffset,' ');
oss << startOfLine << "----------------------" << std::endl;
}
+/*!
+ * Returns the mesh name.
+ * \return std::string - a string holding the mesh name.
+ * \throw If \c _field_per_mesh.empty()
+ */
std::string MEDFileField1TSWithoutSDA::getMeshName() const throw(INTERP_KERNEL::Exception)
{
if(_field_per_mesh.empty())
return ret;
}
+/*!
+ * Returns the number of iteration of the state of underlying mesh.
+ * \return int - the iteration number.
+ * \throw If \c _field_per_mesh.empty()
+ */
int MEDFileField1TSWithoutSDA::getMeshIteration() const throw(INTERP_KERNEL::Exception)
{
if(_field_per_mesh.empty())
return _field_per_mesh[0]->getMeshIteration();
}
+/*!
+ * Returns the order number of iteration of the state of underlying mesh.
+ * \return int - the order number.
+ * \throw If \c _field_per_mesh.empty()
+ */
int MEDFileField1TSWithoutSDA::getMeshOrder() const throw(INTERP_KERNEL::Exception)
{
if(_field_per_mesh.empty())
return _field_per_mesh[0]->getMeshOrder();
}
+/*!
+ * Returns number of components in \a this field
+ * \return int - the number of components.
+ */
int MEDFileField1TSWithoutSDA::getNumberOfComponents() const
{
return getOrCreateAndGetArray()->getNumberOfComponents();
}
+/*!
+ * Checks if \a this field is tagged by a given iteration number and a given
+ * iteration order number.
+ * \param [in] iteration - the iteration number of interest.
+ * \param [in] order - the iteration order number of interest.
+ * \return bool - \c true if \a this->getIteration() == \a iteration &&
+ * \a this->getOrder() == \a order.
+ */
bool MEDFileField1TSWithoutSDA::isDealingTS(int iteration, int order) const
{
return iteration==_iteration && order==_order;
}
+/*!
+ * Returns number of iteration and order number of iteration when
+ * \a this field has been calculated.
+ * \return std::pair<int,int> - a pair of the iteration number and the iteration
+ * order number.
+ */
std::pair<int,int> MEDFileField1TSWithoutSDA::getDtIt() const
{
std::pair<int,int> p;
return p;
}
+/*!
+ * Returns number of iteration and order number of iteration when
+ * \a this field has been calculated.
+ * \param [in,out] p - a pair returning the iteration number and the iteration
+ * order number.
+ */
void MEDFileField1TSWithoutSDA::fillIteration(std::pair<int,int>& p) const
{
p.first=_iteration;
p.second=_order;
}
+/*!
+ * Returns all types of spatial discretization of \a this field.
+ * \param [in,out] types - a sequence of types of \a this field.
+ */
void MEDFileField1TSWithoutSDA::fillTypesOfFieldAvailable(std::vector<TypeOfField>& types) const throw(INTERP_KERNEL::Exception)
{
std::set<TypeOfField> types2;
std::copy(types2.begin(),types2.end(),bi);
}
+/*!
+ * Returns info on components of \a this field.
+ * \return const std::vector<std::string>& - a sequence of strings each being an
+ * information on _i_-th component.
+ */
const std::vector<std::string>& MEDFileField1TSWithoutSDA::getInfo() const
{
const DataArrayDouble *arr=getOrCreateAndGetArray();
return arr->getInfoOnComponents();
}
+/*!
+ * Returns a mutable info on components of \a this field.
+ * \return std::vector<std::string>& - a sequence of strings each being an
+ * information on _i_-th component.
+ */
std::vector<std::string>& MEDFileField1TSWithoutSDA::getInfo()
{
DataArrayDouble *arr=getOrCreateAndGetArray();
}
/*!
- * This method has one input 'mname'. It can be null if the user is the general case where there is only one meshName lying on 'this'
- * This method returns two things.
- * - The absolute dimension of 'this' in first parameter.
- * - The available ext levels relative to the absolute dimension returned in first parameter. These relative levels are relative
- * to the first output parameter. The values in 'levs' will be returned in decreasing order.
- *
- * This method is designed for MEDFileField1TS instances that have a discritization ON_CELLS, ON_GAUSS_NE and ON_GAUSS.
- * Only these 3 discretizations will be taken into account here.
- *
- * If 'this' is empty this method will throw an INTERP_KERNEL::Exception.
- * If there is \b only node fields defined in 'this' -1 is returned and 'levs' output parameter will be empty. In this
- * case the caller has to know the underlying mesh it refers to. By defaut it is the level 0 of the corresponding mesh.
- *
- * This method is usefull to make the link between meshDimension of the underlying mesh in 'this' and the levels on 'this'.
- * It is possible (even if it is not common) that the highest level in 'this' were not equal to the meshDimension of the underlying mesh in 'this'.
+ * Returns dimensions of mesh elements \a this field lies on. The returned value is a
+ * maximal absolute dimension and values returned via the out parameter \a levs are
+ * dimensions relative to the maximal absolute dimension. <br>
+ * This method is designed for MEDFileField1TS instances that have a discretization
+ * \ref ParaMEDMEM::ON_CELLS "ON_CELLS",
+ * \ref ParaMEDMEM::ON_GAUSS_PT "ON_GAUSS_PT",
+ * \ref ParaMEDMEM::ON_GAUSS_NE "ON_GAUSS_NE".
+ * Only these 3 discretizations will be taken into account here. If \a this is
+ * \ref ParaMEDMEM::ON_NODES "ON_NODES", -1 is returned and \a levs are empty.<br>
+ * This method is useful to make the link between the dimension of the underlying mesh
+ * and the levels of \a this, because it is possible that the highest dimension of \a this
+ * field is not equal to the dimension of the underlying mesh.
*
- * Let's consider the typical following case :
- * - a mesh 'm1' has a meshDimension 3 and has the following non empty levels
- * [0,-1,-2] for example 'm1' lies on TETRA4, HEXA8 TRI3 and SEG2
- * - 'f1' lies on 'm1' and is defined on 3D and 1D cells for example
- * TETRA4 and SEG2
- * - 'f2' lies on 'm1' too and is defined on 2D and 1D cells for example TRI3 and SEG2
+ * Let's consider the following case:
+ * - mesh \a m1 has a meshDimension 3 and has non empty levels [0,-1,-2] with elements
+ * TETRA4, HEXA8, TRI3 and SEG2.
+ * - field \a f1 lies on \a m1 and is defined on 3D and 1D elements TETRA4 and SEG2.
+ * - field \a f2 lies on \a m1 and is defined on 2D and 1D elements TRI3 and SEG2.
*
- * In this case f1->getNonEmptyLevelsExt will return (3,[0,-2]) and f2->getNonEmptyLevelsExt will return (2,[0,-1])
- *
- * To retrieve the highest level of f1 it should be done, f1->getFieldAtLevel(ON_CELLS,3-3+0);//absDim-meshDim+relativeLev
- * To retrieve the lowest level of f1 it should be done, f1->getFieldAtLevel(ON_CELLS,3-3+(-2));//absDim-meshDim+relativeLev
- * 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
+ * In this case \a f1->getNonEmptyLevels() returns (3,[0,-2]) and \a
+ * f2->getNonEmptyLevels() returns (2,[0,-1]). <br>
+ * The returned values can be used for example to retrieve a MEDCouplingFieldDouble lying
+ * on elements of a certain relative level by calling getFieldAtLevel(). \a meshDimRelToMax
+ * parameter of getFieldAtLevel() is computed basing on the returned values as this:
+ * <em> meshDimRelToMax = absDim - meshDim + relativeLev </em>.
+ * For example<br>
+ * to retrieve the highest level of
+ * \a f1: <em>f1->getFieldAtLevel( ON_CELLS, 3-3+0 ); // absDim - meshDim + relativeLev</em><br>
+ * to retrieve the lowest level of \a f1: <em>f1->getFieldAtLevel( ON_CELLS, 3-3+(-2) );</em><br>
+ * to retrieve the highest level of \a f2: <em>f2->getFieldAtLevel( ON_CELLS, 2-3+0 );</em><br>
+ * to retrieve the lowest level of \a f2: <em>f2->getFieldAtLevel( ON_CELLS, 2-3+(-1) )</em>.
+ * \param [in] mname - a name of a mesh of interest. It can be \c NULL, which is valid
+ * for the case with only one underlying mesh. (Actually, the number of meshes is
+ * not checked if \a mname == \c NULL).
+ * \param [in,out] levs - a sequence returning the dimensions relative to the maximal
+ * absolute one. They are in decreasing order. This sequence is cleared before
+ * filling it in.
+ * \return int - the maximal absolute dimension of elements \a this fields lies on.
+ * \throw If no field is lying on \a mname.
*/
int MEDFileField1TSWithoutSDA::getNonEmptyLevels(const char *mname, std::vector<int>& levs) const throw(INTERP_KERNEL::Exception)
{
return ret;
}
+/*!
+ * Returns all types of spatial discretization of \a this field.
+ * \return std::vector<TypeOfField> - a sequence of types of spatial discretization
+ * of \a this field.
+ */
std::vector<TypeOfField> MEDFileField1TSWithoutSDA::getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
{
std::vector<TypeOfField> ret;
}
/*!
- * entry point for users that want to iterate into MEDFile DataStructure without any overhead.
+ * Returns all attributes of parts of \a this field lying on a given mesh.
+ * Each part differs from other ones by a type of supporting mesh entity. The _i_-th
+ * item of every of returned sequences refers to the _i_-th part of \a this field.
+ * Thus all sequences returned by this method are of the same length equal to number
+ * of different types of supporting entities.<br>
+ * A field part can include sub-parts with several different spatial discretizations,
+ * \ref ParaMEDMEM::ON_CELLS "ON_CELLS" and \ref ParaMEDMEM::ON_GAUSS_PT "ON_GAUSS_PT"
+ * for example. Hence, some of the returned sequences contains nested sequences, and an item
+ * of a nested sequence corresponds to a type of spatial discretization.<br>
+ * This method allows for iteration over MEDFile DataStructure without any overhead.
+ * \param [in] mname - a name of a mesh of interest. It can be \c NULL, which is valid
+ * for the case with only one underlying mesh. (Actually, the number of meshes is
+ * not checked if \a mname == \c NULL).
+ * \param [in,out] types - a sequence of types of underlying mesh entities. A type per
+ * a field part is returned.
+ * \param [in,out] typesF - a sequence of sequences of types of spatial discretizations.
+ * This sequence is of the same length as \a types.
+ * \param [in,out] pfls - a sequence returning a profile name per each type of spatial
+ * discretization. A profile name can be empty.
+ * Length of this and of nested sequences is the same as that of \a typesF.
+ * \param [in,out] locs - a sequence returning a localization name per each type of spatial
+ * discretization. A localization name can be empty.
+ * Length of this and of nested sequences is the same as that of \a typesF.
+ * \return std::vector< std::vector< std::pair<int,int> > > - a sequence holding a range
+ * of ids of tuples within the data array, per each type of spatial
+ * discretization within one mesh entity type.
+ * 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> > > MEDFileField1TSWithoutSDA::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 throw(INTERP_KERNEL::Exception)
{
}
/*!
- * 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.
+ * Returns all attributes and values of parts of \a this field lying on a given mesh.
+ * Each part differs from other ones by a type of supporting mesh entity. The _i_-th
+ * item of every of returned sequences refers to the _i_-th part of \a this field.
+ * Thus all sequences returned by this method are of the same length equal to number
+ * of different types of supporting entities.<br>
+ * A field part can include sub-parts with several different spatial discretizations,
+ * \ref ParaMEDMEM::ON_CELLS "ON_CELLS" and \ref ParaMEDMEM::ON_GAUSS_PT "ON_GAUSS_PT"
+ * for example. Hence, some of the returned sequences contains nested sequences, and an item
+ * of a nested sequence corresponds to a type of spatial discretization.<br>
+ * This method allows for iteration over MEDFile DataStructure with a reduced overhead.
+ * The overhead is due to selecting values into new instances of DataArrayDouble.
+ * \param [in] mname - a name of a mesh of interest. It can be \c NULL, which is valid
+ * for the case with only one underlying mesh. (Actually, the number of meshes is
+ * not checked if \a mname == \c NULL).
+ * \param [in,out] types - a sequence of types of underlying mesh entities. A type per
+ * a field part is returned.
+ * \param [in,out] typesF - a sequence of sequences of types of spatial discretizations.
+ * A field part can include sub-parts with several different spatial discretizations,
+ * \ref ParaMEDMEM::ON_CELLS "ON_CELLS" and
+ * \ref ParaMEDMEM::ON_GAUSS_PT "ON_GAUSS_PT" for example.
+ * This sequence is of the same length as \a types.
+ * \param [in,out] pfls - a sequence returning a profile name per each type of spatial
+ * discretization. A profile name can be empty.
+ * Length of this and of nested sequences is the same as that of \a typesF.
+ * \param [in,out] locs - a sequence returning a localization name per each type of spatial
+ * discretization. A localization name can be empty.
+ * Length of this and of nested sequences is the same as that of \a typesF.
+ * \return std::vector< std::vector<DataArrayDouble *> > - a sequence holding arrays of values
+ * per each type of spatial discretization within one mesh entity type.
+ * The caller is to delete each DataArrayDouble using decrRef() as it is no more needed.
+ * 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 throw(INTERP_KERNEL::Exception)
{
}
/*!
- * SBT means Sort By Type.
- * This method is the most basic method to assign field in this. Basic in sense that no renumbering is done. Underlying mesh in 'field' is globaly ignored except for type contiguous check.
+ * Adds a MEDCouplingFieldDouble to \a this. The underlying mesh of the given field is
+ * checked if its elements are sorted suitable for writing to MED file ("STB" stands for
+ * "Sort By Type"), if not, an exception is thrown.
+ * \param [in] field - the field to add to \a this.
+ * \param [in,out] glob - the global data where profiles and localization present in
+ * \a field, if any, are added.
+ * \throw If the name of \a field is empty.
+ * \throw If the data array of \a field is not set.
+ * \throw If \a this->_arr is already allocated but has different number of components
+ * than \a field.
+ * \throw If the underlying mesh of \a field has no name.
+ * \throw If elements in the mesh are not in the order suitable for writing to the MED file.
*/
void MEDFileField1TSWithoutSDA::setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, MEDFileFieldGlobsReal& glob) throw(INTERP_KERNEL::Exception)
{
}
/*!
- * Generalization of MEDFileField1TSWithoutSDA::setFieldNoProfileSBT method.
+ * Adds a MEDCouplingFieldDouble to \a this. Specified entities of a given dimension
+ * of a given mesh are used as the support of the given field (a real support is not used).
+ * Elements of the given mesh must be sorted suitable for writing to MED file.
+ * Order of underlying mesh entities of the given field specified by \a profile parameter
+ * is not prescribed; this method permutes field values to have them sorted by element
+ * type as required for writing to MED file. A new profile is added only if no equal
+ * profile is missing.
+ * \param [in] field - the field to add to \a this.
+ * \param [in] mesh - the supporting mesh of \a field.
+ * \param [in] meshDimRelToMax - a relative dimension of mesh entities \a field lies on.
+ * \param [in] profile - ids of mesh entities on which corresponding field values lie.
+ * \param [in,out] glob - the global data where profiles and localization present in
+ * \a field, if any, are added.
+ * \throw If either \a field or \a mesh or \a profile has an empty name.
+ * \throw If there are no mesh entities of \a meshDimRelToMax dimension in \a mesh.
+ * \throw If the data array of \a field is not set.
+ * \throw If \a this->_arr is already allocated but has different number of components
+ * than \a field.
+ * \throw If elements in \a mesh are not in the order suitable for writing to the MED file.
+ * \sa setFieldNoProfileSBT()
*/
void MEDFileField1TSWithoutSDA::setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile, MEDFileFieldGlobsReal& glob) throw(INTERP_KERNEL::Exception)
{
}
}
+/*!
+ * Returns a new MEDCouplingFieldDouble of given type lying on a given support.
+ * \param [in] type - a spatial discretization of the new field.
+ * \param [in] meshDimRelToMax - a relative dimension of the supporting mesh entities.
+ * \param [in] mName - a name of the supporting mesh.
+ * \param [in] renumPol - specifies how to permute values of the result field according to
+ * the optional numbers of cells and nodes, if any. The valid values are
+ * - 0 - do not permute.
+ * - 1 - permute cells.
+ * - 2 - permute nodes.
+ * - 3 - permute cells and nodes.
+ *
+ * \param [in] glob - the global data storing profiles and localization.
+ * \return MEDCouplingFieldDouble * - a new instance of MEDCouplingFieldDouble. The
+ * caller is to delete this field using decrRef() as it is no more needed.
+ * \throw If the MED file is not readable.
+ * \throw If there is no mesh named \a mName in the MED file.
+ * \throw If there are no mesh entities of \a meshDimRelToMax dimension in the mesh.
+ * \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 *MEDFileField1TSWithoutSDA::getFieldAtLevel(TypeOfField type, int meshDimRelToMax, const char *mName, int renumPol, const MEDFileFieldGlobsReal *glob) const throw(INTERP_KERNEL::Exception)
{
MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm;
return MEDFileField1TSWithoutSDA::getFieldOnMeshAtLevel(type,meshDimRelToMax,renumPol,glob,mm);
}
+/*!
+ * Returns a new MEDCouplingFieldDouble of given type lying on a given support.
+ * \param [in] type - a spatial discretization of the new field.
+ * \param [in] meshDimRelToMax - a relative dimension of the supporting mesh entities.
+ * \param [in] renumPol - specifies how to permute values of the result field according to
+ * the optional numbers of cells and nodes, if any. The valid values are
+ * - 0 - do not permute.
+ * - 1 - permute cells.
+ * - 2 - permute nodes.
+ * - 3 - permute cells and nodes.
+ *
+ * \param [in] glob - the global data storing profiles and localization.
+ * \param [in] mesh - the supporting mesh.
+ * \return MEDCouplingFieldDouble * - a new instance of MEDCouplingFieldDouble. The
+ * caller is to delete this field using decrRef() as it is no more needed.
+ * \throw If the MED file is not readable.
+ * \throw If no field of \a this is lying on \a mesh.
+ * \throw If there are no mesh entities of \a meshDimRelToMax dimension in the mesh.
+ * \throw If no field values of the given \a type or given \a meshDimRelToMax are available.
+ */
MEDCouplingFieldDouble *MEDFileField1TSWithoutSDA::getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol, const MEDFileFieldGlobsReal *glob, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
{
MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> m=mesh->getGenMeshAtLevel(meshDimRelToMax,false);
return MEDFileField1TSWithoutSDA::getFieldOnMeshAtLevel(type,renumPol,glob,m,d,e);
}
+/*!
+ * Returns a new MEDCouplingFieldDouble of a given type lying on the top level cells of a
+ * given mesh.
+ * \param [in] type - a spatial discretization of the new field.
+ * \param [in] mName - a name of the supporting mesh.
+ * \param [in] renumPol - specifies how to permute values of the result field according to
+ * the optional numbers of cells and nodes, if any. The valid values are
+ * - 0 - do not permute.
+ * - 1 - permute cells.
+ * - 2 - permute nodes.
+ * - 3 - permute cells and nodes.
+ *
+ * \param [in] glob - the global data storing profiles and localization.
+ * \return MEDCouplingFieldDouble * - a new instance of MEDCouplingFieldDouble. The
+ * caller is to delete this field using decrRef() as it is no more needed.
+ * \throw If the MED file is not readable.
+ * \throw If there is no mesh named \a mName in the MED file.
+ * \throw If there are no mesh entities in the mesh.
+ * \throw If no field values of the given \a type are available.
+ */
MEDCouplingFieldDouble *MEDFileField1TSWithoutSDA::getFieldAtTopLevel(TypeOfField type, const char *mName, int renumPol, const MEDFileFieldGlobsReal *glob) const throw(INTERP_KERNEL::Exception)
{
MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm;
}
/*!
- * \param [in] mesh is the whole mesh.
+ * Returns a new MEDCouplingFieldDouble of given type lying on a given support.
+ * \param [in] type - a spatial discretization of the new field.
+ * \param [in] renumPol - specifies how to permute values of the result field according to
+ * the optional numbers of cells and nodes, if any. The valid values are
+ * - 0 - do not permute.
+ * - 1 - permute cells.
+ * - 2 - permute nodes.
+ * - 3 - permute cells and nodes.
+ *
+ * \param [in] glob - the global data storing profiles and localization.
+ * \param [in] mesh - the supporting mesh.
+ * \param [in] cellRenum - the cell numbers array used for permutation of the result
+ * field according to \a renumPol.
+ * \param [in] nodeRenum - the node numbers array used for permutation of the result
+ * field according to \a renumPol.
+ * \return MEDCouplingFieldDouble * - a new instance of MEDCouplingFieldDouble. The
+ * caller is to delete this field using decrRef() as it is no more needed.
+ * \throw If there are no mesh entities of \a meshDimRelToMax dimension in the mesh.
+ * \throw If no field of \a this is lying on \a mesh.
+ * \throw If no field values of the given \a type or given \a meshDimRelToMax are available.
*/
MEDCouplingFieldDouble *MEDFileField1TSWithoutSDA::getFieldOnMeshAtLevel(TypeOfField type, int renumPol, const MEDFileFieldGlobsReal *glob, const MEDCouplingMesh *mesh, const DataArrayInt *cellRenum, const DataArrayInt *nodeRenum) const throw(INTERP_KERNEL::Exception)
{
}
}
+/*!
+ * Returns values and a profile of the field of a given type lying on a given support.
+ * \param [in] type - a spatial discretization of the field.
+ * \param [in] meshDimRelToMax - a relative dimension of the supporting mesh entities.
+ * \param [in] mesh - the supporting mesh.
+ * \param [out] pfl - a new instance of DataArrayInt holding ids of mesh entities the
+ * field of interest lies on. If the field lies on all entities of the given
+ * dimension, all ids in \a pfl are zero. The caller is to delete this array
+ * using decrRef() as it is no more needed.
+ * \param [in] glob - the global data storing profiles and localization.
+ * \return DataArrayDouble * - a new instance of DataArrayDouble holding values of the
+ * field. The caller is to delete this array using decrRef() as it is no more needed.
+ * \throw If there are no mesh entities of \a meshDimRelToMax dimension in \a mesh.
+ * \throw If no field of \a this is lying on \a mesh.
+ * \throw If no field values of the given \a type are available.
+ */
DataArrayDouble *MEDFileField1TSWithoutSDA::getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl, const MEDFileFieldGlobsReal *glob) const throw(INTERP_KERNEL::Exception)
{
MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> m=mesh->getGenMeshAtLevel(meshDimRelToMax);
}
/*!
- * This method retrieves direct access to the underground ParaMEDMEM::DataArrayDouble instance. The returned array is not a newly
- * created array so it should \b not be dealed by the caller.
- * This method allows to the user a direct access to the values.
- * This method is quite unusable if there is more than a nodal field or a cell field on single geometric cell type.
+ * Returns a pointer to the underground DataArrayDouble instance. So the
+ * caller should not decrRef() it. This method allows for a direct access to the field
+ * values. This method is quite unusable if there is more than a nodal field or a cell
+ * field on single geometric cell type.
+ * \return DataArrayDouble * - the pointer to the field values array.
*/
DataArrayDouble *MEDFileField1TSWithoutSDA::getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
{
}
/*!
- * This method returns an array that the caller must deal with (contrary to those returned by MEDFileField1TSWithoutSDA::getUndergroundDataArray method).
- * The returned array is the result of the aggregation of all sub arrays stored in the MED file. So to allow the caller to select the output param
- * 'entries' is returned. This output param is a vector of a pair of 2 pairs. The first pair of pair informs of the geometric type it refers to and the discretization
- * id attached to it. The second pair of pair precise the range [begin,end) into the returned array.
- * This method makes the hypothesis that the field lies only on one mesh. If it is not the case an exception will be thrown.
+ * Returns a pointer to the underground DataArrayDouble instance and a
+ * sequence describing parameters of a support of each part of \a this field. The
+ * caller should not decrRef() the returned DataArrayDouble. This method allows for a
+ * direct access to the field values. This method is intended for the field lying on one
+ * mesh only.
+ * \param [in,out] entries - the sequence describing parameters of a support of each
+ * part of \a this field. Each item of this sequence consists of two parts. The
+ * first part describes a type of mesh entity and an id of discretization of a
+ * current field part. The second part describes a range of values [begin,end)
+ * within the returned array relating to the current field part.
+ * \return DataArrayDouble * - the pointer to the field values array.
+ * \throw If the number of underlying meshes is not equal to 1.
+ * \throw If no field values are available.
+ * \sa getUndergroundDataArray()
*/
DataArrayDouble *MEDFileField1TSWithoutSDA::getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const throw(INTERP_KERNEL::Exception)
{
}
/*!
- * This methods returns a new instance (to be dealt by the caller).
- * This method returns for the first field in the file \a fileName the first time step of this first field, if
- * such field exists and time step exists. If not, an INTERP_KERNEL::Exception will be thrown.
+ * Returns a new instance of MEDFileField1TS holding data of the first time step of
+ * the first field that has been read from a specified MED file.
+ * \param [in] fileName - the name of the MED file to read.
+ * \return MEDFileField1TS * - a new instance of MEDFileFieldMultiTS. The caller
+ * 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) throw(INTERP_KERNEL::Exception)
{
}
/*!
- * This methods returns a new instance (to be dealt by the caller).
- * This method returns the first time step of the field \a fieldName in file \a fieldName, if
- * such field exists. If not, an INTERP_KERNEL::Exception will be thrown.
+ * Returns a new instance of MEDFileField1TS holding data of the first time step of
+ * a given field that has been read from a specified MED file.
+ * \param [in] fileName - the name of the MED file to read.
+ * \param [in] fieldName - the name of the field to read.
+ * \return MEDFileField1TS * - a new instance of MEDFileFieldMultiTS. The caller
+ * is to delete this field using decrRef() as it is no more needed.
+ * \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) throw(INTERP_KERNEL::Exception)
{
return new MEDFileField1TS(fileName,fieldName);
}
+/*!
+ * Returns a new instance of MEDFileField1TS holding data of a given time step of
+ * a given field that has been read from a specified MED file.
+ * \param [in] fileName - the name of the MED file to read.
+ * \param [in] fieldName - the name of the field to read.
+ * \param [in] iteration - the iteration number of a required time step.
+ * \param [in] order - the iteration order number of required time step.
+ * \return MEDFileField1TS * - a new instance of MEDFileFieldMultiTS. The caller
+ * is to delete this field using decrRef() as it is no more needed.
+ * \throw If reading the file fails.
+ * \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) throw(INTERP_KERNEL::Exception)
{
return new MEDFileField1TS(fileName,fieldName,iteration,order);
}
/*!
+ * Returns a new instance of MEDFileField1TS holding either deep or shallow copy
+ * of a given MEDFileField1TSWithoutSDA.
* \warning this is a shallow copy constructor
+ * \param [in] other - a MEDFileField1TSWithoutSDA to copy.
+ * \param [in] shallowCopyOfContent - if \c true, a shallow copy of \a other is created.
+ * \return MEDFileField1TS * - a new instance of MEDFileFieldMultiTS. The caller
+ * is to delete this field using decrRef() as it is no more needed.
*/
MEDFileField1TS *MEDFileField1TS::New(const MEDFileField1TSWithoutSDA& other, bool shallowCopyOfContent)
{
return new MEDFileField1TS(other,shallowCopyOfContent);
}
+/*!
+ * Returns a new empty instance of MEDFileField1TS.
+ * \return MEDFileField1TS * - a new instance of MEDFileField1TS. The caller
+ * is to delete this field using decrRef() as it is no more needed.
+ */
MEDFileField1TS *MEDFileField1TS::New()
{
return new MEDFileField1TS;
}
+/*!
+ * Returns a string describing \a this field. This string is outputted
+ * by \c print Python command.
+ */
std::string MEDFileField1TS::simpleRepr() const
{
std::ostringstream oss;
_content->writeLL(fid,*this);
}
+/*!
+ * Writes \a this field into a MED file specified by its name.
+ * \param [in] fileName - the MED file name.
+ * \param [in] mode - the writing mode. For more on \a mode, see \ref AdvMEDLoaderBasics.
+ * - 2 - erase; an existing file is removed.
+ * - 1 - append; same data should not be present in an existing file.
+ * - 0 - overwrite; same data present in an existing file is overwritten.
+ * \throw If the field name is not set.
+ * \throw If no field data is set.
+ * \throw If \a mode == 1 and the same data is present in an existing file.
+ */
void MEDFileField1TS::write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception)
{
med_access_mode medmod=MEDFileUtilities::TraduceWriteMode(mode);
}
/*!
- * This method requests underlying file to perform the job, for mesh reading. If the current instance is not coming from a file and has been constructed from scratch
- * an exception will be thrown. In this case you should use MEDFileField1TS::getFieldOnMeshAtLevel method instead.
- * \b WARNING ! Parameter 'meshDimRelToMax' is relative from read mesh in file that can be different from the field in MED file !
- * It leads that the returned field of this method is always coherent.
+ * Returns a new MEDCouplingFieldDouble of a given type lying on
+ * mesh entities of a given dimension of the first mesh in MED file. If \a this field
+ * has not been constructed via file reading, an exception is thrown.
+ * For more info, see \ref AdvMEDLoaderAPIFieldRW
+ * \param [in] type - a spatial discretization of interest.
+ * \param [in] meshDimRelToMax - a relative dimension of the supporting mesh entities.
+ * \param [in] renumPol - specifies how to permute values of the result field according to
+ * the optional numbers of cells and nodes, if any. The valid values are
+ * - 0 - do not permute.
+ * - 1 - permute cells.
+ * - 2 - permute nodes.
+ * - 3 - permute cells and nodes.
+ *
+ * \return MEDCouplingFieldDouble * - a new instance of MEDCouplingFieldDouble. The
+ * caller is to delete this field using decrRef() as it is no more needed.
+ * \throw If \a this field has not been constructed via file reading.
+ * \throw If the MED file is not readable.
+ * \throw If there is no mesh in the MED file.
+ * \throw If there are no mesh entities of \a meshDimRelToMax dimension in the mesh.
+ * \throw If no field values of the given \a type or given \a meshDimRelToMax are available.
+ * \sa getFieldOnMeshAtLevel()
*/
MEDCouplingFieldDouble *MEDFileField1TS::getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol) const throw(INTERP_KERNEL::Exception)
{
throw INTERP_KERNEL::Exception("MEDFileField1TS::getFieldAtLevel : Request for a method that can be used for instances coming from file loading ! Use getFieldOnMeshAtLevel method instead !");
return _content->getFieldAtLevel(type,meshDimRelToMax,0,renumPol,this);
}
-
/*!
- * This method is close to MEDFileField1TS::getFieldAtLevel except that here the 'meshDimRelToMax' param is ignored and the maximal dimension is taken
- * automatically. If the field lies on different level and that an another level than the maximal is requested MEDFileField1TS::getFieldAtLevel
- * should be called instead.
+ * Returns a new MEDCouplingFieldDouble of a given type lying on
+ * the top level cells of the first mesh in MED file. If \a this field
+ * has not been constructed via file reading, an exception is thrown.
+ * For more info, see \ref AdvMEDLoaderAPIFieldRW
+ * \param [in] type - a spatial discretization of interest.
+ * \param [in] renumPol - specifies how to permute values of the result field according to
+ * the optional numbers of cells and nodes, if any. The valid values are
+ * - 0 - do not permute.
+ * - 1 - permute cells.
+ * - 2 - permute nodes.
+ * - 3 - permute cells and nodes.
+ *
+ * \return MEDCouplingFieldDouble * - a new instance of MEDCouplingFieldDouble. The
+ * caller is to delete this field using decrRef() as it is no more needed.
+ * \throw If \a this field has not been constructed via file reading.
+ * \throw If the MED file is not readable.
+ * \throw If there is no mesh in the MED file.
+ * \throw If no field values of the given \a type.
+ * \throw If no field values lying on the top level support.
+ * \sa getFieldAtLevel()
*/
MEDCouplingFieldDouble *MEDFileField1TS::getFieldAtTopLevel(TypeOfField type, int renumPol) const throw(INTERP_KERNEL::Exception)
{
return _content->getFieldAtTopLevel(type,0,renumPol,this);
}
+
/*!
- * \b WARNING, there is a main difference with the two close methods (MEDFileField1TS::getFieldAtLevel and MEDFileField1TS::getFieldOnMeshAtLevel method) !
- * Here the mesh-dimension of 'mesh' is used by this to automatically request the right geoTypes regarding 'type'.
- * If no such element fufilled the deduced dimension and 'type' an exception will be thrown.
- * It leads that the returned field of this method is always coherent.
+ * Returns a new MEDCouplingFieldDouble of given type lying on a given mesh.
+ * For more info, see \ref AdvMEDLoaderAPIFieldRW
+ * \param [in] type - a spatial discretization of the new field.
+ * \param [in] mesh - the supporting mesh.
+ * \param [in] renumPol - specifies how to permute values of the result field according to
+ * the optional numbers of cells and nodes, if any. The valid values are
+ * - 0 - do not permute.
+ * - 1 - permute cells.
+ * - 2 - permute nodes.
+ * - 3 - permute cells and nodes.
+ *
+ * \return MEDCouplingFieldDouble * - a new instance of MEDCouplingFieldDouble. The
+ * caller is to delete this field using decrRef() as it is no more needed.
+ * \throw If no field of \a this is lying on \a mesh.
+ * \throw If the mesh is empty.
+ * \throw If no field values of the given \a type are available.
+ * \sa getFieldAtLevel()
+ * \sa getFieldOnMeshAtLevel()
*/
MEDCouplingFieldDouble *MEDFileField1TS::getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol) const throw(INTERP_KERNEL::Exception)
{
}
/*!
- * This method can be called whatever the mode of instance feeding of this (MED file or from scratch).
- * But the parameter ''meshDimRelToMax' is applyied on 'mesh' (like MEDFileField1TS::getFieldAtLevel does). \b WARNING the dim of 'this' can be different from those in 'mesh' !
- * It leads that the returned field of this method is always coherent.
+ * Returns a new MEDCouplingFieldDouble of a given type lying on a given support.
+ * For more info, see \ref AdvMEDLoaderAPIFieldRW
+ * \param [in] type - a spatial discretization of interest.
+ * \param [in] meshDimRelToMax - a relative dimension of the supporting mesh entities.
+ * \param [in] mesh - the supporting mesh.
+ * \param [in] renumPol - specifies how to permute values of the result field according to
+ * the optional numbers of cells and nodes, if any. The valid values are
+ * - 0 - do not permute.
+ * - 1 - permute cells.
+ * - 2 - permute nodes.
+ * - 3 - permute cells and nodes.
+ *
+ * \return MEDCouplingFieldDouble * - a new instance of MEDCouplingFieldDouble. The
+ * caller is to delete this field using decrRef() as it is no more needed.
+ * \throw If there are no mesh entities of \a meshDimRelToMax dimension in the mesh.
+ * \throw If no field of \a this is lying on \a mesh.
+ * \throw If no field values of the given \a type or given \a meshDimRelToMax are available.
+ * \sa getFieldAtLevel()
+ * \sa getFieldOnMeshAtLevel()
*/
MEDCouplingFieldDouble *MEDFileField1TS::getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol) const throw(INTERP_KERNEL::Exception)
{
}
/*!
- * This method is identical to MEDFileField1TS::getFieldAtLevel method except that meshName 'mname' should be specified.
- * This method is called "Old" because in MED3 norm a field has only one meshName attached. This method is only here for reader of MED2 files.
- * See MEDFileField1TS::getFieldAtLevel for more information.
+ * Returns a new MEDCouplingFieldDouble of a given type lying on a given support.
+ * This method is called "Old" because in MED3 norm a field has only one meshName
+ * attached, so this method is for readers of MED2 files. If \a this field
+ * has not been constructed via file reading, an exception is thrown.
+ * For more info, see \ref AdvMEDLoaderAPIFieldRW
+ * \param [in] type - a spatial discretization of interest.
+ * \param [in] mName - a name of the supporting mesh.
+ * \param [in] meshDimRelToMax - a relative dimension of the supporting mesh entities.
+ * \param [in] renumPol - specifies how to permute values of the result field according to
+ * the optional numbers of cells and nodes, if any. The valid values are
+ * - 0 - do not permute.
+ * - 1 - permute cells.
+ * - 2 - permute nodes.
+ * - 3 - permute cells and nodes.
+ *
+ * \return MEDCouplingFieldDouble * - a new instance of MEDCouplingFieldDouble. The
+ * caller is to delete this field using decrRef() as it is no more needed.
+ * \throw If the MED file is not readable.
+ * \throw If there is no mesh named \a mName in the MED file.
+ * \throw If there are no mesh entities of \a meshDimRelToMax dimension in the mesh.
+ * \throw If \a this field has not been constructed via file reading.
+ * \throw If no field of \a this is lying on the mesh named \a mName.
+ * \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 throw(INTERP_KERNEL::Exception)
{
return _content->getFieldAtLevel(type,meshDimRelToMax,mname,renumPol,this);
}
+
+/*!
+ * Returns values and a profile of the field of a given type lying on a given support.
+ * For more info, see \ref AdvMEDLoaderAPIFieldRW
+ * \param [in] type - a spatial discretization of the field.
+ * \param [in] meshDimRelToMax - a relative dimension of the supporting mesh entities.
+ * \param [in] mesh - the supporting mesh.
+ * \param [out] pfl - a new instance of DataArrayInt holding ids of mesh entities the
+ * field of interest lies on. If the field lies on all entities of the given
+ * dimension, all ids in \a pfl are zero. The caller is to delete this array
+ * using decrRef() as it is no more needed.
+ * \return DataArrayDouble * - a new instance of DataArrayDouble holding values of the
+ * field. The caller is to delete this array using decrRef() as it is no more needed.
+ * \throw If there are no mesh entities of \a meshDimRelToMax dimension in \a mesh.
+ * \throw If no field of \a this is lying on \a mesh.
+ * \throw If no field values of the given \a type or given \a meshDimRelToMax are available.
+ */
DataArrayDouble *MEDFileField1TS::getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl) const throw(INTERP_KERNEL::Exception)
{
return _content->getFieldWithProfile(type,meshDimRelToMax,mesh,pfl,this);
}
/*!
- * SBT means Sort By Type.
- * This method is the most basic method to assign field in this. Basic in sense that no renumbering is done. Underlying mesh in 'field' is globaly ignored except for type contiguous check.
- *
+ * Adds a MEDCouplingFieldDouble to \a this. The underlying mesh of the given field is
+ * checked if its elements are sorted suitable for writing to MED file ("STB" stands for
+ * "Sort By Type"), if not, an exception is thrown.
+ * For more info, see \ref AdvMEDLoaderAPIFieldRW
+ * \param [in] field - the field to add to \a this.
+ * \throw If the name of \a field is empty.
+ * \throw If the data array of \a field is not set.
+ * \throw If the data array is already allocated but has different number of components
+ * than \a field.
+ * \throw If the underlying mesh of \a field has no name.
+ * \throw If elements in the mesh are not in the order suitable for writing to the MED file.
*/
void MEDFileField1TS::setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
{
}
/*!
- * This method is a generalization of MEDFileField1TS::setFieldNoProfileSBT method. Here a profile array is given in input.
- * The support of field 'field' is \b not used by this method, so it can be null or incoherent with field.
- * This method uses input parameters 'mesh', 'meshDimRelToMax' and 'profile' to determine what is really the support of field 'field'. If field is incoherent regarding this deduced support,
- * an exception will be thrown.
- * This method is trying to reduce the size of MEDfile file so profile is created only if it is absolutely necessary. If it is necessary the name of 'profile' will be used to create it in 'this'.
- * In this case, if this profile name is empty an exception will be thrown.
+ * Adds a MEDCouplingFieldDouble to \a this. Specified entities of a given dimension
+ * of a given mesh are used as the support of the given field (a real support is not used).
+ * Elements of the given mesh must be sorted suitable for writing to MED file.
+ * Order of underlying mesh entities of the given field specified by \a profile parameter
+ * is not prescribed; this method permutes field values to have them sorted by element
+ * type as required for writing to MED file. A new profile is added only if no equal
+ * profile is missing.
+ * For more info, see \ref AdvMEDLoaderAPIFieldRW
+ * \param [in] field - the field to add to \a this.
+ * \param [in] mesh - the supporting mesh of \a field.
+ * \param [in] meshDimRelToMax - a relative dimension of mesh entities \a field lies on.
+ * \param [in] profile - ids of mesh entities on which corresponding field values lie.
+ * \throw If either \a field or \a mesh or \a profile has an empty name.
+ * \throw If there are no mesh entities of \a meshDimRelToMax dimension in \a mesh.
+ * \throw If the data array of \a field is not set.
+ * \throw If the data array of \a this is already allocated but has different number of
+ * components than \a field.
+ * \throw If elements in \a mesh are not in the order suitable for writing to the MED file.
+ * \sa setFieldNoProfileSBT()
*/
void MEDFileField1TS::setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception)
{
(*it)->changeLocsRefsNamesGen2(mapOfModif);
}
+/*!
+ * Returns a new empty instance of MEDFileFieldMultiTS.
+ * \return MEDFileFieldMultiTS * - a new instance of MEDFileFieldMultiTS. The caller
+ * is to delete this field using decrRef() as it is no more needed.
+ */
MEDFileFieldMultiTS *MEDFileFieldMultiTS::New()
{
return new MEDFileFieldMultiTS;
}
+/*!
+ * Returns a new instance of MEDFileFieldMultiTS holding data of the first field
+ * that has been read from a specified MED file.
+ * \param [in] fileName - the name of the MED file to read.
+ * \return MEDFileFieldMultiTS * - a new instance of MEDFileFieldMultiTS. The caller
+ * 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) throw(INTERP_KERNEL::Exception)
{
return new MEDFileFieldMultiTS(fileName);
}
+/*!
+ * Returns a new instance of MEDFileFieldMultiTS holding data of a given field
+ * that has been read from a specified MED file.
+ * \param [in] fileName - the name of the MED file to read.
+ * \param [in] fieldName - the name of the field to read.
+ * \return MEDFileFieldMultiTS * - a new instance of MEDFileFieldMultiTS. The caller
+ * is to delete this field using decrRef() as it is no more needed.
+ * \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) throw(INTERP_KERNEL::Exception)
{
return new MEDFileFieldMultiTS(fileName,fieldName);
}
+/*!
+ * Returns a new instance of MEDFileFieldMultiTS holding either deep or shallow copy
+ * of a given MEDFileFieldMultiTSWithoutSDA.
+ * \param [in] other - a MEDFileFieldMultiTSWithoutSDA to copy.
+ * \param [in] shallowCopyOfContent - if \c true, a shallow copy of \a other is created.
+ * \return MEDFileFieldMultiTS * - a new instance of MEDFileFieldMultiTS. The caller
+ * is to delete this field using decrRef() as it is no more needed.
+ */
MEDFileFieldMultiTS *MEDFileFieldMultiTS::New(const MEDFileFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent)
{
return new MEDFileFieldMultiTS(other,shallowCopyOfContent);
}
/*!
- * \return a new allocated object that the caller should deal with.
+ * Returns a new MEDFileField1TS holding data of a given time step of \a this field.
+ * \param [in] pos - a time step id.
+ * \return MEDFileField1TS * - a new instance of MEDFileField1TS. The caller is to
+ * delete this field using decrRef() as it is no more needed.
+ * \throw If \a pos is not a valid time step id.
*/
MEDFileField1TS *MEDFileFieldMultiTS::getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception)
{
}
/*!
- * \return a new allocated object that the caller should deal with.
+ * Returns a new MEDFileField1TS holding data of a given time step of \a this field.
+ * \param [in] iteration - the iteration number of a required time step.
+ * \param [in] order - the iteration order number of required time step.
+ * \return MEDFileField1TS * - a new instance of MEDFileField1TS. The caller is to
+ * delete this field using decrRef() as it is no more needed.
+ * \throw If there is no required time step in \a this field.
*/
MEDFileField1TS *MEDFileFieldMultiTS::getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception)
{
}
/*!
- * \return a new allocated object that the caller should deal with.
+ * Returns a new MEDFileField1TS holding data of a given time step of \a this field.
+ * \param [in] time - the time of the time step of interest.
+ * \param [in] eps - a precision used to compare time values.
+ * \return MEDFileField1TS * - a new instance of MEDFileField1TS. The caller is to
+ * delete this field using decrRef() as it is no more needed.
+ * \throw If there is no required time step in \a this field.
*/
MEDFileField1TS *MEDFileFieldMultiTS::getTimeStepGivenTime(double time, double eps) const throw(INTERP_KERNEL::Exception)
{
_content->writeLL(fid,*this);
}
+/*!
+ * Writes \a this field into a MED file specified by its name.
+ * \param [in] fileName - the MED file name.
+ * \param [in] mode - the writing mode. For more on \a mode, see \ref AdvMEDLoaderBasics.
+ * - 2 - erase; an existing file is removed.
+ * - 1 - append; same data should not be present in an existing file.
+ * - 0 - overwrite; same data present in an existing file is overwritten.
+ * \throw If the field name is not set.
+ * \throw If no field data is set.
+ * \throw If \a mode == 1 and the same data is present in an existing file.
+ */
void MEDFileFieldMultiTS::write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception)
{
med_access_mode medmod=MEDFileUtilities::TraduceWriteMode(mode);
}
/*!
- * Performs the job than MEDFileField1TS::getFieldAtLevel except that (iteration,order) couple should be specified !
- * If such couple does not exist an exception is thrown.
+ * Returns a new MEDCouplingFieldDouble of a given type, of a given time step, lying on
+ * mesh entities of a given dimension of the first mesh in MED file.
+ * For more info, see \ref AdvMEDLoaderAPIFieldRW
+ * \param [in] type - a spatial discretization of interest.
+ * \param [in] iteration - the iteration number of a required time step.
+ * \param [in] order - the iteration order number of required time step.
+ * \param [in] meshDimRelToMax - a relative dimension of the supporting mesh entities.
+ * \param [in] renumPol - specifies how to permute values of the result field according to
+ * the optional numbers of cells and nodes, if any. The valid values are
+ * - 0 - do not permute.
+ * - 1 - permute cells.
+ * - 2 - permute nodes.
+ * - 3 - permute cells and nodes.
+ *
+ * \return MEDCouplingFieldDouble * - a new instance of MEDCouplingFieldDouble. The
+ * caller is to delete this field using decrRef() as it is no more needed.
+ * \throw If the MED file is not readable.
+ * \throw If there is no mesh in the MED file.
+ * \throw If there are no mesh entities of \a meshDimRelToMax dimension in the mesh.
+ * \throw If no field values of the required parameters are available.
*/
MEDCouplingFieldDouble *MEDFileFieldMultiTS::getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol) const throw(INTERP_KERNEL::Exception)
{
return myF1TS.getFieldAtLevel(type,meshDimRelToMax,0,renumPol,this);
}
+/*!
+ * Returns a new MEDCouplingFieldDouble of a given type, of a given time step, lying on
+ * the top level cells of the first mesh in MED file.
+ * For more info, see \ref AdvMEDLoaderAPIFieldRW
+ * \param [in] type - a spatial discretization of interest.
+ * \param [in] iteration - the iteration number of a required time step.
+ * \param [in] order - the iteration order number of required time step.
+ * \param [in] renumPol - specifies how to permute values of the result field according to
+ * the optional numbers of cells and nodes, if any. The valid values are
+ * - 0 - do not permute.
+ * - 1 - permute cells.
+ * - 2 - permute nodes.
+ * - 3 - permute cells and nodes.
+ *
+ * \return MEDCouplingFieldDouble * - a new instance of MEDCouplingFieldDouble. The
+ * caller is to delete this field using decrRef() as it is no more needed.
+ * \throw If the MED file is not readable.
+ * \throw If there is no mesh in the MED file.
+ * \throw If no field values of the required parameters are available.
+ */
MEDCouplingFieldDouble *MEDFileFieldMultiTS::getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol) const throw(INTERP_KERNEL::Exception)
{
const MEDFileField1TSWithoutSDA& myF1TS=_content->getTimeStepEntry(iteration,order);
}
/*!
- * Performs the job than MEDFileField1TS::getFieldOnMeshAtLevel except that (iteration,order) couple should be specified !
- * If such couple does not exist an exception is thrown.
+ * Returns a new MEDCouplingFieldDouble of a given type, of a given time step, lying on
+ * a given support.
+ * For more info, see \ref AdvMEDLoaderAPIFieldRW
+ * \param [in] type - a spatial discretization of interest.
+ * \param [in] iteration - the iteration number of a required time step.
+ * \param [in] order - the iteration order number of required time step.
+ * \param [in] meshDimRelToMax - a relative dimension of the supporting mesh entities.
+ * \param [in] mesh - the supporting mesh.
+ * \param [in] renumPol - specifies how to permute values of the result field according to
+ * the optional numbers of cells and nodes, if any. The valid values are
+ * - 0 - do not permute.
+ * - 1 - permute cells.
+ * - 2 - permute nodes.
+ * - 3 - permute cells and nodes.
+ *
+ * \return MEDCouplingFieldDouble * - a new instance of MEDCouplingFieldDouble. The
+ * caller is to delete this field using decrRef() as it is no more needed.
+ * \throw If there are no mesh entities of \a meshDimRelToMax dimension in the mesh.
+ * \throw If no field of \a this is lying on \a mesh.
+ * \throw If no field values of the required parameters are available.
*/
MEDCouplingFieldDouble *MEDFileFieldMultiTS::getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol) const throw(INTERP_KERNEL::Exception)
{
}
/*!
- * Performs the job than MEDFileField1TS::getFieldOnMeshAtLevel except that (iteration,order) couple should be specified !
- * If such couple does not exist an exception is thrown.
+ * Returns a new MEDCouplingFieldDouble of given type, of a given time step, lying on a
+ * given support.
+ * For more info, see \ref AdvMEDLoaderAPIFieldRW
+ * \param [in] type - a spatial discretization of the new field.
+ * \param [in] iteration - the iteration number of a required time step.
+ * \param [in] order - the iteration order number of required time step.
+ * \param [in] mesh - the supporting mesh.
+ * \param [in] renumPol - specifies how to permute values of the result field according to
+ * the optional numbers of cells and nodes, if any. The valid values are
+ * - 0 - do not permute.
+ * - 1 - permute cells.
+ * - 2 - permute nodes.
+ * - 3 - permute cells and nodes.
+ *
+ * \return MEDCouplingFieldDouble * - a new instance of MEDCouplingFieldDouble. The
+ * caller is to delete this field using decrRef() as it is no more needed.
+ * \throw If no field of \a this is lying on \a mesh.
+ * \throw If no field values of the required parameters are available.
*/
MEDCouplingFieldDouble *MEDFileFieldMultiTS::getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol) const throw(INTERP_KERNEL::Exception)
{
return myF1TS.getFieldAtLevel(type,meshDimRelToMax,mname,renumPol,this);
}
+/*!
+ * Returns values and a profile of the field of a given type, of a given time step,
+ * lying on a given support.
+ * For more info, see \ref AdvMEDLoaderAPIFieldRW
+ * \param [in] type - a spatial discretization of the field.
+ * \param [in] iteration - the iteration number of a required time step.
+ * \param [in] order - the iteration order number of required time step.
+ * \param [in] meshDimRelToMax - a relative dimension of the supporting mesh entities.
+ * \param [in] mesh - the supporting mesh.
+ * \param [out] pfl - a new instance of DataArrayInt holding ids of mesh entities the
+ * field of interest lies on. If the field lies on all entities of the given
+ * dimension, all ids in \a pfl are zero. The caller is to delete this array
+ * using decrRef() as it is no more needed.
+ * \param [in] glob - the global data storing profiles and localization.
+ * \return DataArrayDouble * - a new instance of DataArrayDouble holding values of the
+ * field. The caller is to delete this array using decrRef() as it is no more needed.
+ * \throw If there are no mesh entities of \a meshDimRelToMax dimension in \a mesh.
+ * \throw If no field of \a this is lying on \a mesh.
+ * \throw If no field values of the required parameters are available.
+ */
DataArrayDouble *MEDFileFieldMultiTS::getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl) const throw(INTERP_KERNEL::Exception)
{
const MEDFileField1TSWithoutSDA& myF1TS=_content->getTimeStepEntry(iteration,order);
return myF1TS.getFieldWithProfile(type,meshDimRelToMax,mesh,pfl,this);
}
+/*!
+ * Adds a MEDCouplingFieldDouble to \a this as another time step. The underlying mesh of
+ * the given field is checked if its elements are sorted suitable for writing to MED file
+ * ("STB" stands for "Sort By Type"), if not, an exception is thrown.
+ * For more info, see \ref AdvMEDLoaderAPIFieldRW
+ * \param [in] field - the field to add to \a this.
+ * \throw If the name of \a field is empty.
+ * \throw If the data array of \a field is not set.
+ * \throw If existing time steps have different name or number of components than \a field.
+ * \throw If the underlying mesh of \a field has no name.
+ * \throw If elements in the mesh are not in the order suitable for writing to the MED file.
+ */
void MEDFileFieldMultiTS::appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
{
_content->appendFieldNoProfileSBT(field,*this);
}
+/*!
+ * Adds a MEDCouplingFieldDouble to \a this as another time step. Specified entities of
+ * a given dimension of a given mesh are used as the support of the given field.
+ * Elements of the given mesh must be sorted suitable for writing to MED file.
+ * Order of underlying mesh entities of the given field specified by \a profile parameter
+ * is not prescribed; this method permutes field values to have them sorted by element
+ * type as required for writing to MED file.
+ * For more info, see \ref AdvMEDLoaderAPIFieldRW
+ * \param [in] field - the field to add to \a this.
+ * \param [in] mesh - the supporting mesh of \a field.
+ * \param [in] meshDimRelToMax - a relative dimension of mesh entities \a field lies on.
+ * \param [in] profile - ids of mesh entities on which corresponding field values lie.
+ * \throw If either \a field or \a mesh or \a profile has an empty name.
+ * \throw If existing time steps have different name or number of components than \a field.
+ * \throw If there are no mesh entities of \a meshDimRelToMax dimension in \a mesh.
+ * \throw If the data array of \a field is not set.
+ * \throw If elements in \a mesh are not in the order suitable for writing to the MED file.
+ */
void MEDFileFieldMultiTS::appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception)
{
_content->appendFieldProfile(field,mesh,meshDimRelToMax,profile,*this);
const char MEDFileMesh::DFT_FAM_NAME[]="FAMILLE_ZERO";
-MEDFileMesh::MEDFileMesh():_order(-1),_iteration(-1),_time(0.)
+MEDFileMesh::MEDFileMesh():_order(-1),_iteration(-1),_time(0.),_univ_wr_status(true)
{
}
return ret;
}
+/*!
+ * Returns a new MEDFileMesh holding the mesh data that has been read from a given MED
+ * file. The first mesh in the file is loaded.
+ * \param [in] fileName - the name of MED file to read.
+ * \return MEDFileMesh * - a new instance of MEDFileMesh. The caller is to delete this
+ * mesh using decrRef() as it is no more needed.
+ * \throw If the file is not readable.
+ * \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) throw(INTERP_KERNEL::Exception)
{
std::vector<std::string> ms=MEDLoader::GetMeshNames(fileName);
{
MEDCouplingAutoRefCountObjectPtr<MEDFileCurveLinearMesh> ret=MEDFileCurveLinearMesh::New();
ret->loadCLMeshFromFile(fid,ms.front().c_str(),dt,it);
- return (MEDFileCMesh *)ret.retn();
+ return (MEDFileCurveLinearMesh *)ret.retn();
}
default:
{
}
}
+/*!
+ * Returns a new MEDFileMesh holding the mesh data that has been read from a given MED
+ * file. The mesh to load is specified by its name and numbers of a time step and an
+ * iteration.
+ * \param [in] fileName - the name of MED file to read.
+ * \param [in] mName - the name of the mesh to read.
+ * \param [in] dt - the number of a time step.
+ * \param [in] it - the number of an iteration.
+ * \return MEDFileMesh * - a new instance of MEDFileMesh. The caller is to delete this
+ * mesh using decrRef() as it is no more needed.
+ * \throw If the file is not readable.
+ * \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) throw(INTERP_KERNEL::Exception)
{
MEDFileUtilities::CheckFileForRead(fileName);
ret->loadCMeshFromFile(fid,mName,dt,it);
return (MEDFileCMesh *)ret.retn();
}
+ case CURVE_LINEAR:
+ {
+ MEDCouplingAutoRefCountObjectPtr<MEDFileCurveLinearMesh> ret=MEDFileCurveLinearMesh::New();
+ ret->loadCLMeshFromFile(fid,mName,dt,it);
+ return (MEDFileCurveLinearMesh *)ret.retn();
+ }
default:
{
std::ostringstream oss; oss << "MEDFileMesh::New : MED file exists and has mesh '" << mName << "' exists but unsupported type yet !";
}
}
+/*!
+ * Writes \a this mesh into an open MED file specified by its descriptor.
+ * \param [in] fid - the MED file descriptor.
+ * \throw If the mesh name is not set.
+ * \throw If the file is open for reading only.
+ * \throw If the writing mode == 1 and the same data is present in an existing file.
+ */
void MEDFileMesh::write(med_idt fid) const throw(INTERP_KERNEL::Exception)
{
if(!existsFamily(0))
writeLL(fid);
}
+/*!
+ * Writes \a this mesh into a MED file specified by its name.
+ * \param [in] fileName - the MED file name.
+ * \param [in] mode - the writing mode. For more on \a mode, see \ref AdvMEDLoaderBasics.
+ * - 2 - erase; an existing file is removed.
+ * - 1 - append; same data should not be present in an existing file.
+ * - 0 - overwrite; same data present in an existing file is overwritten.
+ * \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 throw(INTERP_KERNEL::Exception)
{
med_access_mode medmod=MEDFileUtilities::TraduceWriteMode(mode);
write(fid);
}
+/*!
+ * Checks if \a this and another mesh are equal.
+ * \param [in] other - the mesh to compare with.
+ * \param [in] eps - a precision used to compare real values.
+ * \param [in,out] what - the string returning description of unequal data.
+ * \return bool - \c true if the meshes are equal, \c false, else.
+ */
bool MEDFileMesh::isEqual(const MEDFileMesh *other, double eps, std::string& what) const
{
if(_order!=other->_order)
what="Names differ !";
return false;
}
- if(_univ_name!=other->_univ_name)
- {
- what="Univ names differ !";
- return false;
- }
+ //univ_name has been ignored -> not a bug because it is a mutable attribute
if(_desc_name!=other->_desc_name)
{
what="Description names differ !";
return true;
}
+/*!
+ * Clears redundant attributes of incorporated data arrays.
+ */
void MEDFileMesh::clearNonDiscrAttributes() const
{
return false;
}
+/*!
+ * Copies data on groups and families from another mesh.
+ * \param [in] other - the mesh to copy the data from.
+ */
void MEDFileMesh::copyFamGrpMapsFrom(const MEDFileMesh& other)
{
_groups=other._groups;
_families=other._families;
}
+/*!
+ * Returns names of families constituting a group.
+ * \param [in] name - the name of the group of interest.
+ * \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 throw(INTERP_KERNEL::Exception)
{
std::string oname(name);
return (*it).second;
}
+/*!
+ * Returns names of families constituting some groups.
+ * \param [in] grps - a sequence of names of groups of interest.
+ * \return std::vector<std::string> - a sequence of names of the families.
+ * \throw If a name of a nonexistent group is present in \a grps.
+ */
std::vector<std::string> MEDFileMesh::getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception)
{
std::set<std::string> fams;
return fams2;
}
+/*!
+ * Returns ids of families constituting a group.
+ * \param [in] name - the name of the group of interest.
+ * \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 throw(INTERP_KERNEL::Exception)
{
std::string oname(name);
}
/*!
- * This method sets families at a corresponding groups existing or not. If it existed, it is replaced by new 'fams'.
- * Each entry in 'fams' is checked if it is not still existing default id 0 is set.
+ * Sets names of families constituting a group. If data on families of this group is
+ * already present, it is overwritten. Every family in \a fams is checked, and if a
+ family is not yet in \a this mesh, the default group id \c 0 is assigned to it.
+ * \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) throw(INTERP_KERNEL::Exception)
{
}
/*!
- * Behaves as MEDFileMesh::setFamiliesOnGroup, except that if there is presence of a family id in 'famIds' not existing an exception is thrown.
- * If several families have same id the first one in lexical order is taken into account.
+ * Sets families constituting a group. The families are specified by their ids.
+ * If a family name is not found by its id, an exception is thrown.
+ * If several families have same id, the first one in lexical order is taken.
+ * \param [in] name - the name of the group of interest.
+ * \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) throw(INTERP_KERNEL::Exception)
{
_groups[oname]=fams;
}
+/*!
+ * Returns names of groups including a given family.
+ * \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 throw(INTERP_KERNEL::Exception)
{
std::vector<std::string> ret;
}
/*!
- * This method expects that family 'famName' is already existing. If not an exception will be thrown.
+ * Adds an existing family to groups.
+ * \param [in] famName - a name of family to add to \a grps.
+ * \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) throw(INTERP_KERNEL::Exception)
{
}
}
+/*!
+ * Returns names of all groups of \a this mesh.
+ * \return std::vector<std::string> - a sequence of group names.
+ */
std::vector<std::string> MEDFileMesh::getGroupsNames() const
{
std::vector<std::string> ret(_groups.size());
return ret;
}
+/*!
+ * Returns names of all families of \a this mesh.
+ * \return std::vector<std::string> - a sequence of family names.
+ */
std::vector<std::string> MEDFileMesh::getFamiliesNames() const
{
std::vector<std::string> ret(_families.size());
}
/*!
- * This method scans every families and for each families shared by only one group, the corresponding family takes the same name than the group.
+ * Changes a name of every family, included in one group only, to be same as the group name.
+ * \throw If there are families with equal names in \a this mesh.
*/
void MEDFileMesh::assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception)
{
_groups=groups;
}
+/*!
+ * Removes a group from \a this mesh.
+ * \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) throw(INTERP_KERNEL::Exception)
{
std::string oname(name);
_groups.erase(it);
}
+/*!
+ * Removes a family from \a this mesh.
+ * \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) throw(INTERP_KERNEL::Exception)
{
std::string oname(name);
}
}
+/*!
+ * Renames a group in \a this mesh.
+ * \param [in] oldName - a current name of the group to rename.
+ * \param [in] newName - a new group name.
+ * \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) throw(INTERP_KERNEL::Exception)
{
std::string oname(oldName);
}
/*!
- * This method changes the family ids in 'this'. It leads to a modification into '_families' attributes \b and in
- * ids stored in arrays. This method calls MEDFileMesh::changeFamilyIdArr method.
+ * Changes an id of a family in \a this mesh.
+ * This method calls changeFamilyIdArr().
+ * \param [in] oldId - a current id of the family.
+ * \param [in] newId - a new family id.
*/
void MEDFileMesh::changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception)
{
_families=fam2;
}
+/*!
+ * Renames a family in \a this mesh.
+ * \param [in] oldName - a current name of the family to rename.
+ * \param [in] newName - a new family name.
+ * \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) throw(INTERP_KERNEL::Exception)
{
std::string oname(oldName);
}
}
+/*!
+ * Checks if \a this and another mesh contains the same families.
+ * \param [in] other - the mesh to compare with \a this one.
+ * \param [in,out] what - an unused parameter.
+ * \return bool - \c true if number of families and their ids are the same in the two
+ * meshes. Families with the id == \c 0 are not considered.
+ */
bool MEDFileMesh::areFamsEqual(const MEDFileMesh *other, std::string& what) const
{
if(_families==other->_families)
return fam0==fam1;
}
+/*!
+ * Checks if \a this and another mesh contains the same groups.
+ * \param [in] other - the mesh to compare with \a this one.
+ * \param [in,out] what - a string describing a difference of groups of the two meshes
+ * in case if this method returns \c false.
+ * \return bool - \c true if number of groups and families constituting them are the
+ * same in the two meshes.
+ */
bool MEDFileMesh::areGrpsEqual(const MEDFileMesh *other, std::string& what) const
{
if(_groups==other->_groups)
return ret;
}
+/*!
+ * Checks if a group with a given name exists in \a this mesh.
+ * \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
{
std::string grpName(groupName);
return _groups.find(grpName)!=_groups.end();
}
+/*!
+ * Checks if a family with a given id exists in \a this mesh.
+ * \param [in] famId - the family id.
+ * \return bool - \c true the family with the id \a famId exists in \a this mesh.
+ */
bool MEDFileMesh::existsFamily(int famId) const
{
for(std::map<std::string,int>::const_iterator it2=_families.begin();it2!=_families.end();it2++)
return false;
}
+/*!
+ * Checks if a family with a given name exists in \a this mesh.
+ * \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
{
std::string fname(familyName);
return _families.find(fname)!=_families.end();
}
+/*!
+ * Sets an id of a family.
+ * \param [in] familyName - the family name.
+ * \param [in] id - a new id of the family.
+ */
void MEDFileMesh::setFamilyId(const char *familyName, int id)
{
std::string fname(familyName);
}
/*!
- * This method appends a new entry in _families attribute. An exception is thrown if either the famId is already
- * kept by an another familyName. An exception is thrown if name 'familyName' is alreadyset with a different 'famId'.
+ * Adds a family to \a this mesh.
+ * \param [in] familyName - a name of the family.
+ * \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) throw(INTERP_KERNEL::Exception)
{
}
/*!
- * This method creates a new group called 'groupName' in 'this'. If it exists a group with the same name an INTERP_KERNEL::Exception will be thrown.
- * If the 'meshDimRelToMaxExt' is not existing an INTERP_KERNEL::Exception will be thrown too.
- * \b WARNING : This method does \b not garantee that 'groupName' lies only on a single level specified by 'meshDimRelToMaxExt'.
- * in the case of a presence of one or more family id in family field at 'meshDimRelToMaxExt' level that appears in another level.
- * If there is a risk of such case call MEDFileMesh::keepFamIdsOnlyOnLevs method \b before calling this method.
- * (call to MEDFileMesh::keepFamIdsOnlyOnLevs should be done with MEDFileMesh::getFamiliesIdsOnGroup('groupName' as first input ).
+ * Creates a group including all mesh entities of given dimension.
+ * \warning This method does \b not guarantee that the created group includes mesh
+ * entities of only \a meshDimRelToMaxExt dimension in the case if some family id is
+ * present in family fields of different dimensions. To assure this, call
+ * ensureDifferentFamIdsPerLevel() \b before calling this method.
+ * \param [in] meshDimRelToMaxExt - a relative dimension of mesh entities to include to
+ * the group.
+ * \param [in] groupName - a name of the new group.
+ * \throw If a group named \a groupName already exists.
+ * \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) throw(INTERP_KERNEL::Exception)
{
}
/*!
- * This method checks that family Ids in 'famIds' are not present in levels \b not in 'vMeshDimRelToMaxExt'.
- * If it is the case true is returned and 'this' is not modified.
- * If there is some levels not in 'vMeshDimRelToMaxExt' where one or more family ids in 'famIds' appear
- * new families are created and groups are updated in consequence.
+ * Ensures that given family ids do not present in family fields of dimensions different
+ * than given ones. If a family id is present in the family fields of dimensions different
+ * than the given ones, a new family is created and the whole data is updated accordingly.
+ * \param [in] famIds - a sequence of family ids to check.
+ * \param [in] vMeshDimRelToMaxExt - a sequence of relative dimensions to which the \a
+ * famIds should exclusively belong.
+ * \return bool - \c true if no modification is done in \a this mesh by this method.
*/
bool MEDFileMesh::keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& vMeshDimRelToMaxExt) throw(INTERP_KERNEL::Exception)
{
}
/*!
- * This method add into the family list of a group 'grpName' the family with name 'famName'.
- * If the group 'grpName' does not exist it is created and 'famName' is added to the list.
- * If the group 'grpName' already exists, 'famName' will be added into family list of the existing group.
- * This method throws an INTERP_KERNEL::Exception if 'famName' does not exit.
+ * Adds a family to a given group in \a this mesh. If the group with a given name does
+ * not exist, it is created.
+ * \param [in] grpName - the name of the group to add the family in.
+ * \param [in] famName - the name of the family to add to the group named \a grpName.
+ * \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) throw(INTERP_KERNEL::Exception)
{
}
/*!
- * If it exists a family whose family id is equal to 'id' this method behaves as MEDFileMesh::getFamilyNameGivenId.
- * In this case, 'this' internal states remains unchanged and 'created' out parameter will be set to false.
- * If there is no family whose family id is equal to 'id' a family is created with a name different from those
- * already existing. In this case 'created' will be returned with a value set to true, and internal state
- * will be modified.
- * This method will throws an exception if it is not possible to create a unique family name.
+ * Returns a name of the family having a given id or, if no such a family exists, creates
+ * a new uniquely named family and returns its name.
+ * \param [in] id - the id of the family whose name is required.
+ * \param [out] created - returns \c true if the new family has been created, \c false, else.
+ * \return std::string - the name of the existing or the created family.
+ * \throw If it is not possible to create a unique family name.
*/
std::string MEDFileMesh::findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
{
return ret;
}
+/*!
+ * Sets names and ids of all families in \a this mesh.
+ * \param [in] info - a map of a family name to a family id.
+ */
void MEDFileMesh::setFamilyInfo(const std::map<std::string,int>& info)
{
_families=info;
}
+/*!
+ * Sets names of all groups and families constituting them in \a this mesh.
+ * \param [in] info - a map of a group name to a vector of names of families
+ * constituting the group.
+ */
void MEDFileMesh::setGroupInfo(const std::map<std::string, std::vector<std::string> >&info)
{
_groups=info;
}
+/*!
+ * Returns an id of the family having a given name.
+ * \param [in] name - the name of the family of interest.
+ * \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 throw(INTERP_KERNEL::Exception)
{
std::string oname(name);
return (*it).second;
}
+/*!
+ * Returns ids of the families having given names.
+ * \param [in] fams - a sequence of the names of families of interest.
+ * \return std::vector<int> - a sequence of the ids of families of interest.
+ * \throw If \a fams contains a name of an inexistent family.
+ */
std::vector<int> MEDFileMesh::getFamiliesIds(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception)
{
std::vector<int> ret(fams.size());
return ret;
}
+/*!
+ * Returns a maximal id of families in \a this mesh.
+ * \return int - the maximal family id.
+ * \throw If there are no families in \a this mesh.
+ */
int MEDFileMesh::getMaxFamilyId() const throw(INTERP_KERNEL::Exception)
{
if(_families.empty())
return ret;
}
+/*!
+ * Returns a minimal id of families in \a this mesh.
+ * \return int - the minimal family id.
+ * \throw If there are no families in \a this mesh.
+ */
int MEDFileMesh::getMinFamilyId() const throw(INTERP_KERNEL::Exception)
{
if(_families.empty())
return ret;
}
+/*!
+ * Returns a maximal id of families in \a this mesh. Not only named families are
+ * considered but all family fields as well.
+ * \return int - the maximal family id.
+ */
int MEDFileMesh::getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception)
{
int m1=-std::numeric_limits<int>::max();
}
/*!
- * Returns the first (in lexical order) family name having family id equal to 'id'.
+ * Returns a name of the family by its id. If there are several families having the given
+ * id, the name first in lexical order is returned.
+ * \param [in] id - the id of the family whose name is required.
+ * \return std::string - the name of the found family.
+ * \throw If no family with the given \a id exists.
*/
std::string MEDFileMesh::getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception)
{
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
+/*!
+ * Returns a string describing \a this mesh. This description includes the mesh name and
+ * the mesh description string.
+ * \return std::string - the mesh information string.
+ */
std::string MEDFileMesh::simpleRepr() const
{
std::ostringstream oss;
return oss.str();
}
+/*!
+ * Returns ids of mesh entities contained in a given group of a given dimension.
+ * \param [in] meshDimRelToMaxExt - a relative dimension of the mesh entities whose ids
+ * are required.
+ * \param [in] grp - the name of the group of interest.
+ * \param [in] renum - if \c true, the optional numbers of entities, if available, are
+ * returned instead of ids.
+ * \return DataArrayInt * - a new instance of DataArrayInt holding either ids or
+ * numbers, if available and required, of mesh entities of the group. The caller
+ * is to delete this array using decrRef() as it is no more needed.
+ * \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 throw(INTERP_KERNEL::Exception)
{
std::vector<std::string> tmp(1);
return ret;
}
+/*!
+ * Returns ids of mesh entities contained in given groups of a given dimension.
+ * \param [in] meshDimRelToMaxExt - a relative dimension of the mesh entities whose ids
+ * are required.
+ * \param [in] grps - the names of the groups of interest.
+ * \param [in] renum - if \c true, the optional numbers of entities, if available, are
+ * returned instead of ids.
+ * \return DataArrayInt * - a new instance of DataArrayInt holding either ids or
+ * numbers, if available and required, of mesh entities of the groups. The caller
+ * is to delete this array using decrRef() as it is no more needed.
+ * \throw If the name of a nonexistent group is present in \a grps.
+ * \throw If the family field is missing for \a meshDimRelToMaxExt.
+ */
DataArrayInt *MEDFileMesh::getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum) const throw(INTERP_KERNEL::Exception)
{
std::vector<std::string> fams2=getFamiliesOnGroups(grps);
return getFamiliesArr(meshDimRelToMaxExt,fams2,renum);
}
+/*!
+ * Returns ids of mesh entities contained in a given family of a given dimension.
+ * \param [in] meshDimRelToMaxExt - a relative dimension of the mesh entities whose ids
+ * are required.
+ * \param [in] fam - the name of the family of interest.
+ * \param [in] renum - if \c true, the optional numbers of entities, if available, are
+ * returned instead of ids.
+ * \return DataArrayInt * - a new instance of DataArrayInt holding either ids or
+ * numbers, if available and required, of mesh entities of the family. The caller
+ * 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 throw(INTERP_KERNEL::Exception)
{
std::vector<std::string> tmp(1);
return ret;
}
+/*!
+ * Returns ids of nodes contained in a given group.
+ * \param [in] grp - the name of the group of interest.
+ * \param [in] renum - if \c true, the optional numbers of nodes, if available, are
+ * returned instead of ids.
+ * \return DataArrayInt * - a new instance of DataArrayInt holding either ids or
+ * numbers, if available and required, of nodes of the group. The caller
+ * is to delete this array using decrRef() as it is no more needed.
+ * \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 throw(INTERP_KERNEL::Exception)
{
std::vector<std::string> tmp(1);
return ret;
}
+/*!
+ * Returns ids of nodes contained in given groups.
+ * \param [in] grps - the names of the groups of interest.
+ * \param [in] renum - if \c true, the optional numbers of nodes, if available, are
+ * returned instead of ids.
+ * \return DataArrayInt * - a new instance of DataArrayInt holding either ids or
+ * numbers, if available and required, of nodes of the groups. The caller
+ * is to delete this array using decrRef() as it is no more needed.
+ * \throw If the name of a nonexistent group is present in \a grps.
+ * \throw If the family field is missing for nodes.
+ */
DataArrayInt *MEDFileMesh::getNodeGroupsArr(const std::vector<std::string>& grps, bool renum) const throw(INTERP_KERNEL::Exception)
{
return getGroupsArr(1,grps,renum);
}
+/*!
+ * Returns ids of nodes contained in a given group.
+ * \param [in] grp - the name of the group of interest.
+ * \param [in] renum - if \c true, the optional numbers of nodes, if available, are
+ * returned instead of ids.
+ * \return DataArrayInt * - a new instance of DataArrayInt holding either ids or
+ * numbers, if available and required, of nodes of the group. The caller
+ * is to delete this array using decrRef() as it is no more needed.
+ * \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 throw(INTERP_KERNEL::Exception)
{
std::vector<std::string> tmp(1);
return ret;
}
+/*!
+ * Returns ids of nodes contained in given families.
+ * \param [in] fams - the names of the families of interest.
+ * \param [in] renum - if \c true, the optional numbers of nodes, if available, are
+ * returned instead of ids.
+ * \return DataArrayInt * - a new instance of DataArrayInt holding either ids or
+ * numbers, if available and required, of nodes of the families. The caller
+ * is to delete this array using decrRef() as it is no more needed.
+ * \throw If the family field is missing for nodes.
+ */
DataArrayInt *MEDFileMesh::getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum) const throw(INTERP_KERNEL::Exception)
{
return getFamiliesArr(1,fams,renum);
}
+/*!
+ * Adds groups of given dimension and creates corresponding families and family fields
+ * given ids of mesh entities of each group.
+ * \param [in] meshDimRelToMaxExt - the relative mesh dimension of given mesh entities.
+ * \param [in] grps - a sequence of arrays of ids each describing a group.
+ * \param [in] renum - \c true means that \a grps contains not ids but optional numbers
+ * of mesh entities.
+ * \throw If names of some groups in \a grps are equal.
+ * \throw If \a grps includes a group with an empty name.
+ * \throw If \a grps includes invalid ids (or numbers if \a renum == \c true ).
+ * \throw If there are no mesh entities of \a meshDimRelToMaxExt dimension in \a this mesh.
+ */
void MEDFileMesh::setGroupsAtLevel(int meshDimRelToMaxExt, const std::vector<const DataArrayInt *>& grps, bool renum) throw(INTERP_KERNEL::Exception)
{
if(grps.empty())
*/
void MEDFileMesh::dealWithTinyInfo(const MEDCouplingMesh *m) throw(INTERP_KERNEL::Exception)
{
+ if(!m)
+ throw INTERP_KERNEL::Exception("MEDFileMesh::dealWithTinyInfo : input mesh in NULL !");
if(_name.empty())
_name=m->getName();
else
}
}
+/*!
+ * Returns a new MEDFileUMesh holding the mesh data that has been read from a given MED
+ * file. The mesh to load is specified by its name and numbers of a time step and an
+ * iteration.
+ * \param [in] fileName - the name of MED file to read.
+ * \param [in] mName - the name of the mesh to read.
+ * \param [in] dt - the number of a time step.
+ * \param [in] it - the number of an iteration.
+ * \return MEDFileUMesh * - a new instance of MEDFileUMesh. The caller is to delete this
+ * mesh using decrRef() as it is no more needed.
+ * \throw If the file is not readable.
+ * \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) throw(INTERP_KERNEL::Exception)
{
MEDFileUtilities::CheckFileForRead(fileName);
return new MEDFileUMesh(fid,mName,dt,it);
}
+/*!
+ * Returns a new MEDFileUMesh holding the mesh data that has been read from a given MED
+ * file. The first mesh in the file is loaded.
+ * \param [in] fileName - the name of MED file to read.
+ * \return MEDFileUMesh * - a new instance of MEDFileUMesh. The caller is to delete this
+ * mesh using decrRef() as it is no more needed.
+ * \throw If the file is not readable.
+ * \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) throw(INTERP_KERNEL::Exception)
{
std::vector<std::string> ms=MEDLoader::GetMeshNames(fileName);
return new MEDFileUMesh(fid,ms.front().c_str(),dt,it);
}
+/*!
+ * Returns an empty instance of MEDFileUMesh.
+ * \return MEDFileUMesh * - a new instance of MEDFileUMesh. The caller is to delete this
+ * mesh using decrRef() as it is no more needed.
+ */
MEDFileUMesh *MEDFileUMesh::New()
{
return new MEDFileUMesh;
return ret.retn();
}
+/*!
+ * Checks if \a this and another mesh are equal.
+ * \param [in] other - the mesh to compare with.
+ * \param [in] eps - a precision used to compare real values.
+ * \param [in,out] what - the string returning description of unequal data.
+ * \return bool - \c true if the meshes are equal, \c false, else.
+ */
bool MEDFileUMesh::isEqual(const MEDFileMesh *other, double eps, std::string& what) const
{
if(!MEDFileMesh::isEqual(other,eps,what))
return true;
}
+/*!
+ * Clears redundant attributes of incorporated data arrays.
+ */
void MEDFileUMesh::clearNonDiscrAttributes() const
{
MEDFileMesh::clearNonDiscrAttributes();
//
setName(loaderl2.getName());
setDescription(loaderl2.getDescription());
+ setUnivName(loaderl2.getUnivName());
setIteration(loaderl2.getIteration());
setOrder(loaderl2.getOrder());
setTimeValue(loaderl2.getTime());
MEDLoaderBase::safeStrCpy2(u.c_str(),MED_SNAME_SIZE-1,unit+i*MED_SNAME_SIZE,_too_long_str);//MED_TAILLE_PNOM-1 to avoid to write '\0' on next compo
}
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);
for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1> >::const_iterator it=_ms.begin();it!=_ms.end();it++)
if((const MEDFileUMeshSplitL1 *)(*it)!=0)
MEDFileUMeshL2::WriteFamiliesAndGrps(fid,maa,_families,_groups,_too_long_str);
}
+/*!
+ * Returns relative dimensions of mesh entities (excluding nodes) present in \a this mesh.
+ * \return std::vector<int> - a sequence of the relative dimensions.
+ */
std::vector<int> MEDFileUMesh::getNonEmptyLevels() const
{
std::vector<int> ret;
return ret;
}
+/*!
+ * Returns relative dimensions of mesh entities (including nodes) present in \a this mesh.
+ * \return std::vector<int> - a sequence of the relative dimensions.
+ */
std::vector<int> MEDFileUMesh::getNonEmptyLevelsExt() const
{
std::vector<int> ret0=getNonEmptyLevels();
}
/*!
- * This methods returns all relative mesh levels where group 'grp' is defined \b excluded \b nodes.
- * To include nodes call MEDFileUMesh::getGrpNonEmptyLevelsExt method.
+ * Returns all relative mesh levels (**excluding nodes**) where a given group is defined.
+ * To include nodes, call getGrpNonEmptyLevelsExt() method.
+ * \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 throw(INTERP_KERNEL::Exception)
{
}
/*!
- * This method is a generalization of MEDFileUMesh::getGrpNonEmptyLevelsExt. It looks at the node level to state if the group 'grp' has a part lying on node.
+ * Returns all relative mesh levels (including nodes) where a given group is defined.
+ * \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 throw(INTERP_KERNEL::Exception)
{
}
/*!
- * This methods returns all relative mesh levels where family 'fam' is defined \b excluded \b nodes.
- * To include nodes call MEDFileUMesh::getFamNonEmptyLevelsExt method.
+ * Returns all relative mesh levels (**excluding nodes**) where a given family is defined.
+ * To include nodes, call getFamNonEmptyLevelsExt() method.
+ * \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 throw(INTERP_KERNEL::Exception)
{
}
/*!
- * This method is a generalization of MEDFileUMesh::getFamNonEmptyLevels. It looks at the node level to state if the family 'fam' has a part lying on node.
+ * Returns all relative mesh levels (including nodes) where a given family is defined.
+ * \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 throw(INTERP_KERNEL::Exception)
{
}
/*!
- * This methods returns all relative mesh levels where groups 'grps' are defined \b excluded \b nodes.
- * To include nodes call MEDFileUMesh::getGrpsNonEmptyLevelsExt method.
+ * Returns all relative mesh levels (**excluding nodes**) where given groups are defined.
+ * To include nodes, call getGrpsNonEmptyLevelsExt() method.
+ * \param [in] grps - a sequence of names of the groups of interest.
+ * \return std::vector<int> - a sequence of the relative dimensions.
*/
std::vector<int> MEDFileUMesh::getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception)
{
}
/*!
- * This method is a generalization of MEDFileUMesh::getGrpsNonEmptyLevels. It looks at the node level to state if the families 'fams' has a part lying on node.
+ * Returns all relative mesh levels (including nodes) where given groups are defined.
+ * \param [in] grps - a sequence of names of the groups of interest.
+ * \return std::vector<int> - a sequence of the relative dimensions.
*/
std::vector<int> MEDFileUMesh::getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception)
{
}
/*!
- * This methods returns all relative mesh levels where families 'fams' are defined \b excluded \b nodes.
- * To include nodes call MEDFileUMesh::getFamsNonEmptyLevelsExt method.
+ * Returns all relative mesh levels (**excluding nodes**) where given families are defined.
+ * To include nodes, call getFamsNonEmptyLevelsExt() method.
+ * \param [in] fams - the name of the family of interest.
+ * \return std::vector<int> - a sequence of the relative dimensions.
*/
std::vector<int> MEDFileUMesh::getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception)
{
}
/*!
- * This method is a generalization of MEDFileUMesh::getFamsNonEmptyLevels. It looks at the node level to state if the families 'fams' has a part lying on node.
+ * Returns all relative mesh levels (including nodes) where given families are defined.
+ * \param [in] fams - the names of the families of interest.
+ * \return std::vector<int> - a sequence of the relative dimensions.
*/
std::vector<int> MEDFileUMesh::getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception)
{
}
/*!
- * This method retrives all groups that partly or fully appear on the level 'meshDimRelToMaxExt'.
+ * Returns names of groups that partly or fully appear on the level \a meshDimRelToMaxExt.
+ * \param [in] meshDimRelToMaxExt - a relative dimension of interest.
+ * \return std::vector<std::string> - a sequence of group names at \a meshDimRelToMaxExt
+ * level.
*/
std::vector<std::string> MEDFileUMesh::getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
{
const DataArrayInt *da=(*it)->getFamilyField();
if(da)
{
- int val=_fam_coords->getMaxValue(tmp);
+ int val=da->getMaxValue(tmp);
ret=std::max(ret,val);
}
}
const DataArrayInt *da=(*it)->getFamilyField();
if(da)
{
- int val=_fam_coords->getMinValue(tmp);
+ int val=da->getMinValue(tmp);
ret=std::min(ret,val);
}
}
return ret;
}
+/*!
+ * Returns the dimension on cells in \a this mesh.
+ * \return int - the mesh dimension.
+ * \throw If there are no cells in this mesh.
+ */
int MEDFileUMesh::getMeshDimension() const throw(INTERP_KERNEL::Exception)
{
int lev=0;
throw INTERP_KERNEL::Exception("MEDFileUMesh::getMeshDimension : impossible to find a mesh dimension !");
}
+/*!
+ * Returns the space dimension of \a this mesh that is equal to number of components in
+ * the node coordinates array.
+ * \return int - the space dimension of \a this mesh.
+ * \throw If the node coordinates array is not available.
+ */
int MEDFileUMesh::getSpaceDimension() const throw(INTERP_KERNEL::Exception)
{
const DataArrayDouble *coo=_coords;
return coo->getNumberOfComponents();
}
+/*!
+ * Returns a string describing \a this mesh.
+ * \return std::string - the mesh information string.
+ */
std::string MEDFileUMesh::simpleRepr() const
{
std::ostringstream oss;
return oss.str();
}
+/*!
+ * Returns a full textual description of \a this mesh.
+ * \return std::string - the string holding the mesh description.
+ */
std::string MEDFileUMesh::advancedRepr() const
{
return simpleRepr();
}
+/*!
+ * Returns number of mesh entities of a given relative dimension in \a this mesh.
+ * \param [in] meshDimRelToMaxExt - the relative dimension of interest.
+ * \return int - the number of entities.
+ * \throw If no mesh entities of dimension \a meshDimRelToMaxExt are available in \a this mesh.
+ */
int MEDFileUMesh::getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
{
if(meshDimRelToMaxExt==1)
return getMeshAtLevSafe(meshDimRelToMaxExt)->getSize();
}
+/*!
+ * Returns the family field for mesh entities of a given dimension.
+ * \param [in] meshDimRelToMaxExt - the relative dimension of mesh entities.
+ * \return const DataArrayInt * - the family field. It is an array of ids of families
+ * each mesh entity belongs to. It can be \c NULL.
+ */
const DataArrayInt *MEDFileUMesh::getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
{
if(meshDimRelToMaxExt==1)
return l1->getFamilyField();
}
+/*!
+ * Returns the optional numbers of mesh entities of a given dimension.
+ * \param [in] meshDimRelToMaxExt - the relative dimension of mesh entities.
+ * \return const DataArrayInt * - the array of the entity numbers.
+ * \throw If there are no mesh entities of \a meshDimRelToMaxExt dimension in \a this mesh.
+ */
const DataArrayInt *MEDFileUMesh::getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
{
if(meshDimRelToMaxExt==1)
return coo->getNumberOfTuples();
}
+/*!
+ * Returns the optional numbers of mesh entities of a given dimension transformed using
+ * DataArrayInt::invertArrayN2O2O2N().
+ * \param [in] meshDimRelToMaxExt - the relative dimension of mesh entities.
+ * \return const DataArrayInt * - the array of the entity numbers transformed using
+ * DataArrayInt::invertArrayN2O2O2N().
+ * \throw If there are no mesh entities of \a meshDimRelToMaxExt dimension in \a this mesh.
+ */
const DataArrayInt *MEDFileUMesh::getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
{
if(meshDimRelToMaxExt==1)
}
/*!
- * This method returns coordinates in 'this'. The returned array reference counter is \b not incremented by this method (as MEDCouplingPointSet::getCoords does).
+ * Returns a pointer to the node coordinates array of \a this mesh \b without
+ * incrementing its reference counter, thus there is no need to decrRef() it by the caller.
*/
DataArrayDouble *MEDFileUMesh::getCoords() const
{
return 0;
}
+/*!
+ * Returns a new MEDCouplingUMesh corresponding to mesh entities included in a given
+ * group of \a this mesh. Only mesh entities of a given dimension are included in the
+ * new mesh.
+ * \param [in] meshDimRelToMaxExt - the relative dimension of mesh entities of interest.
+ * \param [in] grp - the name of the group whose mesh entities are included in the
+ * new mesh.
+ * \param [in] renum - if \c true, cells and nodes of the result mesh are permuted
+ * according to the optional numbers of entities, if available.
+ * \return MEDCouplingUMesh * - a new instance of MEDCouplingUMesh. The caller is to
+ * delete this mesh using decrRef() as it is no more needed.
+ * \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 throw(INTERP_KERNEL::Exception)
{
synchronizeTinyInfoOnLeaves();
return ret;
}
+/*!
+ * Returns a new MEDCouplingUMesh corresponding to mesh entities included in given
+ * groups of \a this mesh. Only mesh entities of a given dimension are included in the
+ * new mesh.
+ * \param [in] meshDimRelToMaxExt - the relative dimension of mesh entities of interest.
+ * \param [in] grps - a sequence of group names whose mesh entities are included in the
+ * new mesh.
+ * \param [in] renum - if \c true, cells and nodes of the result mesh are permuted
+ * according to the optional numbers of entities, if available.
+ * \return MEDCouplingUMesh * - a new instance of MEDCouplingUMesh. The caller is to
+ * delete this mesh using decrRef() as it is no more needed.
+ * \throw If a name of a nonexistent group is present in \a grps.
+ * \throw If there are no mesh entities of \a meshDimRelToMaxExt dimension in \a this mesh.
+ */
MEDCouplingUMesh *MEDFileUMesh::getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum) const throw(INTERP_KERNEL::Exception)
{
synchronizeTinyInfoOnLeaves();
return getFamilies(meshDimRelToMaxExt,fams2,renum);
}
+/*!
+ * Returns a new MEDCouplingUMesh corresponding to mesh entities included in a given
+ * family of \a this mesh. Only mesh entities of a given dimension are included in the
+ * new mesh.
+ * \param [in] meshDimRelToMaxExt - the relative dimension of mesh entities of interest.
+ * \param [in] fam - the name of the family whose mesh entities are included in the
+ * new mesh.
+ * \param [in] renum - if \c true, cells and nodes of the result mesh are permuted
+ * according to the optional numbers of entities, if available.
+ * \return MEDCouplingUMesh * - a new instance of MEDCouplingUMesh. The caller is to
+ * delete this mesh using decrRef() as it is no more needed.
+ * \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 throw(INTERP_KERNEL::Exception)
{
synchronizeTinyInfoOnLeaves();
return ret;
}
+/*!
+ * Returns a new MEDCouplingUMesh corresponding to mesh entities included in given
+ * families of \a this mesh. Only mesh entities of a given dimension are included in the
+ * new mesh.
+ * \param [in] meshDimRelToMaxExt - the relative dimension of mesh entities of interest.
+ * \param [in] fams - a sequence of family names whose mesh entities are included in the
+ * new mesh.
+ * \param [in] renum - if \c true, cells and nodes of the result mesh are permuted
+ * according to the optional numbers of entities, if available.
+ * \return MEDCouplingUMesh * - a new instance of MEDCouplingUMesh. The caller is to
+ * delete this mesh using decrRef() as it is no more needed.
+ * \throw If a name of a nonexistent family is present in \a fams.
+ * \throw If there are no mesh entities of \a meshDimRelToMaxExt dimension in \a this mesh.
+ */
MEDCouplingUMesh *MEDFileUMesh::getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum) const throw(INTERP_KERNEL::Exception)
{
synchronizeTinyInfoOnLeaves();
return l1->getFamilyPart(0,0,renum);
}
+/*!
+ * Returns ids of mesh entities contained in given families of a given dimension.
+ * \param [in] meshDimRelToMaxExt - a relative dimension of the mesh entities whose ids
+ * are required.
+ * \param [in] fams - the names of the families of interest.
+ * \param [in] renum - if \c true, the optional numbers of entities, if available, are
+ * returned instead of ids.
+ * \return DataArrayInt * - a new instance of DataArrayInt holding either ids or
+ * numbers, if available and required, of mesh entities of the families. The caller
+ * is to delete this array using decrRef() as it is no more needed.
+ * \throw If the family field is missing for \a meshDimRelToMaxExt.
+ */
DataArrayInt *MEDFileUMesh::getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum) const throw(INTERP_KERNEL::Exception)
{
std::vector<int> famIds=getFamiliesIds(fams);
}
/*!
- * Returns a pointer to mesh at the specified level. ** WARNING **, if the input \a meshDimRelToMaxExt is set to one (nodes),
- * The returned mesh ** will be not valid **. It is a feature, because MEDLoader do not creates cells that do not exist !
- * To build a valid MEDCouplingUMesh instance from the returned value when \a meshDimRelToMaxExt is equal to one, simply
- * call MEDCouplingUMesh::Build0DMeshFromCoords.
- *
- * \return a pointer to unstructured mesh that need to be managed by the caller.
- * \warning the returned pointer has to be managed by the caller.
- * \sa MEDFileUMesh::getGenMeshAtLevel
+ * Returns a MEDCouplingUMesh of a given relative dimension.
+ * \warning If \a meshDimRelToMaxExt == 1 (which means nodes), the returned mesh **is not
+ * valid**. This is a feature, because MEDLoader does not create cells that do not exist!
+ * To build a valid MEDCouplingUMesh from the returned one in this case,
+ * call MEDCouplingUMesh::Build0DMeshFromCoords().
+ * \param [in] meshDimRelToMax - the relative dimension of interest.
+ * \param [in] renum - if \c true, the returned mesh is permuted according to the
+ * optional numbers of mesh entities.
+ * \return MEDCouplingUMesh * - a pointer to MEDCouplingUMesh that the caller is to
+ * delete using decrRef() as it is no more needed.
+ * \throw If there are no mesh entities of \a meshDimRelToMaxExt dimension in \a this mesh.
+ * \sa getGenMeshAtLevel()
*/
MEDCouplingUMesh *MEDFileUMesh::getMeshAtLevel(int meshDimRelToMaxExt, bool renum) const throw(INTERP_KERNEL::Exception)
{
}
/*!
- * Returns a pointer to mesh at the specified level.
- *
- * \return a pointer to unstructured mesh that need to be managed by the caller.
- * \warning the returned pointer has to be managed by the caller.
- * \sa MEDFileUMesh::getMeshAtLevel
+ * Returns a MEDCouplingUMesh of a given relative dimension.
+ * \warning If \a meshDimRelToMaxExt == 1 (which means nodes), the returned mesh **is not
+ * valid**. This is a feature, because MEDLoader does not create cells that do not exist!
+ * To build a valid MEDCouplingUMesh from the returned one in this case,
+ * call MEDCouplingUMesh::Build0DMeshFromCoords().
+ * \param [in] meshDimRelToMax - the relative dimension of interest.
+ * \param [in] renum - if \c true, the returned mesh is permuted according to the
+ * optional numbers of mesh entities.
+ * \return MEDCouplingMesh * - a pointer to MEDCouplingUMesh that the caller is to
+ * delete using decrRef() as it is no more needed.
+ * \throw If there are no mesh entities of \a meshDimRelToMax dimension in \a this mesh.
+ * \sa getMeshAtLevel()
*/
MEDCouplingMesh *MEDFileUMesh::getGenMeshAtLevel(int meshDimRelToMax, bool renum) const throw(INTERP_KERNEL::Exception)
{
return getMeshAtLevel(meshDimRelToMax,renum);
}
+/*!
+ * Returns a MEDCouplingUMesh of a relative dimension == 0.
+ * \param [in] renum - if \c true, the returned mesh is permuted according to the
+ * optional numbers of mesh entities.
+ * \return MEDCouplingUMesh * - a pointer to MEDCouplingUMesh that the caller is to
+ * delete using decrRef() as it is no more needed.
+ * \throw If there are no mesh entities of the relative dimension == 0 in \a this mesh.
+ */
MEDCouplingUMesh *MEDFileUMesh::getLevel0Mesh(bool renum) const throw(INTERP_KERNEL::Exception)
{
return getMeshAtLevel(0,renum);
}
+/*!
+ * Returns a MEDCouplingUMesh of a relative dimension == -1.
+ * \param [in] renum - if \c true, the returned mesh is permuted according to the
+ * optional numbers of mesh entities.
+ * \return MEDCouplingUMesh * - a pointer to MEDCouplingUMesh that the caller is to
+ * delete using decrRef() as it is no more needed.
+ * \throw If there are no mesh entities of the relative dimension == -1 in \a this mesh.
+ */
MEDCouplingUMesh *MEDFileUMesh::getLevelM1Mesh(bool renum) const throw(INTERP_KERNEL::Exception)
{
return getMeshAtLevel(-1,renum);
}
+/*!
+ * Returns a MEDCouplingUMesh of a relative dimension == -2.
+ * \param [in] renum - if \c true, the returned mesh is permuted according to the
+ * optional numbers of mesh entities.
+ * \return MEDCouplingUMesh * - a pointer to MEDCouplingUMesh that the caller is to
+ * delete using decrRef() as it is no more needed.
+ * \throw If there are no mesh entities of the relative dimension == -2 in \a this mesh.
+ */
MEDCouplingUMesh *MEDFileUMesh::getLevelM2Mesh(bool renum) const throw(INTERP_KERNEL::Exception)
{
return getMeshAtLevel(-2,renum);
}
+/*!
+ * Returns a MEDCouplingUMesh of a relative dimension == -3.
+ * \param [in] renum - if \c true, the returned mesh is permuted according to the
+ * optional numbers of mesh entities.
+ * \return MEDCouplingUMesh * - a pointer to MEDCouplingUMesh that the caller is to
+ * delete using decrRef() as it is no more needed.
+ * \throw If there are no mesh entities of the relative dimension == -3 in \a this mesh.
+ */
MEDCouplingUMesh *MEDFileUMesh::getLevelM3Mesh(bool renum) const throw(INTERP_KERNEL::Exception)
{
return getMeshAtLevel(-3,renum);
}
}
+/*!
+ * Sets the node coordinates array of \a this mesh.
+ * \param [in] coords - the new node coordinates array.
+ * \throw If \a coords == \c NULL.
+ */
+
void MEDFileUMesh::setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception)
{
if(!coords)
_fam_coords->fillWithZero();
}
+/*!
+ * Removes all groups of a given dimension in \a this mesh.
+ * \param [in] meshDimRelToMaxExt - the relative dimension of interest.
+ * \throw If there are no mesh entities of \a meshDimRelToMaxExt dimension in \a this mesh.
+ */
void MEDFileUMesh::eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception)
{
if(meshDimRelToMaxExt==1)
optimizeFamilies();
}
+/*!
+ * Removes all families with ids not present in the family fields of \a this mesh.
+ */
void MEDFileUMesh::optimizeFamilies() throw(INTERP_KERNEL::Exception)
{
std::vector<int> levs=getNonEmptyLevelsExt();
* The size of returned array is the number of nodes of the old (previous to the call of this method) number of nodes.
* -1 values in returned array means that the corresponding old node is no more used.
*
- * \return newly allocated array containing correspondance in \b old \b to \b new format. If all nodes in \a this are fetched NULL pointer is returned and nothing
+ * \return newly allocated array containing correspondance in \b old \b to \b new format. If all nodes in \a this are fetched \c NULL pointer is returned and nothing
* is modified in \a this.
* \throw If no coordinates are set in \a this or if there is in any available mesh in \a this a cell having a nodal connectivity containing a node id not in the range of
* set coordinates.
}
/*!
- * This method is here only to add a group on node.
- * MEDFileUMesh::setGroupsAtLevel with 1 in the first parameter.
- *
- * \param [in] ids node ids and group name of the new group to add. The ids should be sorted and different each other (MED file norm).
+ * Adds a group of nodes to \a this mesh.
+ * \param [in] ids - a DataArrayInt providing ids and a name of the group to add.
+ * The ids should be sorted and different each other (MED file norm).
+ * \throw If the node coordinates array is not set.
+ * \throw If \a ids == \c NULL.
+ * \throw If \a ids->getName() == "".
+ * \throw If \a ids does not respect the MED file norm.
+ * \throw If a group with name \a ids->getName() already exists.
*/
void MEDFileUMesh::addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception)
{
/*!
* \param [in] ids ids and group name of the new group to add. The ids should be sorted and different each other (MED file norm).
- * \parma [in,out] famArr family array on level of interest to be renumbered. The input pointer should be not NULL (no check of that will be performed)
+ * \parma [in,out] famArr family array on level of interest to be renumbered. The input pointer should be not \c NULL (no check of that will be performed)
*/
void MEDFileUMesh::addGroupUnderground(const DataArrayInt *ids, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception)
{
_groups[grpName]=fams;
}
+/*!
+ * Changes a name of a family specified by its id.
+ * \param [in] id - the id of the family of interest.
+ * \param [in] newFamName - the new family name.
+ * \throw If no family with the given \a id exists.
+ */
void MEDFileUMesh::setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception)
{
std::string oldName=getFamilyNameGivenId(id);
_families[newFamName]=id;
}
+/*!
+ * Removes a mesh of a given dimension.
+ * \param [in] meshDimRelToMax - the relative dimension of interest.
+ * \throw If there is no mesh at level \a meshDimRelToMax in \a this mesh.
+ */
void MEDFileUMesh::removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
{
std::vector<int> levSet=getNonEmptyLevels();
_ms[pos]=0;
}
+/*!
+ * Sets a new MEDCouplingUMesh at a given level in \a this mesh.
+ * \param [in] meshDimRelToMax - a relative level to set the mesh at.
+ * \param [in] m - the new mesh to set.
+ * \param [in] newOrOld - if \c true, cells in \a m are sorted by type to be ready for
+ * writing \a this mesh in a MED file.
+ * \throw If the name or the description of \a this mesh and \a m are not empty and are
+ * different.
+ * \throw If the node coordinates array is set \a this in mesh and \a m refers to
+ * another node coordinates array.
+ * \throw If the mesh dimension of \a m does not correspond to \a meshDimRelToMax or
+ * to the existing meshes of other levels of \a this mesh.
+ */
void MEDFileUMesh::setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld) throw(INTERP_KERNEL::Exception)
-{
- setMeshAtLevelGen(meshDimRelToMax,m,newOrOld);
-}
-
-void MEDFileUMesh::setMeshAtLevelGen(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld) throw(INTERP_KERNEL::Exception)
{
dealWithTinyInfo(m);
std::vector<int> levSet=getNonEmptyLevels();
_ms[-meshDimRelToMax]=new MEDFileUMeshSplitL1(m,newOrOld);
}
+/*!
+ * Creates one MEDCouplingUMesh at a given level in \a this mesh from a sequence of
+ * meshes each representing a group, and creates corresponding groups in \a this mesh.
+ * The given meshes must share the same node coordinates array.
+ * \param [in] meshDimRelToMax - the relative dimension to create the mesh and groups at.
+ * \param [in] ms - the sequence of meshes. Each mesh in \a ms represents a group to
+ * create in \a this mesh.
+ * \throw If \a ms is empty.
+ * \throw If dimension of meshes in \a ms does not correspond to \a meshDimRelToMax or
+ * to the existing meshes of other levels of \a this mesh.
+ * \throw If the meshes in \a ms do not share the same node coordinates array.
+ * \throw If the node coordinates array of \a this mesh (if any) is not the same as that
+ * of the given meshes.
+ * \throw If \a ms[ i ] is not well defined (MEDCouplingUMesh::checkCoherency()).
+ * \throw If names of some meshes in \a ms are equal.
+ * \throw If \a ms includes a mesh with an empty name.
+ */
void MEDFileUMesh::setGroupsFromScratch(int meshDimRelToMax, const std::vector<const MEDCouplingUMesh *>& ms) throw(INTERP_KERNEL::Exception)
{
if(ms.empty())
setGroupsAtLevel(meshDimRelToMax,corr2,true);
}
+/*!
+ * Creates groups at a given level in \a this mesh from a sequence of
+ * meshes each representing a group.
+ * The given meshes must share the same node coordinates array.
+ * \param [in] meshDimRelToMax - the relative dimension to create the groups at.
+ * \param [in] ms - the sequence of meshes. Each mesh in \a ms represents a group to
+ * create in \a this mesh.
+ * \param [in] renum - if \c true, then the optional numbers of entities are taken into
+ * account.
+ * \throw If \a ms is empty.
+ * \throw If dimension of meshes in \a ms does not correspond to \a meshDimRelToMax or
+ * to the existing meshes of other levels of \a this mesh.
+ * \throw If the meshes in \a ms do not share the same node coordinates array.
+ * \throw If the node coordinates array of \a this mesh (if any) is not the same as that
+ * of the given meshes.
+ * \throw If \a ms[ i ] is not well defined (MEDCouplingUMesh::checkCoherency()).
+ * \throw If names of some meshes in \a ms are equal.
+ * \throw If \a ms includes a mesh with an empty name.
+ */
void MEDFileUMesh::setGroupsOnSetMesh(int meshDimRelToMax, const std::vector<const MEDCouplingUMesh *>& ms, bool renum) throw(INTERP_KERNEL::Exception)
{
if(ms.empty())
return const_cast<DataArrayDouble *>(ret);
}
+/*!
+ * Sets the family field of a given relative dimension.
+ * \param [in] meshDimRelToMaxExt - the relative dimension of entities for which
+ * the family field is set.
+ * \param [in] famArr - the array of the family field.
+ * \throw If there are no mesh entities of \a meshDimRelToMaxExt dimension in \a this mesh.
+ * \throw If \a famArr has an invalid size.
+ */
void MEDFileUMesh::setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception)
{
if(meshDimRelToMaxExt==1)
return _ms[traducedRk]->setFamilyArr(famArr);
}
+/*!
+ * Sets the optional numbers of mesh entities of a given dimension.
+ * \param [in] meshDimRelToMaxExt - the relative dimension of mesh entities.
+ * \param [in] renumArr - the array of the numbers.
+ * \throw If there are no mesh entities of \a meshDimRelToMaxExt dimension in \a this mesh.
+ * \throw If \a renumArr has an invalid size.
+ */
void MEDFileUMesh::setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception)
{
if(meshDimRelToMaxExt==1)
(const_cast<DataArrayInt *>(tmp))->setName("");
}
+/*!
+ * Returns ids of mesh entities contained in given families of a given dimension.
+ * \param [in] meshDimRelToMaxExt - a relative dimension of the mesh entities whose ids
+ * are required.
+ * \param [in] fams - the names of the families of interest.
+ * \param [in] renum - if \c true, the optional numbers of entities, if available, are
+ * returned instead of ids.
+ * \return DataArrayInt * - a new instance of DataArrayInt holding either ids or
+ * numbers, if available and required, of mesh entities of the families. The caller
+ * is to delete this array using decrRef() as it is no more needed.
+ * \throw If the family field is missing for \a meshDimRelToMaxExt.
+ */
DataArrayInt *MEDFileStructuredMesh::getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum) const throw(INTERP_KERNEL::Exception)
{
if(meshDimRelToMaxExt!=0 && meshDimRelToMaxExt!=1)
}
}
+/*!
+ * Sets the family field of a given relative dimension.
+ * \param [in] meshDimRelToMaxExt - the relative dimension of entities for which
+ * the family field is set.
+ * \param [in] famArr - the array of the family field.
+ * \throw If there are no mesh entities of \a meshDimRelToMaxExt dimension in \a this mesh.
+ * \throw If \a famArr has an invalid size.
+ * \throw If \a meshDimRelToMaxExt != 0 and \a meshDimRelToMaxExt != 1.
+ */
void MEDFileStructuredMesh::setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception)
{
if(meshDimRelToMaxExt!=0 && meshDimRelToMaxExt!=1)
famArr->incrRef();
}
+/*!
+ * Sets the optional numbers of mesh entities of a given dimension.
+ * \param [in] meshDimRelToMaxExt - the relative dimension of mesh entities.
+ * \param [in] renumArr - the array of the numbers.
+ * \throw If there are no mesh entities of \a meshDimRelToMaxExt dimension in \a this mesh.
+ * \throw If \a renumArr has an invalid size.
+ * \throw If \a meshDimRelToMaxExt != 0 and \a meshDimRelToMaxExt != 1.
+ */
void MEDFileStructuredMesh::setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception)
{
if(meshDimRelToMaxExt!=0 && meshDimRelToMaxExt!=1)
nameArr->incrRef();
}
+/*!
+ * Returns the family field for mesh entities of a given dimension.
+ * \param [in] meshDimRelToMaxExt - the relative dimension of mesh entities.
+ * \return const DataArrayInt * - the family field. It is an array of ids of families
+ * each mesh entity belongs to. It can be \c NULL.
+ * \throw If \a meshDimRelToMaxExt != 0 and \a meshDimRelToMaxExt != 1.
+ */
const DataArrayInt *MEDFileStructuredMesh::getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
{
if(meshDimRelToMaxExt!=0 && meshDimRelToMaxExt!=1)
return _fam_nodes;
}
+/*!
+ * Returns the optional numbers of mesh entities of a given dimension.
+ * \param [in] meshDimRelToMaxExt - the relative dimension of mesh entities.
+ * \return const DataArrayInt * - the array of the entity numbers.
+ * \throw If there are no mesh entities of \a meshDimRelToMaxExt dimension in \a this mesh.
+ * \throw If \a meshDimRelToMaxExt != 0 and \a meshDimRelToMaxExt != 1.
+ */
const DataArrayInt *MEDFileStructuredMesh::getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
{
if(meshDimRelToMaxExt!=0 && meshDimRelToMaxExt!=1)
return _num_nodes;
}
+/*!
+ * Returns the optional numbers of mesh entities of a given dimension transformed using
+ * DataArrayInt::invertArrayN2O2O2N().
+ * \param [in] meshDimRelToMaxExt - the relative dimension of mesh entities.
+ * \return const DataArrayInt * - the array of the entity numbers transformed using
+ * DataArrayInt::invertArrayN2O2O2N().
+ * \throw If \a meshDimRelToMaxExt != 0 and \a meshDimRelToMaxExt != 1.
+ * \throw If there are no mesh entities of \a meshDimRelToMaxExt dimension in \a this mesh.
+ */
const DataArrayInt *MEDFileStructuredMesh::getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
{
if(meshDimRelToMaxExt!=0 && meshDimRelToMaxExt!=1)
return _names_nodes;
}
+/*!
+ * Returns relative dimensions of mesh entities (excluding nodes) present in \a this mesh.
+ * \return std::vector<int> - a sequence of the relative dimensions: [0].
+ */
std::vector<int> MEDFileStructuredMesh::getNonEmptyLevels() const
{
std::vector<int> ret(1);
return ret;
}
+/*!
+ * Returns relative dimensions of mesh entities (including nodes) present in \a this mesh.
+ * \return std::vector<int> - a sequence of the relative dimensions: [1,0].
+ */
std::vector<int> MEDFileStructuredMesh::getNonEmptyLevelsExt() const
{
std::vector<int> ret(2);
* \return a pointer to cartesian mesh that need to be managed by the caller.
* \warning the returned pointer has to be managed by the caller.
*/
+
+/*!
+ * Returns a pointer to MEDCouplingStructuredMesh held by \a this.
+ * \param [in] meshDimRelToMax - it must be \c 0.
+ * \param [in] renum - it must be \c false.
+ * \return MEDCouplingMesh * - a pointer to MEDCouplingMesh that the caller is to
+ * delete using decrRef() as it is no more needed.
+ */
MEDCouplingMesh *MEDFileStructuredMesh::getGenMeshAtLevel(int meshDimRelToMax, bool renum) const throw(INTERP_KERNEL::Exception)
{
if(renum)
return const_cast<MEDCouplingStructuredMesh *>(m);
}
+/*!
+ * Returns number of mesh entities of a given relative dimension in \a this mesh.
+ * \param [in] meshDimRelToMaxExt - the relative dimension of interest.
+ * \return int - the number of entities.
+ * \throw If no mesh entities of dimension \a meshDimRelToMaxExt are available in \a this mesh.
+ */
int MEDFileStructuredMesh::getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
{
if(meshDimRelToMaxExt!=0 && meshDimRelToMaxExt!=1)
{
setName(strm->getName());
setDescription(strm->getDescription());
+ setUnivName(strm->getUnivName());
setIteration(strm->getIteration());
setOrder(strm->getOrder());
setTimeValue(strm->getTime());
MEDFileUMeshL2::WriteFamiliesAndGrps(fid,maa,_families,_groups,_too_long_str);
}
+/*!
+ * Returns an empty instance of MEDFileCMesh.
+ * \return MEDFileCMesh * - a new instance of MEDFileCMesh. The caller is to delete this
+ * mesh using decrRef() as it is no more needed.
+ */
MEDFileCMesh *MEDFileCMesh::New()
{
return new MEDFileCMesh;
}
+/*!
+ * Returns a new MEDFileCMesh holding the mesh data that has been read from a given MED
+ * file. The first mesh in the file is loaded.
+ * \param [in] fileName - the name of MED file to read.
+ * \return MEDFileCMesh * - a new instance of MEDFileCMesh. The caller is to delete this
+ * mesh using decrRef() as it is no more needed.
+ * \throw If the file is not readable.
+ * \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) throw(INTERP_KERNEL::Exception)
{
std::vector<std::string> ms=MEDLoader::GetMeshNames(fileName);
return new MEDFileCMesh(fid,ms.front().c_str(),dt,it);
}
+/*!
+ * Returns a new MEDFileCMesh holding the mesh data that has been read from a given MED
+ * file. The mesh to load is specified by its name and numbers of a time step and an
+ * iteration.
+ * \param [in] fileName - the name of MED file to read.
+ * \param [in] mName - the name of the mesh to read.
+ * \param [in] dt - the number of a time step.
+ * \param [in] it - the number of an iteration.
+ * \return MEDFileCMesh * - a new instance of MEDFileCMesh. The caller is to delete this
+ * mesh using decrRef() as it is no more needed.
+ * \throw If the file is not readable.
+ * \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) throw(INTERP_KERNEL::Exception)
{
MEDFileUtilities::CheckFileForRead(fileName);
return ret;
}
+/*!
+ * Returns the dimension on cells in \a this mesh.
+ * \return int - the mesh dimension.
+ * \throw If there are no cells in this mesh.
+ */
int MEDFileCMesh::getMeshDimension() const throw(INTERP_KERNEL::Exception)
{
if(!((const MEDCouplingCMesh*)_cmesh))
return _cmesh->getMeshDimension();
}
+/*!
+ * Returns a string describing \a this mesh.
+ * \return std::string - the mesh information string.
+ */
std::string MEDFileCMesh::simpleRepr() const
{
return MEDFileStructuredMesh::simpleRepr();
}
+/*!
+ * Returns a full textual description of \a this mesh.
+ * \return std::string - the string holding the mesh description.
+ */
std::string MEDFileCMesh::advancedRepr() const
{
return simpleRepr();
return ret.retn();
}
+/*!
+ * Checks if \a this and another mesh are equal.
+ * \param [in] other - the mesh to compare with.
+ * \param [in] eps - a precision used to compare real values.
+ * \param [in,out] what - the string returning description of unequal data.
+ * \return bool - \c true if the meshes are equal, \c false, else.
+ */
bool MEDFileCMesh::isEqual(const MEDFileMesh *other, double eps, std::string& what) const
{
if(!MEDFileStructuredMesh::isEqual(other,eps,what))
return true;
}
+/*!
+ * Clears redundant attributes of incorporated data arrays.
+ */
void MEDFileCMesh::clearNonDiscrAttributes() const
{
MEDFileStructuredMesh::clearNonDiscrAttributes();
loadStrMeshFromFile(&loaderl2,fid,mName,dt,it);
}
+/*!
+ * Returns a const pointer to MEDCouplingCMesh held by \a this mesh.
+ * \return const MEDCouplingCMesh * - a pointer to the held MEDCouplingCMesh.
+ */
const MEDCouplingCMesh *MEDFileCMesh::getMesh() const
{
synchronizeTinyInfoOnLeaves();
return _cmesh;
}
+/*!
+ * Sets the MEDCouplingCMesh holding the data of \a this mesh.
+ * \param [in] m - the new MEDCouplingCMesh to refer to.
+ * \throw If the name or the description of \a this mesh and \a m are not empty and are
+ * different.
+ */
void MEDFileCMesh::setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception)
{
dealWithTinyInfo(m);
MEDLoaderBase::safeStrCpy2(u.c_str(),MED_SNAME_SIZE-1,unit+i*MED_SNAME_SIZE,_too_long_str);//MED_TAILLE_PNOM-1 to avoid to write '\0' on next compo
}
MEDmeshCr(fid,maa,spaceDim,meshDim,MED_STRUCTURED_MESH,desc,dtunit,MED_SORT_DTIT,MED_CARTESIAN,comp,unit);
+ MEDmeshUniversalNameWr(fid,maa);
MEDmeshGridTypeWr(fid,maa,MED_CARTESIAN_GRID);
for(int i=0;i<spaceDim;i++)
{
MEDLoaderBase::safeStrCpy2(u.c_str(),MED_SNAME_SIZE-1,unit+i*MED_SNAME_SIZE,_too_long_str);//MED_TAILLE_PNOM-1 to avoid to write '\0' on next compo
}
MEDmeshCr(fid,maa,spaceDim,meshDim,MED_STRUCTURED_MESH,desc,dtunit,MED_SORT_DTIT,MED_CARTESIAN,comp,unit);
+ MEDmeshUniversalNameWr(fid,maa);
MEDmeshGridTypeWr(fid,maa,MED_CURVILINEAR_GRID);
std::vector<int> nodeGridSt=_clmesh->getNodeGridStructure();
MEDmeshGridStructWr(fid,maa,_iteration,_order,_time,&nodeGridSt[0]);
void setName(const char *name) { _name=name; }
bool changeNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
const char *getName() const { return _name.c_str(); }
- void setUnivName(const char *name) { _univ_name=name; }
const char *getUnivName() const { return _univ_name.c_str(); }
+ bool getUnivNameWrStatus() const { return _univ_wr_status; }
+ void setUnivNameWrStatus(bool newStatus) { _univ_wr_status=newStatus; }
void setDescription(const char *name) { _desc_name=name; }
const char *getDescription() const { return _desc_name.c_str(); }
void setOrder(int order) { _order=order; }
virtual bool unPolyze(std::vector<int>& oldCode, std::vector<int>& newCode, DataArrayInt *& o2nRenumCell) throw(INTERP_KERNEL::Exception) = 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) throw(INTERP_KERNEL::Exception);
virtual void writeLL(med_idt fid) const throw(INTERP_KERNEL::Exception) = 0;
void dealWithTinyInfo(const MEDCouplingMesh *m) throw(INTERP_KERNEL::Exception);
double _time;
std::string _dt_unit;
std::string _name;
- std::string _univ_name;
+ //! this attribute do not impact the state of instance -> mutable
+ mutable std::string _univ_name;
+ bool _univ_wr_status;
std::string _desc_name;
protected:
std::map<std::string, std::vector<std::string> > _groups;
void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
- void setMeshAtLevelGen(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld) throw(INTERP_KERNEL::Exception);
void setGroupsFromScratch(int meshDimRelToMax, const std::vector<const MEDCouplingUMesh *>& ms) throw(INTERP_KERNEL::Exception);
void setGroupsOnSetMesh(int meshDimRelToMax, const std::vector<const MEDCouplingUMesh *>& ms, bool renum) throw(INTERP_KERNEL::Exception);
void optimizeFamilies() throw(INTERP_KERNEL::Exception);
using namespace ParaMEDMEM;
-MEDFileMeshL2::MEDFileMeshL2():_name(MED_NAME_SIZE),_description(MED_COMMENT_SIZE),_dt_unit(MED_LNAME_SIZE)
+MEDFileMeshL2::MEDFileMeshL2():_name(MED_NAME_SIZE),_description(MED_COMMENT_SIZE),_univ_name(MED_LNAME_SIZE),_dt_unit(MED_LNAME_SIZE)
{
}
INTERP_KERNEL::AutoPtr<char> nameTmp=MEDLoaderBase::buildEmptyString(MED_NAME_SIZE);
INTERP_KERNEL::AutoPtr<char> axisname=MEDLoaderBase::buildEmptyString(naxis*MED_SNAME_SIZE);
INTERP_KERNEL::AutoPtr<char> axisunit=MEDLoaderBase::buildEmptyString(naxis*MED_SNAME_SIZE);
+ INTERP_KERNEL::AutoPtr<char> univTmp=MEDLoaderBase::buildEmptyString(MED_LNAME_SIZE);
if(MEDmeshInfo(fid,mId,nameTmp,&spaceDim,&Mdim,&type_maillage,_description.getPointer(),_dt_unit.getPointer(),
&stype,&nstep,&axistype,axisname,axisunit)!=0)
throw INTERP_KERNEL::Exception("A problem has been detected when trying to get info on mesh !");
+ MEDmeshUniversalNameRd(fid,nameTmp,_univ_name.getPointer());
switch(type_maillage)
{
case MED_UNSTRUCTURED_MESH:
std::size_t getHeapMemorySize() const { return 0; }
const char *getName() const { return _name.getReprForWrite(); }
const char *getDescription() const { return _description.getReprForWrite(); }
+ const char *getUnivName() const { return _univ_name.getReprForWrite(); }
const char *getTimeUnit() const { return _dt_unit.getReprForWrite(); }
int getIteration() const { return _iteration; }
int getOrder() const { return _order; }
protected:
MEDFileString _name;
MEDFileString _description;
+ MEDFileString _univ_name;
MEDFileString _dt_unit;
int _iteration;
int _order;
SET(PYFILES_TO_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/MEDLoader.py ${CMAKE_CURRENT_SOURCE_DIR}/libMEDLoader_Swig.py)
INSTALL_AND_COMPILE_PYTHON_FILE("${PYFILES_TO_INSTALL}" ${MED_salomescript_PYTHON})
-INSTALL(FILES MEDLoaderDataForTest.py MEDLoaderTest.py MEDLoaderTest2.py MEDLoaderTest3.py DESTINATION ${MED_salomescript_PYTHON})
+INSTALL(FILES MEDLoaderDataForTest.py MEDLoaderTest.py MEDLoaderTest2.py MEDLoaderTest3.py medutilities.py DESTINATION ${MED_salomescript_PYTHON})
+INSTALL(FILES med2sauv sauv2med PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ DESTINATION ${MED_salomescript_PYTHON} )
ADD_TEST(MEDLoaderTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDLoaderTest.py)
ADD_TEST(MEDLoaderTest2 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDLoaderTest2.py)
virtual void clearNonDiscrAttributes() const;
void setName(const char *name);
const char *getName();
- void setUnivName(const char *name);
const char *getUnivName() const;
+ bool getUnivNameWrStatus() const;
+ void setUnivNameWrStatus(bool newStatus);
void setDescription(const char *name);
const char *getDescription() const;
void setOrder(int order);
void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
- void setMeshAtLevelGen(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld) throw(INTERP_KERNEL::Exception);
void setGroupsFromScratch(int meshDimRelToMax, const std::vector<const MEDCouplingUMesh *>& ms) throw(INTERP_KERNEL::Exception);
void setGroupsOnSetMesh(int meshDimRelToMax, const std::vector<const MEDCouplingUMesh *>& ms, bool renum) throw(INTERP_KERNEL::Exception);
void optimizeFamilies() throw(INTERP_KERNEL::Exception);
m2.checkCoherency()
#
mm=MEDFileUMesh.New()
+ self.assertTrue(mm.getUnivNameWrStatus())
mm.setName("MyFirstMEDCouplingMEDmesh")
mm.setDescription("IHopeToConvinceLastMEDMEMUsers")
mm.setCoords(c)
mmCpy.write(outFileName,2);
#
mm=MEDFileMesh.New(outFileName)
+ self.assertTrue(mm.getUnivNameWrStatus())
+ self.assertTrue(isinstance(mm.getUnivName(),str))
+ self.assertTrue(len(mm.getUnivName())!=0)
mbis=mm.getMeshAtLevel(0)
m.setName(mm.getName()) ; m.setDescription(mm.getDescription())
self.assertTrue(m.isEqual(mbis,1e-12));
da=m.getFamilyArr(1,"family1")
expected1=[2,4,9]
self.assertEqual(expected1,da.getValues())
+ self.assertTrue(m.getUnivNameWrStatus())
m.write(outFileName,2);
mm=MEDFileMesh.New(outFileName)
+ self.assertTrue(isinstance(mm,MEDFileCMesh))
+ self.assertTrue(isinstance(mm.getUnivName(),str))
+ self.assertTrue(len(mm.getUnivName())!=0)
self.assertTrue(m.isEqual(mm,1e-12)[0])
self.assertEqual(expected1,mm.getFamilyArr(1,"family1").getValues())
m2=mm.getMesh()
#
m1=MEDFileMesh.New(fname)
self.assertTrue(isinstance(m1,MEDFileCurveLinearMesh))
+ self.assertTrue(isinstance(m1.getUnivName(),str))
+ self.assertTrue(len(m1.getUnivName())!=0)
self.assertTrue(m1.getMesh().isEqual(mesh,1e-12))
pass