From c0d1b91cfe164d84c1f549e48578a66662e90034 Mon Sep 17 00:00:00 2001 From: ageay Date: Thu, 18 Apr 2013 09:07:01 +0000 Subject: [PATCH] Merge from MrgToV7main1804 --- .../fakesources/MEDCouplingFieldDouble.C | 394 +++++ doc/doxygen/medcouplingexamples.doxy | 420 ++++- doc/salome/tui/static/footer.html | 22 +- resources/CMakeLists.txt | 1 + resources/Makefile.am | 3 +- resources/portico_3subs.sauv | 182 ++ src/MEDCalculator/Swig/CMakeLists.txt | 5 +- src/MEDCoupling/MEDCouplingField.cxx | 239 ++- src/MEDCoupling/MEDCouplingFieldDouble.cxx | 1528 ++++++++++++++--- src/MEDCoupling/MEDCouplingFieldDouble.hxx | 1 - src/MEDCoupling/MEDCouplingMemArray.cxx | 11 +- src/MEDCoupling/MEDCouplingMemArray.hxx | 25 +- src/MEDCoupling/MEDCouplingMemArray.txx | 57 +- src/MEDCoupling/MEDCouplingMesh.cxx | 3 +- src/MEDCoupling/MEDCouplingUMesh.cxx | 15 +- .../Test/MEDCouplingExamplesTest.cxx | 688 +++++++- src/MEDCouplingCorba_Swig/CMakeLists.txt | 5 +- .../Client/CMakeLists.txt | 5 +- src/MEDCoupling_Swig/CMakeLists.txt | 15 +- src/MEDCoupling_Swig/MEDCouplingBasicsTest.py | 21 + src/MEDCoupling_Swig/MEDCouplingCommon.i | 14 +- .../MEDCouplingExamplesTest.py | 449 ++++- src/MEDCoupling_Swig/MEDCouplingMemArray.i | 26 + src/MEDCoupling_Swig/MEDCouplingNumpyTest.py | 356 ++++ src/MEDCoupling_Swig/MEDCouplingTypemaps.i | 327 +++- src/MEDCoupling_Swig/Makefile.am | 2 +- src/MEDLoader/MEDFileMesh.cxx | 2 +- src/MEDLoader/Swig/CMakeLists.txt | 8 +- src/MEDLoader/Test/SauvLoaderTest.cxx | 80 +- src/MEDLoader/Test/SauvLoaderTest.hxx | 2 + src/ParaMEDMEM_Swig/CMakeLists.txt | 7 + 31 files changed, 4453 insertions(+), 460 deletions(-) create mode 100644 doc/doxygen/fakesources/MEDCouplingFieldDouble.C create mode 100644 resources/portico_3subs.sauv create mode 100644 src/MEDCoupling_Swig/MEDCouplingNumpyTest.py diff --git a/doc/doxygen/fakesources/MEDCouplingFieldDouble.C b/doc/doxygen/fakesources/MEDCouplingFieldDouble.C new file mode 100644 index 000000000..ee19715ca --- /dev/null +++ b/doc/doxygen/fakesources/MEDCouplingFieldDouble.C @@ -0,0 +1,394 @@ +// 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 +{ + /*! + * Returns a new MEDCouplingFieldDouble containing sum values of corresponding values of + * \a this and a given field ( _f_ [ i, j ] = _this_ [ i, j ] + _other_ [ i, j ] ). + * Number of tuples and components in the two fields must be the same. + * \param [in] other - the input field. + * \return MEDCouplingFieldDouble * - the new instance of MEDCouplingFieldDouble. + * The caller is to delete this result field using decrRef() as it is no more + * needed. + * \throw If the fields are not strictly compatible (areStrictlyCompatible()), i.e. they + * differ not only in values. + */ + MEDCouplingFieldDouble *MEDCouplingFieldDouble::operator+(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception) {} + /*! + * Returns a new MEDCouplingFieldDouble containing subtraction of corresponding values of + * \a this and a given field ( _f_ [ i, j ] = _this_ [ i, j ] - _other_ [ i, j ] ). + * Number of tuples and components in the two fields must be the same. + * \param [in] other - the field to subtract from \a this one. + * \return MEDCouplingFieldDouble * - the new instance of MEDCouplingFieldDouble. + * The caller is to delete this result field using decrRef() as it is no more + * needed. + * \throw If the fields are not strictly compatible (areStrictlyCompatible()), i.e. they + * differ not only in values. + */ + MEDCouplingFieldDouble *MEDCouplingFieldDouble::operator-(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception) {} + /*! + * Returns a new MEDCouplingFieldDouble containing product values of \a this and a + * given field. There are 2 valid cases. + * 1. The fields have same number of tuples and components. Then each value of + * the result field (_f_) is a product of the corresponding values of _this_ and + * _other_, i.e. _f_ [ i, j ] = _this_ [ i, j ] * _other_ [ i, j ]. + * 2. The fields have same number of tuples and one field, say _other_, has one + * component. Then + * _f_ [ i, j ] = _this_ [ i, j ] * _other_ [ i, 0 ]. + * + * The two fields must have same number of tuples and same underlying mesh. + * \param [in] other - a factor field. + * \return MEDCouplingFieldDouble * - the new instance of MEDCouplingFieldDouble. + * The caller is to delete this result field using decrRef() as it is no more + * needed. + * \throw If the fields are not compatible for production (areCompatibleForMul()), + * i.e. they differ not only in values and possibly number of components. + */ + MEDCouplingFieldDouble *MEDCouplingFieldDouble::operator*(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception) {} + /*! + * Returns a new MEDCouplingFieldDouble containing division of \a this and a given + * field. There are 2 valid cases. + * 1. The fields have same number of tuples and components. Then each value of + * the result field (_f_) is a division of the corresponding values of \a this and + * \a other, i.e. _f_ [ i, j ] = _this_ [ i, j ] / _other_ [ i, j ]. + * 2. The fields have same number of tuples and _other_ has one component. Then + * _f_ [ i, j ] = _this_ [ i, j ] / _other_ [ i, 0 ]. + * + * \param [in] other - a denominator field. + * \return MEDCouplingFieldDouble * - the new instance of MEDCouplingFieldDouble. + * The caller is to delete this result field using decrRef() as it is no more + * needed. + * \throw If the fields are not compatible for division (areCompatibleForDiv()), + * i.e. they differ not only in values and possibly in number of components. + */ + MEDCouplingFieldDouble *MEDCouplingFieldDouble::operator/(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception) {} + /*! + * Returns a new MEDCouplingFieldDouble containing a dot product of \a this and a given field, + * so that the i-th tuple of the result field (_f_) is a sum of products of j-th components of + * i-th tuples of two fields (\f$ f_i = \sum_ {}^n f1_j * f2_j \f$). + * Number of tuples and components in the two fields must be the same. + * \param [in] other - the input field. + * \return MEDCouplingFieldDouble * - the new instance of MEDCouplingFieldDouble. + * The caller is to delete this result field using decrRef() as it is no more + * needed. + * \throw If the fields are not strictly compatible (areStrictlyCompatible()), i.e. they + * differ not only in values. + */ + MEDCouplingFieldDouble *MEDCouplingFieldDouble::dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception) {} + /*! + * Returns a new MEDCouplingFieldDouble containing a cross product of \a this and + * a given field, so that the i-th tuple of the result field is a 3D vector which + * is a cross product of two vectors defined by the i-th tuples of the two fields. + * Number of tuples in the fields must be the same. + * Number of components in the fields must be 3. + * \param [in] other - the input field. + * \return MEDCouplingFieldDouble * - the new instance of MEDCouplingFieldDouble. + * The caller is to delete this result field using decrRef() as it is no more + * needed. + * \throw If \a this->getNumberOfComponents() != 3 + * \throw If \a other->getNumberOfComponents() != 3 + * \throw If the fields are not strictly compatible (areStrictlyCompatible()), i.e. they + * differ not only in values. + */ + MEDCouplingFieldDouble *MEDCouplingFieldDouble::crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception) {} + /*! + * Returns a new MEDCouplingFieldDouble containing maximal values of \a this and a + * given field. Number of tuples and components in the two fields must be the same. + * \param [in] other - the field to compare values with \a this one. + * \return MEDCouplingFieldDouble * - the new instance of MEDCouplingFieldDouble. + * The caller is to delete this result field using decrRef() as it is no more + * needed. + * \throw If the fields are not strictly compatible (areStrictlyCompatible()), i.e. they + * differ not only in values. + */ + MEDCouplingFieldDouble *MEDCouplingFieldDouble::max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception) {} + /*! + * Returns a new MEDCouplingFieldDouble containing minimal values of \a this and a + * given field. Number of tuples and components in the two fields must be the same. + * \param [in] other - the field to compare values with \a this one. + * \return MEDCouplingFieldDouble * - the new instance of MEDCouplingFieldDouble. + * The caller is to delete this result field using decrRef() as it is no more + * needed. + * \throw If the fields are not strictly compatible (areStrictlyCompatible()), i.e. they + * differ not only in values. + */ + MEDCouplingFieldDouble *MEDCouplingFieldDouble::min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception) {} + /*! + * Returns the data array of \a this field. + * \return const DataArrayDouble * - a const pointer to the data array of \a this field. + */ + const DataArrayDouble *MEDCouplingFieldDouble::getArray() const {} + /*! + * Returns the data array of \a this field apt for modification. + * \return DataArrayDouble * - a non-const pointer to the data array of \a this field. + */ + DataArrayDouble *MEDCouplingFieldDouble::getArray() {} + /*! + * Sets a precision used to compare time values. + * \param [in] val - the precision value. + */ + void MEDCouplingFieldDouble::setTimeTolerance(double val) {} + /*! + * Returns a precision used to compare time values. + * \return double - the precision value. + */ + double MEDCouplingFieldDouble::getTimeTolerance() const {} + /*! + * Sets the number of iteration where the data array of \a this field has been calculated. + * For examples of field construction, see \ref MEDCouplingFirstSteps3. + * \param [in] it - the iteration number. + */ + void MEDCouplingFieldDouble::setIteration(int it) throw(INTERP_KERNEL::Exception) {} + /*! + * Sets the number of iteration where the second data array of \a this field has been calculated. + * For examples of field construction, see \ref MEDCouplingFirstSteps3. + * \param [in] it - the iteration number. + */ + void MEDCouplingFieldDouble::setEndIteration(int it) throw(INTERP_KERNEL::Exception) {} + /*! + * Sets the order number of iteration where the data array of \a this field has been calculated. + * For examples of field construction, see \ref MEDCouplingFirstSteps3. + * \param [in] order - the order number. + */ + void MEDCouplingFieldDouble::setOrder(int order) throw(INTERP_KERNEL::Exception) {} + /*! + * Sets the order number of iteration where the second data array of \a this field has + * been calculated. + * \param [in] order - the order number. + */ + void MEDCouplingFieldDouble::setEndOrder(int order) throw(INTERP_KERNEL::Exception) {} + /*! + * Sets the time when the data array of \a this field has been calculated. + * For examples of field construction, see \ref MEDCouplingFirstSteps3. + * \param [in] val - the time value. + */ + void MEDCouplingFieldDouble::setTimeValue(double val) throw(INTERP_KERNEL::Exception) {} + /*! + * Sets the time when the second data array of \a this field has been calculated. + * \param [in] val - the time value. + */ + void MEDCouplingFieldDouble::setEndTimeValue(double val) throw(INTERP_KERNEL::Exception) {} + /*! + * Sets time, number of iteration and order number of iteration when the data array + * of \a this field has been calculated. + * For examples of field construction, see \ref MEDCouplingFirstSteps3. + * \param [in] val - the time value. + * \param [in] iteration - the iteration number. + * \param [in] order - the order number. + */ + void MEDCouplingFieldDouble::setTime(double val, int iteration, int order) {} + /*! + * Returns time, number of iteration and order number of iteration when the data array + * of \a this field has been calculated. + * For examples of field construction, see \ref MEDCouplingFirstSteps3. + * \param [out] iteration - the iteration number. + * \param [out] order - the order number. + * \return double - the time value. + */ + double MEDCouplingFieldDouble::getTime(int& iteration, int& order) const {} + /*! + * Returns a value indexed by a tuple id and a component id. + * \param [in] tupleId - the id of the tuple of interest. + * \param [in] compoId - the id of the component of interest. + * \return double - the field value. + */ + double MEDCouplingFieldDouble::getIJ(int tupleId, int compoId) const {} +} + +namespace ParaMEDMEM +{ +/*! \name Basic API */ +///@{ +MEDCouplingFieldDouble::AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2); +MEDCouplingFieldDouble::CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2); +MEDCouplingFieldDouble::DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2); +MEDCouplingFieldDouble::DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2); +MEDCouplingFieldDouble::MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2); +MEDCouplingFieldDouble::MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2); +MEDCouplingFieldDouble::MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2); +MEDCouplingFieldDouble::MergeFields(const std::vector& a); +MEDCouplingFieldDouble::MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2); +MEDCouplingFieldDouble::MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2); +MEDCouplingFieldDouble::New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME); +MEDCouplingFieldDouble::New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME); +MEDCouplingFieldDouble::SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2); +MEDCouplingFieldDouble::WriteVTK(const char *fileName, const std::vector& fs); +MEDCouplingFieldDouble::accumulate(double *res) const; +MEDCouplingFieldDouble::accumulate(int compId) const; +MEDCouplingFieldDouble::advancedRepr() const; +MEDCouplingFieldDouble::applyFunc(const char *func); +MEDCouplingFieldDouble::applyFunc(int nbOfComp, FunctionToEvaluate func); +MEDCouplingFieldDouble::applyFunc(int nbOfComp, const char *func); +MEDCouplingFieldDouble::applyFunc(int nbOfComp, double val); +MEDCouplingFieldDouble::applyFunc2(int nbOfComp, const char *func); +MEDCouplingFieldDouble::applyFunc3(int nbOfComp, const std::vector& varsOrder, const char *func); +MEDCouplingFieldDouble::applyLin(double a, double b, int compoId); +MEDCouplingFieldDouble::buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const; +MEDCouplingFieldDouble::buildSubPart(const DataArrayInt *part) const; +MEDCouplingFieldDouble::buildSubPart(const int *partBg, const int *partEnd) const; +MEDCouplingFieldDouble::changeNbOfComponents(int newNbOfComp, double dftValue=0.); +MEDCouplingFieldDouble::changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15); +MEDCouplingFieldDouble::checkCoherency() const; +MEDCouplingFieldDouble::clone(bool recDeepCpy) const; +MEDCouplingFieldDouble::cloneWithMesh(bool recDeepCpy) const; +MEDCouplingFieldDouble::copyTinyAttrFrom(const MEDCouplingFieldDouble *other); +MEDCouplingFieldDouble::copyTinyStringsFrom(const MEDCouplingField *other); +MEDCouplingFieldDouble::crossProduct(const MEDCouplingFieldDouble& other) const; +MEDCouplingFieldDouble::deepCpy() const; +MEDCouplingFieldDouble::determinant() const; +MEDCouplingFieldDouble::deviator() const; +MEDCouplingFieldDouble::dot(const MEDCouplingFieldDouble& other) const; +MEDCouplingFieldDouble::doublyContractedProduct() const; +MEDCouplingFieldDouble::eigenValues() const; +MEDCouplingFieldDouble::eigenVectors() const; +MEDCouplingFieldDouble::fillFromAnalytic(int nbOfComp, FunctionToEvaluate func); +MEDCouplingFieldDouble::fillFromAnalytic(int nbOfComp, const char *func); +MEDCouplingFieldDouble::fillFromAnalytic2(int nbOfComp, const char *func); +MEDCouplingFieldDouble::fillFromAnalytic3(int nbOfComp, const std::vector& varsOrder, const char *func); +MEDCouplingFieldDouble::getArray() const; +MEDCouplingFieldDouble::getArray(); +MEDCouplingFieldDouble::getAverageValue() const; +MEDCouplingFieldDouble::getIJ(int tupleId, int compoId) const; +MEDCouplingFieldDouble::getIJK(int cellId, int nodeIdInCell, int compoId) const; +MEDCouplingFieldDouble::getIdsInRange(double vmin, double vmax) const; +MEDCouplingFieldDouble::getMaxValue() const; +MEDCouplingFieldDouble::getMaxValue2(DataArrayInt*& tupleIds) const; +MEDCouplingFieldDouble::getMinValue() const; +MEDCouplingFieldDouble::getMinValue2(DataArrayInt*& tupleIds) const; +MEDCouplingFieldDouble::getNumberOfComponents() const; +MEDCouplingFieldDouble::getNumberOfTuples() const; +MEDCouplingFieldDouble::getNumberOfValues() const; +MEDCouplingFieldDouble::getTime(int& iteration, int& order) const; +MEDCouplingFieldDouble::getTimeDiscretization() const; +MEDCouplingFieldDouble::getTimeTolerance() const; +MEDCouplingFieldDouble::getTimeUnit() const; +MEDCouplingFieldDouble::getValueOn(const double *spaceLoc, double *res) const; +MEDCouplingFieldDouble::getValueOn(const double *spaceLoc, double time, double *res) const; +MEDCouplingFieldDouble::getValueOnMulti(const double *spaceLoc, int nbOfPoints) const; +MEDCouplingFieldDouble::getValueOnPos(int i, int j, int k, double *res) const; +MEDCouplingFieldDouble::getWeightedAverageValue(double *res, bool isWAbs=true) const; +MEDCouplingFieldDouble::getWeightedAverageValue(int compId, bool isWAbs=true) const; +MEDCouplingFieldDouble::integral(bool isWAbs, double *res) const; +MEDCouplingFieldDouble::integral(int compId, bool isWAbs) const; +MEDCouplingFieldDouble::inverse() const; +MEDCouplingFieldDouble::isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const; +MEDCouplingFieldDouble::keepSelectedComponents(const std::vector& compoIds) const; +MEDCouplingFieldDouble::magnitude() const; +MEDCouplingFieldDouble::max(const MEDCouplingFieldDouble& other) const; +MEDCouplingFieldDouble::maxPerTuple() const; +MEDCouplingFieldDouble::mergeNodes(double eps, double epsOnVals=1e-15); +MEDCouplingFieldDouble::mergeNodes2(double eps, double epsOnVals=1e-15); +MEDCouplingFieldDouble::min(const MEDCouplingFieldDouble& other) const; +MEDCouplingFieldDouble::norm2() const; +MEDCouplingFieldDouble::normL1(double *res) const; +MEDCouplingFieldDouble::normL1(int compId) const; +MEDCouplingFieldDouble::normL2(double *res) const; +MEDCouplingFieldDouble::normL2(int compId) const; +MEDCouplingFieldDouble::normMax() const; +MEDCouplingFieldDouble::renumberCells(const int *old2NewBg, bool check=true); +MEDCouplingFieldDouble::renumberNodes(const int *old2NewBg, double eps=1e-15); +MEDCouplingFieldDouble::setArray(DataArrayDouble *array); +MEDCouplingFieldDouble::setArrays(const std::vector& arrs); +MEDCouplingFieldDouble::setEndArray(DataArrayDouble *array); +MEDCouplingFieldDouble::setEndIteration(int it); +MEDCouplingFieldDouble::setIteration(int it); +MEDCouplingFieldDouble::setNature(NatureOfField nat); +MEDCouplingFieldDouble::setOrder(int order); +MEDCouplingFieldDouble::setSelectedComponents(const MEDCouplingFieldDouble *f, const std::vector& compoIds); +MEDCouplingFieldDouble::setTime(double val, int iteration, int order); +MEDCouplingFieldDouble::setTimeTolerance(double val); +MEDCouplingFieldDouble::setTimeUnit(const char *unit); +MEDCouplingFieldDouble::setTimeValue(double val); +MEDCouplingFieldDouble::simpleRepr() const; +MEDCouplingFieldDouble::simplexize(int policy); +MEDCouplingFieldDouble::sortPerTuple(bool asc); +MEDCouplingFieldDouble::substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15); +MEDCouplingFieldDouble::trace() const; +MEDCouplingFieldDouble::updateTime() const; +MEDCouplingFieldDouble::writeVTK(const char *fileName) const; +MEDCouplingFieldDouble::zipConnectivity(int compType, double epsOnVals=1e-15); +MEDCouplingFieldDouble::zipCoords(double epsOnVals=1e-15); + MEDCouplingFieldDouble & MEDCouplingFieldDouble::operator=(double value); + MEDCouplingFieldDouble * MEDCouplingFieldDouble::operator*(const MEDCouplingFieldDouble& other) const; + MEDCouplingFieldDouble * MEDCouplingFieldDouble::operator+(const MEDCouplingFieldDouble& other) const; + MEDCouplingFieldDouble * MEDCouplingFieldDouble::operator-(const MEDCouplingFieldDouble& other) const; + MEDCouplingFieldDouble * MEDCouplingFieldDouble::operator/(const MEDCouplingFieldDouble& other) const; + const MEDCouplingFieldDouble & MEDCouplingFieldDouble::operator*=(const MEDCouplingFieldDouble& other); + const MEDCouplingFieldDouble & MEDCouplingFieldDouble::operator+=(const MEDCouplingFieldDouble& other); + const MEDCouplingFieldDouble & MEDCouplingFieldDouble::operator-=(const MEDCouplingFieldDouble& other); + const MEDCouplingFieldDouble & MEDCouplingFieldDouble::operator/=(const MEDCouplingFieldDouble& other); +///@} +/*! \name Advanced API */ +///@{ +MEDCouplingFieldDouble::renumberCellsWithoutMesh(const int *old2NewBg, bool check=true); +MEDCouplingFieldDouble::renumberNodesWithoutMesh(const int *old2NewBg, int newNbOfNodes, double eps=1e-15); +///@} + +/*! \name Others... */ +///@{ + MEDCouplingFieldDouble::negate() const; + MEDCouplingFieldDouble::operator^(const MEDCouplingFieldDouble& other) const; + MEDCouplingFieldDouble::operator^=(const MEDCouplingFieldDouble& other); + MEDCouplingFieldDouble::PowFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2); +MEDCouplingFieldDouble::buildSubPartRange(int begin, int end, int step) const; +MEDCouplingFieldDouble::MEDCouplingFieldDouble(NatureOfField n, MEDCouplingTimeDiscretization *td, MEDCouplingFieldDiscretization *type); +MEDCouplingFieldDouble::MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td); +MEDCouplingFieldDouble::MEDCouplingFieldDouble(const MEDCouplingFieldDouble& other, bool deepCopy); +MEDCouplingFieldDouble::MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td); +MEDCouplingFieldDouble::applyFuncFast32(const char *func); +MEDCouplingFieldDouble::applyFuncFast64(const char *func); +MEDCouplingFieldDouble::areCompatibleForDiv(const MEDCouplingField *other) const; +MEDCouplingFieldDouble::areCompatibleForMeld(const MEDCouplingFieldDouble *other) const; +MEDCouplingFieldDouble::areCompatibleForMerge(const MEDCouplingField *other) const; +MEDCouplingFieldDouble::areCompatibleForMul(const MEDCouplingField *other) const; +MEDCouplingFieldDouble::areStrictlyCompatible(const MEDCouplingField *other) const; +MEDCouplingFieldDouble::copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other); +MEDCouplingFieldDouble::extractSlice3D(const double *origin, const double *vec, double eps) const; +MEDCouplingFieldDouble::finishUnserialization(const std::vector& tinyInfoI, const std::vector& tinyInfoD, const std::vector& tinyInfoS); +MEDCouplingFieldDouble::getArrays() const; +MEDCouplingFieldDouble::getEndArray() const; +MEDCouplingFieldDouble::getEndArray(); +MEDCouplingFieldDouble::getEndTime(int& iteration, int& order) const; +MEDCouplingFieldDouble::getHeapMemorySize() const; +MEDCouplingFieldDouble::getStartTime(int& iteration, int& order) const; +MEDCouplingFieldDouble::getTimeDiscretizationUnderGround() const; +MEDCouplingFieldDouble::getTimeDiscretizationUnderGround(); +MEDCouplingFieldDouble::getTinySerializationDbleInformation(std::vector& tinyInfo) const; +MEDCouplingFieldDouble::getTinySerializationIntInformation(std::vector& tinyInfo) const; +MEDCouplingFieldDouble::getTinySerializationStrInformation(std::vector& tinyInfo) const; +MEDCouplingFieldDouble::isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec, std::string& reason) const; +MEDCouplingFieldDouble::reprQuickOverview(std::ostream& stream) const; +MEDCouplingFieldDouble::resizeForUnserialization(const std::vector& tinyInfoI, DataArrayInt *&dataInt, std::vector& arrays); +MEDCouplingFieldDouble::serialize(DataArrayInt *&dataInt, std::vector& arrays) const; +MEDCouplingFieldDouble::setEndOrder(int order); +MEDCouplingFieldDouble::setEndTime(double val, int iteration, int order); +MEDCouplingFieldDouble::setEndTimeValue(double val); +MEDCouplingFieldDouble::setStartTime(double val, int iteration, int order); +MEDCouplingFieldDouble::synchronizeTimeWithMesh(); +MEDCouplingFieldDouble::synchronizeTimeWithSupport(); +MEDCouplingFieldDouble::~MEDCouplingFieldDouble(); +MEDCouplingFieldDouble::_time_discr; +///@} +} diff --git a/doc/doxygen/medcouplingexamples.doxy b/doc/doxygen/medcouplingexamples.doxy index dfaba4afb..04dbb00f2 100644 --- a/doc/doxygen/medcouplingexamples.doxy +++ b/doc/doxygen/medcouplingexamples.doxy @@ -2,14 +2,421 @@ \page medcouplingcppexamples MEDCoupling C++ examples +\anchor cpp_mcfielddouble_WriteVTK +

Writting fields in a VTK file

-\anchor cpp_mcmesh_ -

+In this example we +- create an 2D mesh and 3 fields on it, +- use +\ref ParaMEDMEM::MEDCouplingFieldDouble::WriteVTK "WriteVTK()" +to write all the fields and the mesh to a VTK file. + +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_WriteVTK_1 + + + +\anchor cpp_mcfielddouble_MaxFields +

Getting maximal and minimal fields

+ +In this example we +- create two fields with two tuples per two components, +- use +\ref ParaMEDMEM::MEDCouplingFieldDouble::MaxFields "MaxFields()" +to get a field holding maximal values of the two fields. +- use +\ref ParaMEDMEM::MEDCouplingFieldDouble::MinFields "MinFields()" +to get a field holding minimal values of the two fields. + +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_MaxFields_1 + + +\anchor cpp_mcfielddouble_MergeFields +

Concatenating fields

+ +In this example we +- create an 1D mesh and a field on it, +- make a deep copy of the mesh and the field, +- translate the mesh and the field, +- use two variants of +\ref ParaMEDMEM::MEDCouplingFieldDouble::MergeFields "MergeFields()" +to create one field from the two by concatenating them and their meshes. + +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_MergeFields_1 +The result field is twice "longer" than \b field1. + + + +\anchor cpp_mcfielddouble_substractInPlaceDM +

Subtracting field on different meshs

+ +We make two meshes in 1D space with no cells and 4 nodes. Nodes #0 and #2 are swapped +in the two meshes.
+And we make two fields on these meshes, so that fields values to equal to node +coordinates of the underlying meshes. +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_substractInPlaceDM_1 +We are going to subtract \b field2 from \b field1, though they are on +different meshes. +\ref ParaMEDMEM::MEDCouplingFieldDouble::substractInPlaceDM "substractInPlaceDM()" +allows us doing this. We use a mesh comparison level \b levOfCheck = 10 that allows +subtracting fields on meshes with different node arrays.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_substractInPlaceDM_2 +After applying +\ref ParaMEDMEM::MEDCouplingFieldDouble::substractInPlaceDM "substractInPlaceDM()" +the both fields lie on \b mesh2. As +\ref ParaMEDMEM::MEDCouplingFieldDouble::substractInPlaceDM "substractInPlaceDM()" +permutes values of \b field1 before value subtraction, and thus \b field1 becomes +equal to \b feild2, hence their subtraction results in a zero field. +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_substractInPlaceDM_3 + + + +\anchor cpp_mcfielddouble_changeUnderlyingMesh +

Changing the underlying mesh

+ +We make two meshes in 1D space with no cells and 4 nodes. Nodes #0 and #2 are swapped +in the two meshes. +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_changeUnderlyingMesh_1 +We are going to use +\ref ParaMEDMEM::MEDCouplingFieldDouble::changeUnderlyingMesh "changeUnderlyingMesh()" +to set \b mesh2 instead of \b mesh1 as a support of a field.
+We use +\ref ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic "fillFromAnalytic()" +to make a field on nodes of \b mesh1, so that its values to equal to node coordinates. +Then we use +\ref ParaMEDMEM::MEDCouplingFieldDouble::changeUnderlyingMesh "changeUnderlyingMesh()" +to change the underlying mesh of the \b field. +(We use a mesh comparison level \b levOfCheck = 10 that allows substituting meshes with +different node arrays.) As a result, we expect that values of the \b field are also +permuted same as nodes of the two meshes, and thus its values become equal to the +array \b coords2. +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_changeUnderlyingMesh_2 + + +\anchor cpp_mcfielddouble_applyFunc_same_nb_comp +

Changing a field using a formular

+ +We create a 2D vector field with 2 tuples and we want to transform this +field using a formular using +\ref ParaMEDMEM::MEDCouplingFieldDouble::applyFunc(const char *func) "applyFunc()". +The formular \b func is applied each atomic value of the \b field. We want to change +the \b field as follows. (In \b func, we use the variable "v" to refer to an atomic field value). +- Component #0 = component #0 (remains the same); hence "IVec * v" in \b func. +- Component #1 = component #1 ^ 2; hence "JVec * v*v". + +In addition we want to add 10.0 to each component computed as described above, hence +"10" in \b func. +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_applyFunc_same_nb_comp_1 +Now we ascertain that the result field is as we expect. +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_applyFunc_same_nb_comp_2 + + + +\anchor cpp_mcfielddouble_applyFunc3 +

Changing a field using a formular

+ +We create a 2D vector field with 2 values (vectors) and then we transform this +field into a 3D vector field by applying a formular to values of the 2D field +using +\ref ParaMEDMEM::MEDCouplingFieldDouble::applyFunc3() "applyFunc3()". +The formular \b func is applied to components of each vector of the \b field. We want +the \b field to have 3 components computed as follows. (In \b func, we refer to the +first component of a field value using the variable "a", and to the second component, using +the variable "b", as we define it by \b varNamesVec). +- Component #0 = the second vector component; hence "IVec * b" in \b func. +- Component #1 = the first vector component; hence "JVec * a". +- Component #2 = a vector magnitude; hence "KVec * sqrt( a*a + b*b )". + +In addition we want to add 10.0 to each component computed as described above, hence +"10" in \b func. +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_applyFunc3_1 +Now we ascertain that the result field is as we expect. We check the second vector of +the \b field. +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_applyFunc3_2 + + + +\anchor cpp_mcfielddouble_applyFunc2 +

Changing a field using a formular

+ +We create a 2D vector field with 2 values (vectors) and then we transform this +field into a 3D vector field by applying a formular to values of the 2D field +using +\ref ParaMEDMEM::MEDCouplingFieldDouble::applyFunc2(int nbOfComp, const char *func) "applyFunc2()". +Note that we set component info the \b array ("a" and "b" ) which will be used to refer to +corresponding components within a function. +The formular \b func is applied to components of each vector of the \b field. We want +the \b field to have 3 components computed as follows. (In \b func, we refer to the +first component of a field value using the variable "a", and to the second component, using +the variable "b"). +- Component #0 = the second vector component; hence "IVec * b" in \b func. +- Component #1 = the first vector component; hence "JVec * a". +- Component #2 = a vector magnitude; hence "KVec * sqrt( a*a + b*b )". + +In addition we want to add 10.0 to each component computed as described above, hence +"10" in \b func. +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_applyFunc2_1 +Now we ascertain that the result field is as we expect. We check the second vector of +the \b field. +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_applyFunc2_2 + + + +\anchor cpp_mcfielddouble_applyFunc +

Changing a field using a formular

+ +We create a 2D vector field with 2 values (vectors) and then we transform this +field into a 3D vector field by applying a formular to values of the 2D field +using +\ref ParaMEDMEM::MEDCouplingFieldDouble::applyFunc(int nbOfComp, const char *func) "applyFunc()". +The formular \b func is applied to components of each vector of the \b field. We want +the \b field to have 3 components computed as follows. (In \b func, we refer to the +first component of a field value using the variable "a", and to the second component, using +the variable "b"). +- Component #0 = the second vector component; hence "IVec * b" in \b func. +- Component #1 = the first vector component; hence "JVec * a". +- Component #2 = a vector magnitude; hence "KVec * sqrt( a*a + b*b )". + +In addition we want to add 10.0 to each component computed as described above, hence +"10" in \b func. +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_applyFunc_1 +Now we ascertain that the result field is as we expect. We check the second vector of +the \b field. +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_applyFunc_2 + + + +\anchor cpp_mcfielddouble_applyFunc_val +

Filling a field with a value

+ +We want to transform a 2D vector field to a 3D vector field so that all values to be +equal to a certain value. First, we create the 2D mesh and the vector field on it. +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_applyFunc_val_1 +Finally we use +\ref ParaMEDMEM::MEDCouplingFieldDouble::applyFunc(int nbOfComp, double val) "applyFunc()" +to change the number of components and all field values. +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_applyFunc_val_2 +As a result, number of tuples in the field equals to the number of cells in the mesh, +and number of components becomes equal to 3 as required. + + +\anchor cpp_mcfielddouble_fillFromAnalytic3 +

Filling a field using a formular

+ +First, we create a 2D Cartesian mesh constituted by 2 cells. +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_fillFromAnalytic3_1 +Now we create a field on cells and use +\ref ParaMEDMEM::MEDCouplingFieldDouble::fillFromAnalytic2 "fillFromAnalytic2()" +to fill it +with values computed using a formular \b func. This formular is applied to coordinates of +each point (barycenter) for which the field value is computed. We want the \b field +to have 3 components computed as follows. (In \b func, we refer to the +first component of a point using the variable "a", and to the second component, using +the variable "b"). +- Component #0 = the second coordinate of the point; hence "IVec * b" in \b func. +- Component #1 = the first coordinate of the point; hence "JVec * a". +- Component #2 = distance between the point and SC origin (0.,0.); hence +"KVec * sqrt( a*a + b*b )". + +In addition we want to add 10.0 to each component computed as described above, hence +"10" in \b func. +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_fillFromAnalytic3_2 +Now we ascertain that the result field is as we expect. We check the second tuple of +the \b field. We get barycenter of the cell #1 and checks that values of the second +tuple are computed as we want. +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_fillFromAnalytic3_3 -First, we create a 2D mesh with 3 QUAD4 and 2 TRI3 cells. -\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_ -\snippet MEDCouplingExamplesTest.py PySnippet_MEDCouplingUMesh_ -\snippet MEDCouplingExamplesTest.py Snippet_MEDCouplingUMesh_ + + +\anchor cpp_mcfielddouble_fillFromAnalytic2 +

Filling a field using a formular

+ +First, we create a 2D Cartesian mesh constituted by 2 cells. +Note that we set names to coordinates arrays ("a" and "b" ) which will be used to refer to +corresponding coordinates within a function. +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_fillFromAnalytic2_1 +Now we create a field on cells and use +\ref ParaMEDMEM::MEDCouplingFieldDouble::fillFromAnalytic2 "fillFromAnalytic2()" +to fill it +with values computed using a formular \b func. This formular is applied to coordinates of +each point (barycenter) for which the field value is computed. We want the \b field +to have 3 components computed as follows. (In \b func, we refer to the +first component of a point using the variable "a", and to the second component, using +the variable "b"). +- Component #0 = the second coordinate of the point; hence "IVec * b" in \b func. +- Component #1 = the first coordinate of the point; hence "JVec * a". +- Component #2 = distance between the point and SC origin (0.,0.); hence +"KVec * sqrt( a*a + b*b )". + +In addition we want to add 10.0 to each component computed as described above, hence +"10" in \b func. +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_fillFromAnalytic2_2 +Now we ascertain that the result field is as we expect. We check the second tuple of +the \b field. We get barycenter of the cell #1 and checks that values of the second +tuple are computed as we want. +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_fillFromAnalytic2_3 + + +\anchor cpp_mcfielddouble_fillFromAnalytic +

Filling a field using a formular

+ +First, we create a 2D Cartesian mesh constituted by 2 cells. +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_fillFromAnalytic_1 +Now we create a field on cells and use +\ref ParaMEDMEM::MEDCouplingFieldDouble::fillFromAnalytic(int nbOfComp, const char *func) "fillFromAnalytic()" +to fill it +with values computed using a formular \b func. This formular is applied to coordinates of +each point (barycenter) for which the field value is computed. We want the \b field to have + 3 components computed as follows. (In \b func, we refer to the +first component of a point using the variable "a", and to the second component, using +the variable "b"). +- Component #0 = the second coordinate of the point; hence "IVec * b" in \b func. +- Component #1 = the first coordinate of the point; hence "JVec * a". +- Component #2 = distance between the point and SC origin (0.,0.); hence +"KVec * sqrt( a*a + b*b )". + +In addition we want to add 10.0 to each component computed as described above, hence +"10" in \b func. +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_fillFromAnalytic_2 +Now we ascertain that the result field is as we expect. We check the second tuple of +the \b field. We get barycenter of the cell #1 to check that values of the second +tuple (#1) are computed as we want. +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_fillFromAnalytic_3 + + +\anchor cpp_mcfielddouble_getValueOn_time +

Getting a field value at some point at certain time

+ +First, we create a supporting structured mesh. We create a 2x2 Cartesian mesh +constituted by 4 cells. +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_getValueOn_time_1 +Then we create a scalar field on cells, whose values vary linearly in time. +We set all field values at a start time to be equal 10.0 using +\ref ParaMEDMEM::MEDCouplingFieldDouble::fillFromAnalytic "fillFromAnalytic()". +And we set all field values at an end time to be equal 20.0 by doubling the start +time array. +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_getValueOn_time_2 +Now, we want to get a field value at a point [0,0] at a middle time between the start +and end times. We expect the returned value to be equal to an average of 10. and 20. +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_getValueOn_time_3 + + +\anchor cpp_mcfielddouble_getValueOnMulti +

Getting field values at some points

+ +First, we create a supporting structured mesh. We create a 2x2 Cartesian mesh +constituted by 4 cells. Then we create a scalar field on cells using +\ref ParaMEDMEM::MEDCouplingFieldDouble::fillFromAnalytic "fillFromAnalytic()". +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_getValueOnMulti_1 +Now, we want to retrieve all field values using +\ref ParaMEDMEM::MEDCouplingFieldDouble::getValueOnMulti "getValueOnMulti()". +The field values relate to cells, hence we will use cell barycenters as a parameter of +\ref ParaMEDMEM::MEDCouplingFieldDouble::getValueOnMulti "getValueOnMulti()". +We expect that the double array returned +\ref ParaMEDMEM::MEDCouplingFieldDouble::getValueOnMulti "getValueOnMulti()" +is equal to that stored by \b field. +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_getValueOnMulti_2 + + + +\anchor cpp_mcfielddouble_getValueOn +

Getting a field value at a point

+ +First, we create a supporting structured mesh. We create a 2x2 Cartesian mesh +constituted by 4 cells. Then we create a scalar field on cells using +\ref ParaMEDMEM::MEDCouplingFieldDouble::fillFromAnalytic "fillFromAnalytic()". +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_getValueOn_1 +Now, we want to retrieve all field values using +\ref ParaMEDMEM::MEDCouplingFieldDouble::getValueOn "getValueOn()". +The field values relate to cells, hence we will use cell barycenters to get a field +value at each cell. +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_getValueOn_2 +We collected all values returned by +\ref ParaMEDMEM::MEDCouplingFieldDouble::getValueOn "getValueOn()" in an array, so +that we can ascertain that the array of returned values is same as that stored by \b +field. + + + +\anchor cpp_mcfielddouble_getValueOnPos +

Getting a value of field lying on a structured mesh

+ +First, we create a supporting structured mesh. We create a 2x2 Cartesian mesh +constituted by 4 cells. Then we create a scalar field on cells using +\ref ParaMEDMEM::MEDCouplingFieldDouble::fillFromAnalytic "fillFromAnalytic()". +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_getValueOnPos_1 +Now, we retrieve a field value relating to the cell #3 (this cell has a structured indexed +(1,1)). For that we use +\ref ParaMEDMEM::MEDCouplingFieldDouble::getValueOnPos "getValueOnPos()" where we +pass the structured indexed of the cell: 1,1,-1 (the last index is meaningless as the +mesh is 2D). +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_getValueOnPos_2 +After all we ascertain that the returned value corresponds to the formular used for +the field creation. Namely that the value equals to the sum of components of +barycenter of cell #3. + + + +\anchor cpp_mcfielddouble_renumberNodes +

Permuting a field on nodes

+ +First, we create a supporting 2D mesh constituted by 4 cells. We create a 2x2 +Cartesian mesh and then convert it to an unstructured one, since the Cartesian mesh +is not suitable for +\ref ParaMEDMEM::MEDCouplingFieldDouble::renumberNodes "renumberNodes()" as its + nature does not imply node renumbering. +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_renumberNodes_1 +Then we create a field on nodes using +\ref ParaMEDMEM::MEDCouplingFieldDouble::fillFromAnalytic "fillFromAnalytic()", +such that its values to coincide with coordinates of field location points that are + nodes in our case (as our field is \ref ParaMEDMEM::ON_NODES "ON_NODES"). +At last we ascertain that field values are equal to node coordinates. +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_renumberNodes_2 +Now, we are going to reverse order of nodes using +\ref ParaMEDMEM::MEDCouplingFieldDouble::renumberNodes "renumberNodes()". +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_renumberNodes_3 +As a result, the underlying mesh of \b field is changed and its nodes are also + renumbered. +And the field values are still equal to node coordinates of the renumbered \b mesh2. + + + +\anchor cpp_mcfielddouble_renumberCells +

Permuting a field on cells

+ +First, we create a supporting 2D mesh constituted by 4 cells. We create a 2x2 +Cartesian mesh and then convert it to an unstructured one, since the Cartesian mesh +is not suitable for +\ref ParaMEDMEM::MEDCouplingFieldDouble::renumberCells "renumberCells()" as its + nature does not imply cell renumbering. +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_renumberCells_1 +Then we create a field on cells using +\ref ParaMEDMEM::MEDCouplingFieldDouble::fillFromAnalytic "fillFromAnalytic()", +such that its values to coincide with coordinates of field location points that are + cell barycenters in our case (as our field is \ref ParaMEDMEM::ON_CELLS "ON_CELLS"). +At last we ascertain that field values are equal to cell barycenters. +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_renumberCells_2 +Now, we are going to reverse order of cells using +\ref ParaMEDMEM::MEDCouplingFieldDouble::renumberCells "renumberCells()". +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_renumberCells_3 +As a result, the underlying mesh of \b field is changed and its cells are also + renumbered. +And the field values are still equal to cell barycenters of the renumbered \b mesh2. + + + +\anchor cpp_mcfielddouble_buildNewTimeReprFromThis +

Getting a field copy with different time discretization

+ +First, we create a supporting 2D mesh and a field on it got using +\ref ParaMEDMEM::MEDCouplingFieldDouble::fillFromAnalytic "fillFromAnalytic()". +\ref MEDCouplingTemporalDisc "Time discretization" of this field is +\ref ParaMEDMEM::ONE_TIME "ONE_TIME". +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_buildNewTimeReprFromThis_1 +Now we use +\ref ParaMEDMEM::MEDCouplingFieldDouble::buildNewTimeReprFromThis "buildNewTimeReprFromThis()" +to get a copy of \b field1 whose time discretization is +\ref ParaMEDMEM::NO_TIME "NO_TIME". +\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_buildNewTimeReprFromThis_2 \anchor cpp_mcmesh_fillFromAnalytic3 @@ -1398,7 +1805,6 @@ components of \b a1. Now each tuple of \b a2 includes components named "b","c","b","c","a","a". Thus the result array \b a2 includes 30 elements (5 tuples per 6 components). -\anchor cpp_mcfielddouble_subpart1 \anchor cpp_mcdataarrayint_keepselectedcomponents diff --git a/doc/salome/tui/static/footer.html b/doc/salome/tui/static/footer.html index 4137de2f0..5a56e23a2 100755 --- a/doc/salome/tui/static/footer.html +++ b/doc/salome/tui/static/footer.html @@ -1,14 +1,14 @@ - - -