Salome HOME
Ensure sequential run of MEDLoader 1,2,3 tests.
[tools/medcoupling.git] / src / MEDCoupling / MEDCouplingField.cxx
index cd635943b41884f155ca2c041410ec26dccdae78..19843a35ef7a61eea01ef448231a61e8a1a53ae6 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <sstream>
 
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
 
 bool MEDCouplingField::isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec, std::string& reason) const
 {
@@ -145,6 +145,21 @@ bool MEDCouplingField::areStrictlyCompatible(const MEDCouplingField *other) cons
   return _mesh==other->_mesh;
 }
 
+/*!
+ * This method is less strict than MEDCouplingField::areStrictlyCompatible method.
+ * The difference is that the nature is not checked.
+ * This method is used for multiplication and division on fields to operate a first check before attempting operation.
+ */
+bool MEDCouplingField::areStrictlyCompatibleForMulDiv(const MEDCouplingField *other) const
+{
+  if(!other)
+    throw INTERP_KERNEL::Exception("MEDCouplingField::areStrictlyCompatible : input field is NULL !");
+  if(!_type->isEqual(other->_type,1.e-12))
+    return false;
+  return _mesh==other->_mesh;
+}
+
+
 void MEDCouplingField::updateTime() const
 {
   if(_mesh)
@@ -171,8 +186,8 @@ std::vector<const BigMemoryObject *> MEDCouplingField::getDirectChildrenWithNull
 
 /*!
  * Returns a type of \ref MEDCouplingSpatialDisc "spatial discretization" of \a this
- * field in terms of enum ParaMEDMEM::TypeOfField. 
- * \return ParaMEDMEM::TypeOfField - the type of \a this field.
+ * field in terms of enum MEDCoupling::TypeOfField. 
+ * \return MEDCoupling::TypeOfField - the type of \a this field.
  * \throw If the geometric type is empty.
  */
 TypeOfField MEDCouplingField::getTypeOfField() const
@@ -184,7 +199,7 @@ TypeOfField MEDCouplingField::getTypeOfField() const
 
 /*!
  * Returns the nature of \a this field. This information is very important during
- * interpolation process using ParaMEDMEM::MEDCouplingRemapper or ParaMEDMEM::InterpKernelDEC.
+ * interpolation process using MEDCoupling::MEDCouplingRemapper or MEDCoupling::InterpKernelDEC.
  * In other context than the two mentioned above, this attribute is unimportant. This
  * attribute is not stored in the MED file.
  * For more information of the semantics and the influence of this attribute to the
@@ -199,7 +214,7 @@ NatureOfField MEDCouplingField::getNature() const
 
 /*!
  * Sets the nature of \a this field. This information is very important during
- * interpolation process using ParaMEDMEM::MEDCouplingRemapper or ParaMEDMEM::InterpKernelDEC.
+ * interpolation process using MEDCoupling::MEDCouplingRemapper or MEDCoupling::InterpKernelDEC.
  * In other context than the two mentioned above, this attribute is unimportant. This
  * attribute is not stored in the MED file.
  * For more information of the semantics and the influence of this attribute to the
@@ -351,7 +366,8 @@ void MEDCouplingField::clearGaussLocalizations()
  *          problem.
  *  \param [in] locId - the id of the Gauss localization object of interest.
  *         It must be in range <em> 0 <= locId < getNbOfGaussLocalization() </em>.
- *  \return \ref MEDCouplingGaussLocalization & - the Gauss localization object.
+ *  \return \ref MEDCoupling::MEDCouplingGaussLocalization "MEDCouplingGaussLocalization" & - the
+ *  Gauss localization object.
  *  \throw If \a this field is not on Gauss points.
  *  \throw If \a locId is not within the valid range.
  *  \throw If the spatial discretization of \a this field is NULL.
@@ -445,7 +461,7 @@ void MEDCouplingField::getCellIdsHavingGaussLocalization(int locId, std::vector<
  * \warning This method is const, so the returned object is not apt for modification.
  *  \param [in] locId - the id of the Gauss localization object of interest.
  *         It must be in range <em> 0 <= locId < getNbOfGaussLocalization() </em>.
- *  \return \ref const MEDCouplingGaussLocalization & - the Gauss localization object.
+ *  \return const \ref MEDCouplingGaussLocalization & - the Gauss localization object.
  *  \throw If \a this field is not on Gauss points.
  *  \throw If \a locId is not within the valid range.
  *  \throw If the spatial discretization of \a this field is NULL.
@@ -487,7 +503,7 @@ MEDCouplingField::MEDCouplingField(const MEDCouplingField& other, bool deepCopy)
 
 /*!
  * Returns a new MEDCouplingMesh constituted by some cells of the underlying mesh of \a
- * this filed, and returns ids of entities (nodes, cells, Gauss points) lying on the 
+ * this field, and returns ids of entities (nodes, cells, Gauss points) lying on the
  * specified cells. The cells to include to the result mesh are specified by an array of
  * cell ids. The new mesh shares the coordinates array with the underlying mesh. 
  *  \param [in] start - an array of cell ids to include to the result mesh.