+ if(*iter)
+ {
+ newArr2[i]=(*iter)->selectByTupleIdSafe(cellIds->begin(),cellIds->end());
+ newArr[i]=newArr2[i];
+ }
+ }
+ ret->setArrays(newArr);
+ return ret.retn();
+}
+
+/*!
+ * Divides every cell of the underlying mesh into simplices (triangles in 2D and
+ * tetrahedra in 3D). If some cells are divided, the underlying mesh is replaced by a new
+ * mesh instance containing the simplices.<br>
+ * \param [in] policy - specifies a pattern used for splitting. For its description, see
+ * MEDCouplingUMesh::simplexize().
+ * \return bool - \c true if some cells have been divided and hence \a this field lies
+ * on another mesh.
+ * \throw If \a policy has an invalid value. For valid values, see the description of
+ * MEDCouplingUMesh::simplexize().
+ * \throw If MEDCouplingMesh::simplexize() is not applicable to the underlying mesh.
+ * \throw If the mesh is not well defined.
+ * \throw If the spatial discretization of \a this field is NULL.
+ * \throw If the data array is not set.
+ */
+bool MEDCouplingFieldDouble::simplexize(int policy)
+{
+ if(!_mesh)
+ throw INTERP_KERNEL::Exception("No underlying mesh on this field to perform simplexize !");
+ if(!((const MEDCouplingFieldDiscretization *)_type))
+ throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform simplexize !");
+ int oldNbOfCells=_mesh->getNumberOfCells();
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> meshC2(_mesh->deepCpy());
+ MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arr=meshC2->simplexize(policy);
+ int newNbOfCells=meshC2->getNumberOfCells();
+ if(oldNbOfCells==newNbOfCells)
+ return false;
+ std::vector<DataArrayDouble *> arrays;
+ _time_discr->getArrays(arrays);
+ for(std::vector<DataArrayDouble *>::const_iterator iter=arrays.begin();iter!=arrays.end();iter++)
+ if(*iter)
+ _type->renumberValuesOnCellsR(_mesh,arr->getConstPointer(),arr->getNbOfElems(),*iter);
+ setMesh(meshC2);
+ return true;
+}
+
+/*!
+ * Creates a new MEDCouplingFieldDouble filled with the doubly contracted product of
+ * every tensor of \a this 6-componental field.
+ * \return MEDCouplingFieldDouble * - the new instance of MEDCouplingFieldDouble, whose
+ * each tuple is calculated from the tuple <em>(t)</em> of \a this field as
+ * follows: \f$ t[0]^2+t[1]^2+t[2]^2+2*t[3]^2+2*t[4]^2+2*t[5]^2\f$.
+ * This new field lies on the same mesh as \a this one. The caller is to delete
+ * this field using decrRef() as it is no more needed.
+ * \throw If \a this->getNumberOfComponents() != 6.
+ * \throw If the spatial discretization of \a this field is NULL.
+ */
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::doublyContractedProduct() const
+{
+ if(!((const MEDCouplingFieldDiscretization *)_type))
+ throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform doublyContractedProduct !");
+ MEDCouplingTimeDiscretization *td=_time_discr->doublyContractedProduct();
+ td->copyTinyAttrFrom(*_time_discr);
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),td,_type->clone());
+ ret->setName("DoublyContractedProduct");
+ ret->setMesh(getMesh());
+ return ret.retn();
+}
+
+/*!
+ * Creates a new MEDCouplingFieldDouble filled with the determinant of a square
+ * matrix defined by every tuple of \a this field, having either 4, 6 or 9 components.
+ * The case of 6 components corresponds to that of the upper triangular matrix.
+ * \return MEDCouplingFieldDouble * - the new instance of MEDCouplingFieldDouble, whose
+ * each tuple is the determinant of matrix of the corresponding tuple of \a this
+ * field. This new field lies on the same mesh as \a this one. The caller is to
+ * delete this field using decrRef() as it is no more needed.
+ * \throw If \a this->getNumberOfComponents() is not in [4,6,9].
+ * \throw If the spatial discretization of \a this field is NULL.
+ */
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::determinant() const
+{
+ if(!((const MEDCouplingFieldDiscretization *)_type))
+ throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform determinant !");
+ MEDCouplingTimeDiscretization *td=_time_discr->determinant();
+ td->copyTinyAttrFrom(*_time_discr);
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),td,_type->clone());
+ ret->setName("Determinant");
+ ret->setMesh(getMesh());
+ return ret.retn();
+}
+
+
+/*!
+ * Creates a new MEDCouplingFieldDouble with 3 components filled with 3 eigenvalues of
+ * an upper triangular matrix defined by every tuple of \a this 6-componental field.
+ * \return MEDCouplingFieldDouble * - the new instance of MEDCouplingFieldDouble,
+ * having 3 components, whose each tuple contains the eigenvalues of the matrix of
+ * corresponding tuple of \a this field. This new field lies on the same mesh as
+ * \a this one. The caller is to delete this field using decrRef() as it is no
+ * more needed.
+ * \throw If \a this->getNumberOfComponents() != 6.
+ * \throw If the spatial discretization of \a this field is NULL.
+ */
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::eigenValues() const
+{
+ if(!((const MEDCouplingFieldDiscretization *)_type))
+ throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform eigenValues !");
+ MEDCouplingTimeDiscretization *td=_time_discr->eigenValues();
+ td->copyTinyAttrFrom(*_time_discr);
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),td,_type->clone());
+ ret->setName("EigenValues");
+ ret->setMesh(getMesh());
+ return ret.retn();
+}
+
+/*!
+ * Creates a new MEDCouplingFieldDouble with 9 components filled with 3 eigenvectors of
+ * an upper triangular matrix defined by every tuple of \a this 6-componental field.
+ * \return MEDCouplingFieldDouble * - the new instance of MEDCouplingFieldDouble,
+ * having 9 components, whose each tuple contains the eigenvectors of the matrix of
+ * corresponding tuple of \a this field. This new field lies on the same mesh as
+ * \a this one. The caller is to delete this field using decrRef() as it is no
+ * more needed.
+ * \throw If \a this->getNumberOfComponents() != 6.
+ * \throw If the spatial discretization of \a this field is NULL.
+ */
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::eigenVectors() const
+{
+ if(!((const MEDCouplingFieldDiscretization *)_type))
+ throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform eigenVectors !");
+ MEDCouplingTimeDiscretization *td=_time_discr->eigenVectors();
+ td->copyTinyAttrFrom(*_time_discr);
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),td,_type->clone());
+ ret->setName("EigenVectors");
+ ret->setMesh(getMesh());
+ return ret.retn();
+}
+
+/*!
+ * Creates a new MEDCouplingFieldDouble filled with the inverse matrix of
+ * a matrix defined by every tuple of \a this field having either 4, 6 or 9
+ * components. The case of 6 components corresponds to that of the upper triangular
+ * matrix.
+ * \return MEDCouplingFieldDouble * - the new instance of MEDCouplingFieldDouble,
+ * having the same number of components as \a this one, whose each tuple
+ * contains the inverse matrix of the matrix of corresponding tuple of \a this
+ * field. This new field lies on the same mesh as \a this one. The caller is to
+ * delete this field using decrRef() as it is no more needed.
+ * \throw If \a this->getNumberOfComponents() is not in [4,6,9].
+ * \throw If the spatial discretization of \a this field is NULL.
+ */
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::inverse() const
+{
+ if(!((const MEDCouplingFieldDiscretization *)_type))
+ throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform inverse !");
+ MEDCouplingTimeDiscretization *td=_time_discr->inverse();
+ td->copyTinyAttrFrom(*_time_discr);
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),td,_type->clone());
+ ret->setName("Inversion");
+ ret->setMesh(getMesh());
+ return ret.retn();
+}
+
+/*!
+ * Creates a new MEDCouplingFieldDouble filled with the trace of
+ * a matrix defined by every tuple of \a this field having either 4, 6 or 9
+ * components. The case of 6 components corresponds to that of the upper triangular
+ * matrix.
+ * \return MEDCouplingFieldDouble * - the new instance of MEDCouplingFieldDouble,
+ * having 1 component, whose each tuple is the trace of the matrix of
+ * corresponding tuple of \a this field.
+ * This new field lies on the same mesh as \a this one. The caller is to
+ * delete this field using decrRef() as it is no more needed.
+ * \throw If \a this->getNumberOfComponents() is not in [4,6,9].
+ * \throw If the spatial discretization of \a this field is NULL.
+ */
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::trace() const
+{
+ if(!((const MEDCouplingFieldDiscretization *)_type))
+ throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform trace !");
+ MEDCouplingTimeDiscretization *td=_time_discr->trace();
+ td->copyTinyAttrFrom(*_time_discr);
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),td,_type->clone());
+ ret->setName("Trace");
+ ret->setMesh(getMesh());
+ return ret.retn();
+}
+
+/*!
+ * Creates a new MEDCouplingFieldDouble filled with the stress deviator tensor of
+ * a stress tensor defined by every tuple of \a this 6-componental field.
+ * \return MEDCouplingFieldDouble * - the new instance of MEDCouplingFieldDouble,
+ * having same number of components and tuples as \a this field,
+ * whose each tuple contains the stress deviator tensor of the stress tensor of
+ * corresponding tuple of \a this field. This new field lies on the same mesh as
+ * \a this one. The caller is to delete this field using decrRef() as it is no
+ * more needed.
+ * \throw If \a this->getNumberOfComponents() != 6.
+ * \throw If the spatial discretization of \a this field is NULL.
+ */
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::deviator() const
+{
+ if(!((const MEDCouplingFieldDiscretization *)_type))
+ throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform deviator !");
+ MEDCouplingTimeDiscretization *td=_time_discr->deviator();
+ td->copyTinyAttrFrom(*_time_discr);
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),td,_type->clone());
+ ret->setName("Deviator");
+ ret->setMesh(getMesh());
+ return ret.retn();
+}
+
+/*!
+ * Creates a new MEDCouplingFieldDouble filled with the magnitude of
+ * every vector of \a this field.
+ * \return MEDCouplingFieldDouble * - the new instance of MEDCouplingFieldDouble,
+ * having one component, whose each tuple is the magnitude of the vector
+ * of corresponding tuple of \a this field. This new field lies on the
+ * same mesh as \a this one. The caller is to
+ * delete this field using decrRef() as it is no more needed.
+ * \throw If the spatial discretization of \a this field is NULL.
+ */
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::magnitude() const
+{
+ if(!((const MEDCouplingFieldDiscretization *)_type))
+ throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform magnitude !");
+ MEDCouplingTimeDiscretization *td=_time_discr->magnitude();
+ td->copyTinyAttrFrom(*_time_discr);
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),td,_type->clone());
+ ret->setName("Magnitude");
+ ret->setMesh(getMesh());
+ return ret.retn();
+}
+
+/*!
+ * Creates a new scalar MEDCouplingFieldDouble filled with the maximal value among
+ * values of every tuple of \a this field.
+ * \return MEDCouplingFieldDouble * - the new instance of MEDCouplingFieldDouble.
+ * This new field lies on the same mesh as \a this one. The caller is to
+ * delete this field using decrRef() as it is no more needed.
+ * \throw If the spatial discretization of \a this field is NULL.
+ */
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::maxPerTuple() const
+{
+ if(!((const MEDCouplingFieldDiscretization *)_type))
+ throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform maxPerTuple !");
+ MEDCouplingTimeDiscretization *td=_time_discr->maxPerTuple();
+ td->copyTinyAttrFrom(*_time_discr);
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),td,_type->clone());
+ std::ostringstream oss;
+ oss << "Max_" << getName();
+ ret->setName(oss.str());
+ ret->setMesh(getMesh());
+ return ret.retn();
+}
+
+/*!
+ * Changes number of components in \a this field. If \a newNbOfComp is less
+ * than \a this->getNumberOfComponents() then each tuple
+ * is truncated to have \a newNbOfComp components, keeping first components. If \a
+ * newNbOfComp is more than \a this->getNumberOfComponents() then
+ * each tuple is populated with \a dftValue to have \a newNbOfComp components.
+ * \param [in] newNbOfComp - number of components for the new field to have.
+ * \param [in] dftValue - value assigned to new values added to \a this field.
+ * \throw If \a this is not allocated.
+ */
+void MEDCouplingFieldDouble::changeNbOfComponents(int newNbOfComp, double dftValue)
+{
+ _time_discr->changeNbOfComponents(newNbOfComp,dftValue);
+}
+
+/*!
+ * Creates a new MEDCouplingFieldDouble composed of selected components of \a this field.
+ * The new MEDCouplingFieldDouble has the same number of tuples but includes components
+ * specified by \a compoIds parameter. So that getNbOfElems() of the result field
+ * can be either less, same or more than \a this->getNumberOfValues().
+ * \param [in] compoIds - sequence of zero based indices of components to include
+ * into the new field.
+ * \return MEDCouplingFieldDouble * - the new instance of MEDCouplingFieldDouble that the caller
+ * is to delete using decrRef() as it is no more needed.
+ * \throw If a component index (\a i) is not valid:
+ * \a i < 0 || \a i >= \a this->getNumberOfComponents().
+ */
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::keepSelectedComponents(const std::vector<int>& compoIds) const
+{
+ if(!((const MEDCouplingFieldDiscretization *)_type))
+ throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform keepSelectedComponents !");
+ MEDCouplingTimeDiscretization *td=_time_discr->keepSelectedComponents(compoIds);
+ td->copyTinyAttrFrom(*_time_discr);
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),td,_type->clone());
+ ret->setName(getName());
+ ret->setMesh(getMesh());
+ return ret.retn();
+}
+
+
+/*!
+ * Copy all components in a specified order from another field.
+ * The number of tuples in \a this and the other field can be different.
+ * \param [in] f - the field to copy data from.
+ * \param [in] compoIds - sequence of zero based indices of components, data of which is
+ * to be copied.
+ * \throw If the two fields have different number of data arrays.
+ * \throw If a data array is set in one of fields and is not set in the other.
+ * \throw If \a compoIds.size() != \a a->getNumberOfComponents().
+ * \throw If \a compoIds[i] < 0 or \a compoIds[i] > \a this->getNumberOfComponents().
+ */
+void MEDCouplingFieldDouble::setSelectedComponents(const MEDCouplingFieldDouble *f, const std::vector<int>& compoIds)
+{
+ _time_discr->setSelectedComponents(f->_time_discr,compoIds);
+}
+
+/*!
+ * Sorts value within every tuple of \a this field.
+ * \param [in] asc - if \a true, the values are sorted in ascending order, else,
+ * in descending order.
+ * \throw If a data array is not allocated.
+ */
+void MEDCouplingFieldDouble::sortPerTuple(bool asc)
+{
+ _time_discr->sortPerTuple(asc);
+}
+
+/*!
+ * Creates a new MEDCouplingFieldDouble by concatenating two given fields.
+ * Values of
+ * the first field precede values of the second field within the result field.
+ * \param [in] f1 - the first field.
+ * \param [in] f2 - the second field.
+ * \return MEDCouplingFieldDouble * - the result field. It is a new instance of
+ * MEDCouplingFieldDouble. The caller is to delete this mesh using decrRef()
+ * as it is no more needed.
+ * \throw If the fields are not compatible for the merge.
+ * \throw If the spatial discretization of \a f1 is NULL.
+ * \throw If the time discretization of \a f1 is NULL.
+ *
+ * \ref cpp_mcfielddouble_MergeFields "Here is a C++ example".<br>
+ * \ref py_mcfielddouble_MergeFields "Here is a Python example".
+ */
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2)
+{
+ if(!f1->areCompatibleForMerge(f2))
+ throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply MergeFields on them !");
+ const MEDCouplingMesh *m1(f1->getMesh()),*m2(f2->getMesh());
+ if(!f1->_time_discr)
+ throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::MergeFields : no time discr of f1 !");
+ if(!f1->_type)
+ throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::MergeFields : no spatial discr of f1 !");
+ MEDCouplingTimeDiscretization *td=f1->_time_discr->aggregate(f2->_time_discr);
+ td->copyTinyAttrFrom(*f1->_time_discr);
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(f1->getNature(),td,f1->_type->clone());
+ ret->setName(f1->getName());
+ ret->setDescription(f1->getDescription());
+ if(m1)
+ {
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> m=m1->mergeMyselfWith(m2);
+ ret->setMesh(m);
+ }
+ return ret.retn();
+}
+
+/*!
+ * Creates a new MEDCouplingFieldDouble by concatenating all given fields.
+ * Values of the *i*-th field precede values of the (*i*+1)-th field within the result.
+ * If there is only one field in \a a, a deepCopy() (except time information of mesh and
+ * field) of the field is returned.
+ * Generally speaking the first field in \a a is used to assign tiny attributes of the
+ * returned field.
+ * \param [in] a - a vector of fields (MEDCouplingFieldDouble) to concatenate.
+ * \return MEDCouplingFieldDouble * - the result field. It is a new instance of
+ * MEDCouplingFieldDouble. The caller is to delete this mesh using decrRef()
+ * as it is no more needed.
+ * \throw If \a a is empty.
+ * \throw If the fields are not compatible for the merge.
+ *
+ * \ref cpp_mcfielddouble_MergeFields "Here is a C++ example".<br>
+ * \ref py_mcfielddouble_MergeFields "Here is a Python example".
+ */
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::MergeFields(const std::vector<const MEDCouplingFieldDouble *>& a)
+{
+ if(a.size()<1)
+ throw INTERP_KERNEL::Exception("FieldDouble::MergeFields : size of array must be >= 1 !");
+ std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> > ms(a.size());
+ std::vector< const MEDCouplingUMesh *> ms2(a.size());
+ std::vector< const MEDCouplingTimeDiscretization *> tds(a.size());
+ std::vector<const MEDCouplingFieldDouble *>::const_iterator it=a.begin();
+ const MEDCouplingFieldDouble *ref=(*it++);
+ if(!ref)
+ throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::MergeFields : presence of NULL instance in first place of input vector !");
+ for(;it!=a.end();it++)
+ if(!ref->areCompatibleForMerge(*it))
+ throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply MergeFields on them !");
+ for(int i=0;i<(int)a.size();i++)
+ {
+ if(a[i]->getMesh())
+ { ms[i]=a[i]->getMesh()->buildUnstructured(); ms2[i]=ms[i]; }
+ else
+ { ms[i]=0; ms2[i]=0; }
+ tds[i]=a[i]->_time_discr;
+ }
+ MEDCouplingTimeDiscretization *td=tds[0]->aggregate(tds);
+ td->copyTinyAttrFrom(*(a[0]->_time_discr));
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(a[0]->getNature(),td,a[0]->_type->clone());
+ ret->setName(a[0]->getName());
+ ret->setDescription(a[0]->getDescription());
+ if(ms2[0])
+ {
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m=MEDCouplingUMesh::MergeUMeshes(ms2);
+ m->copyTinyInfoFrom(ms2[0]);
+ ret->setMesh(m);
+ }
+ return ret.retn();
+}
+
+/*!
+ * Creates a new MEDCouplingFieldDouble by concatenating components of two given fields.
+ * The number of components in the result field is a sum of the number of components of
+ * given fields. The number of tuples in the result field is same as that of each of given
+ * arrays.
+ * Number of tuples in the given fields must be the same.
+ * \param [in] f1 - a field to include in the result field.
+ * \param [in] f2 - another field to include in the result 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 a meld (areCompatibleForMeld()).
+ * \throw If any of data arrays is not allocated.
+ * \throw If \a f1->getNumberOfTuples() != \a f2->getNumberOfTuples()
+ */
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2)
+{
+ if(!f1->areCompatibleForMeld(f2))
+ throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply MeldFields on them !");
+ MEDCouplingTimeDiscretization *td=f1->_time_discr->meld(f2->_time_discr);
+ td->copyTinyAttrFrom(*f1->_time_discr);
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(f1->getNature(),td,f1->_type->clone());
+ ret->setMesh(f1->getMesh());
+ return ret.retn();
+}
+
+/*!
+ * Returns a new MEDCouplingFieldDouble containing a dot product of two given fields,
+ * so that the i-th tuple of the result field is a sum of products of j-th components of
+ * i-th tuples of given fields (\f$ f_i = \sum_{j=1}^n f1_j * f2_j \f$).
+ * Number of tuples and components in the given fields must be the same.
+ * \param [in] f1 - a given field.
+ * \param [in] f2 - another given 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 either \a f1 or \a f2 is NULL.
+ * \throw If the fields are not strictly compatible (areStrictlyCompatible()), i.e. they
+ * differ not only in values.
+ */
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2)
+{
+ if(!f1)
+ throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::DotFields : input field is NULL !");
+ if(!f1->areStrictlyCompatible(f2))
+ throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply DotFields on them !");
+ MEDCouplingTimeDiscretization *td=f1->_time_discr->dot(f2->_time_discr);
+ td->copyTinyAttrFrom(*f1->_time_discr);
+ MEDCouplingFieldDouble *ret=new MEDCouplingFieldDouble(f1->getNature(),td,f1->_type->clone());
+ ret->setMesh(f1->getMesh());
+ return ret;
+}
+
+/*!
+ * Returns a new MEDCouplingFieldDouble containing a cross product of two given fields,
+ * 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 given fields.
+ * Number of tuples in the given fields must be the same.
+ * Number of components in the given fields must be 3.
+ * \param [in] f1 - a given field.
+ * \param [in] f2 - another given 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 either \a f1 or \a f2 is NULL.
+ * \throw If \a f1->getNumberOfComponents() != 3
+ * \throw If \a f2->getNumberOfComponents() != 3
+ * \throw If the fields are not strictly compatible (areStrictlyCompatible()), i.e. they
+ * differ not only in values.
+ */
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2)
+{
+ if(!f1)
+ throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::CrossProductFields : input field is NULL !");
+ if(!f1->areStrictlyCompatible(f2))
+ throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply CrossProductFields on them !");
+ MEDCouplingTimeDiscretization *td=f1->_time_discr->crossProduct(f2->_time_discr);
+ td->copyTinyAttrFrom(*f1->_time_discr);
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(f1->getNature(),td,f1->_type->clone());
+ ret->setMesh(f1->getMesh());
+ return ret.retn();
+}
+
+/*!
+ * Returns a new MEDCouplingFieldDouble containing maximal values of two given fields.
+ * Number of tuples and components in the given fields must be the same.
+ * \param [in] f1 - a field to compare values with another one.
+ * \param [in] f2 - another field to compare values with the first 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 either \a f1 or \a f2 is NULL.
+ * \throw If the fields are not strictly compatible (areStrictlyCompatible()), i.e. they
+ * differ not only in values.
+ *
+ * \ref cpp_mcfielddouble_MaxFields "Here is a C++ example".<br>
+ * \ref py_mcfielddouble_MaxFields "Here is a Python example".
+ */
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2)
+{
+ if(!f1)
+ throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::MaxFields : input field is NULL !");
+ if(!f1->areStrictlyCompatible(f2))
+ throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply MaxFields on them !");
+ MEDCouplingTimeDiscretization *td=f1->_time_discr->max(f2->_time_discr);
+ td->copyTinyAttrFrom(*f1->_time_discr);
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(f1->getNature(),td,f1->_type->clone());
+ ret->setMesh(f1->getMesh());
+ return ret.retn();
+}
+
+/*!
+ * Returns a new MEDCouplingFieldDouble containing minimal values of two given fields.
+ * Number of tuples and components in the given fields must be the same.
+ * \param [in] f1 - a field to compare values with another one.
+ * \param [in] f2 - another field to compare values with the first 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 either \a f1 or \a f2 is NULL.
+ * \throw If the fields are not strictly compatible (areStrictlyCompatible()), i.e. they
+ * differ not only in values.
+ *
+ * \ref cpp_mcfielddouble_MaxFields "Here is a C++ example".<br>
+ * \ref py_mcfielddouble_MaxFields "Here is a Python example".
+ */
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2)
+{
+ if(!f1)
+ throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::MinFields : input field is NULL !");
+ if(!f1->areStrictlyCompatible(f2))
+ throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply MinFields on them !");
+ MEDCouplingTimeDiscretization *td=f1->_time_discr->min(f2->_time_discr);
+ td->copyTinyAttrFrom(*f1->_time_discr);
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(f1->getNature(),td,f1->_type->clone());
+ ret->setMesh(f1->getMesh());
+ return ret.retn();
+}
+
+/*!
+ * Returns a copy of \a this field in which sign of all values is reversed.
+ * \return MEDCouplingFieldDouble * - the new instance of MEDCouplingFieldDouble
+ * containing the same number of tuples and components as \a this field.
+ * The caller is to delete this result field using decrRef() as it is no more
+ * needed.
+ * \throw If the spatial discretization of \a this field is NULL.
+ * \throw If a data array is not allocated.
+ */
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::negate() const
+{
+ if(!((const MEDCouplingFieldDiscretization *)_type))
+ throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform negate !");
+ MEDCouplingTimeDiscretization *td=_time_discr->negate();
+ td->copyTinyAttrFrom(*_time_discr);
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),td,_type->clone());
+ ret->setMesh(getMesh());
+ return ret.retn();
+}
+
+/*!
+ * Returns a new MEDCouplingFieldDouble containing sum values of corresponding values of
+ * two given fields ( _f_ [ i, j ] = _f1_ [ i, j ] + _f2_ [ i, j ] ).
+ * Number of tuples and components in the given fields must be the same.
+ * \param [in] f1 - a field to sum up.
+ * \param [in] f2 - another field to sum up.
+ * \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 either \a f1 or \a f2 is NULL.
+ * \throw If the fields are not strictly compatible (areStrictlyCompatible()), i.e. they
+ * differ not only in values.
+ */
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2)
+{
+ if(!f1)
+ throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::AddFields : input field is NULL !");
+ if(!f1->areStrictlyCompatible(f2))
+ throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply AddFields on them !");
+ MEDCouplingTimeDiscretization *td=f1->_time_discr->add(f2->_time_discr);
+ td->copyTinyAttrFrom(*f1->_time_discr);
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(f1->getNature(),td,f1->_type->clone());
+ ret->setMesh(f1->getMesh());
+ return ret.retn();
+}
+
+/*!
+ * Adds values of another MEDCouplingFieldDouble to values of \a this one
+ * ( _this_ [ i, j ] += _other_ [ i, j ] ) using DataArrayDouble::addEqual().
+ * The two fields must have same number of tuples, components and same underlying mesh.
+ * \param [in] other - the field to add to \a this one.
+ * \return const MEDCouplingFieldDouble & - a reference to \a this field.
+ * \throw If \a other is NULL.
+ * \throw If the fields are not strictly compatible (areStrictlyCompatible()), i.e. they
+ * differ not only in values.
+ */
+const MEDCouplingFieldDouble &MEDCouplingFieldDouble::operator+=(const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception)
+{
+ if(!areStrictlyCompatible(&other))
+ throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply += on them !");
+ _time_discr->addEqual(other._time_discr);
+ return *this;
+}
+
+/*!
+ * Returns a new MEDCouplingFieldDouble containing subtraction of corresponding values of
+ * two given fields ( _f_ [ i, j ] = _f1_ [ i, j ] - _f2_ [ i, j ] ).
+ * Number of tuples and components in the given fields must be the same.
+ * \param [in] f1 - a field to subtract from.
+ * \param [in] f2 - a field to subtract.
+ * \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 either \a f1 or \a f2 is NULL.
+ * \throw If the fields are not strictly compatible (areStrictlyCompatible()), i.e. they
+ * differ not only in values.
+ */
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2)
+{
+ if(!f1)
+ throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::SubstractFields : input field is NULL !");
+ if(!f1->areStrictlyCompatible(f2))
+ throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply SubstractFields on them !");
+ MEDCouplingTimeDiscretization *td=f1->_time_discr->substract(f2->_time_discr);
+ td->copyTinyAttrFrom(*f1->_time_discr);
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(f1->getNature(),td,f1->_type->clone());
+ ret->setMesh(f1->getMesh());
+ return ret.retn();
+}
+
+/*!
+ * Subtract values of another MEDCouplingFieldDouble from values of \a this one
+ * ( _this_ [ i, j ] -= _other_ [ i, j ] ) using DataArrayDouble::substractEqual().
+ * The two fields must have same number of tuples, components and same underlying mesh.
+ * \param [in] other - the field to subtract from \a this one.
+ * \return const MEDCouplingFieldDouble & - a reference to \a this field.
+ * \throw If \a other is NULL.
+ * \throw If the fields are not strictly compatible (areStrictlyCompatible()), i.e. they
+ * differ not only in values.
+ */
+const MEDCouplingFieldDouble &MEDCouplingFieldDouble::operator-=(const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception)
+{
+ if(!areStrictlyCompatible(&other))
+ throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply -= on them !");
+ _time_discr->substractEqual(other._time_discr);
+ return *this;
+}
+
+/*!
+ * Returns a new MEDCouplingFieldDouble containing product values of
+ * two given fields. 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 _f1_ and
+ * _f2_, i.e. _f_ [ i, j ] = _f1_ [ i, j ] * _f2_ [ i, j ].
+ * 2. The fields have same number of tuples and one field, say _f2_, has one
+ * component. Then
+ * _f_ [ i, j ] = _f1_ [ i, j ] * _f2_ [ i, 0 ].
+ *
+ * The two fields must have same number of tuples and same underlying mesh.
+ * \param [in] f1 - a factor field.
+ * \param [in] f2 - another 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 either \a f1 or \a f2 is NULL.
+ * \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::MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2)
+{
+ if(!f1)
+ throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::MultiplyFields : input field is NULL !");
+ if(!f1->areCompatibleForMul(f2))
+ throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply MultiplyFields on them !");
+ MEDCouplingTimeDiscretization *td=f1->_time_discr->multiply(f2->_time_discr);
+ td->copyTinyAttrFrom(*f1->_time_discr);
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(f1->getNature(),td,f1->_type->clone());
+ ret->setMesh(f1->getMesh());
+ return ret.retn();
+}
+
+/*!
+ * Multiply values of another MEDCouplingFieldDouble to values of \a this one
+ * using DataArrayDouble::multiplyEqual().
+ * The two fields must have same number of tuples and same underlying mesh.
+ * There are 2 valid cases.
+ * 1. The fields have same number of components. Then each value of
+ * \a other is multiplied to the corresponding value of \a this field, i.e.
+ * _this_ [ i, j ] *= _other_ [ i, j ].
+ * 2. The _other_ field has one component. Then
+ * _this_ [ i, j ] *= _other_ [ i, 0 ].
+ *
+ * The two fields must have same number of tuples and same underlying mesh.
+ * \param [in] other - an field to multiply to \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 \a other is NULL.
+ * \throw If the fields are not strictly compatible for production
+ * (areCompatibleForMul()),
+ * i.e. they differ not only in values and possibly in number of components.
+ */
+const MEDCouplingFieldDouble &MEDCouplingFieldDouble::operator*=(const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception)
+{
+ if(!areCompatibleForMul(&other))
+ throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply *= on them !");
+ _time_discr->multiplyEqual(other._time_discr);
+ return *this;
+}
+
+/*!
+ * Returns a new MEDCouplingFieldDouble containing division of two given fields.
+ * 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 f1 and
+ * \a f2, i.e. _f_ [ i, j ] = _f1_ [ i, j ] / _f2_ [ i, j ].
+ * 2. The fields have same number of tuples and _f2_ has one component. Then
+ * _f_ [ i, j ] = _f1_ [ i, j ] / _f2_ [ i, 0 ].
+ *
+ * \param [in] f1 - a numerator field.
+ * \param [in] f2 - 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 either \a f1 or \a f2 is NULL.
+ * \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::DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2)
+{
+ if(!f1)
+ throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::DivideFields : input field is NULL !");
+ if(!f1->areCompatibleForDiv(f2))
+ throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply DivideFields on them !");
+ MEDCouplingTimeDiscretization *td=f1->_time_discr->divide(f2->_time_discr);
+ td->copyTinyAttrFrom(*f1->_time_discr);
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(f1->getNature(),td,f1->_type->clone());
+ ret->setMesh(f1->getMesh());
+ return ret.retn();
+}
+
+/*!
+ * Divide values of \a this field by values of another MEDCouplingFieldDouble
+ * using DataArrayDouble::divideEqual().
+ * The two fields must have same number of tuples and same underlying mesh.
+ * There are 2 valid cases.
+ * 1. The fields have same number of components. Then each value of
+ * \a this field is divided by the corresponding value of \a other one, i.e.
+ * _this_ [ i, j ] /= _other_ [ i, j ].
+ * 2. The \a other field has one component. Then
+ * _this_ [ i, j ] /= _other_ [ i, 0 ].
+ *
+ * \warning No check of division by zero is performed!
+ * \param [in] other - an field to divide \a this one by.
+ * \throw If \a other is NULL.
+ * \throw If the fields are not compatible for division (areCompatibleForDiv()),
+ * i.e. they differ not only in values and possibly in number of components.
+ */
+const MEDCouplingFieldDouble &MEDCouplingFieldDouble::operator/=(const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception)
+{
+ if(!areCompatibleForDiv(&other))
+ throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply /= on them !");
+ _time_discr->divideEqual(other._time_discr);
+ return *this;
+}
+
+/*!
+ * Directly called by MEDCouplingFieldDouble::operator^.
+ *
+ * \sa MEDCouplingFieldDouble::operator^
+ */
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::PowFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2)
+{
+ if(!f1)
+ throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::PowFields : input field is NULL !");
+ if(!f1->areCompatibleForMul(f2))
+ throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply PowFields on them !");
+ MEDCouplingTimeDiscretization *td=f1->_time_discr->pow(f2->_time_discr);
+ td->copyTinyAttrFrom(*f1->_time_discr);
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(f1->getNature(),td,f1->_type->clone());
+ ret->setMesh(f1->getMesh());
+ return ret.retn();
+}
+
+/*!
+ * Directly call MEDCouplingFieldDouble::PowFields static method.
+ *
+ * \sa MEDCouplingFieldDouble::PowFields
+ */
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::operator^(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception)
+{
+ return PowFields(this,&other);
+}
+
+const MEDCouplingFieldDouble &MEDCouplingFieldDouble::operator^=(const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception)
+{
+ if(!areCompatibleForDiv(&other))
+ throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply /= on them !");
+ _time_discr->powEqual(other._time_discr);
+ return *this;
+}
+
+/*!
+ * Writes the field series \a fs and the mesh the fields lie on in the VTK file \a fileName.
+ * If \a fs is empty no file is written.
+ * The result file is valid provided that no exception is thrown.
+ * \warning All the fields must be named and lie on the same non NULL mesh.
+ * \param [in] fileName - the name of a VTK file to write in.
+ * \param [in] fs - the fields to write.
+ * \param [in] isBinary - specifies the VTK format of the written file. By default true (Binary mode)
+ * \throw If \a fs[ 0 ] == NULL.
+ * \throw If the fields lie not on the same mesh.
+ * \throw If the mesh is not set.
+ * \throw If any of the fields has no name.
+ *
+ * \ref cpp_mcfielddouble_WriteVTK "Here is a C++ example".<br>
+ * \ref py_mcfielddouble_WriteVTK "Here is a Python example".
+ */
+void MEDCouplingFieldDouble::WriteVTK(const std::string& fileName, const std::vector<const MEDCouplingFieldDouble *>& fs, bool isBinary)
+{
+ if(fs.empty())
+ return;
+ std::size_t nfs=fs.size();
+ if(!fs[0])
+ throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::WriteVTK : 1st instance of field is NULL !");
+ const MEDCouplingMesh *m=fs[0]->getMesh();
+ if(!m)
+ throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::WriteVTK : 1st instance of field lies on NULL mesh !");
+ for(std::size_t i=1;i<nfs;i++)
+ if(fs[i]->getMesh()!=m)
+ throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::WriteVTK : Fields are not lying on a same mesh ! Expected by VTK ! MEDCouplingFieldDouble::setMesh or MEDCouplingFieldDouble::changeUnderlyingMesh can help to that.");
+ if(!m)
+ throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::WriteVTK : Fields are lying on a same mesh but it is empty !");
+ MEDCouplingAutoRefCountObjectPtr<DataArrayByte> byteArr;
+ if(isBinary)
+ { byteArr=DataArrayByte::New(); byteArr->alloc(0,1); }
+ std::ostringstream coss,noss;
+ for(std::size_t i=0;i<nfs;i++)
+ {
+ const MEDCouplingFieldDouble *cur=fs[i];
+ std::string name(cur->getName());
+ if(name.empty())
+ {
+ std::ostringstream oss; oss << "MEDCouplingFieldDouble::WriteVTK : Field in pos #" << i << " has no name !";
+ throw INTERP_KERNEL::Exception(oss.str().c_str());
+ }
+ TypeOfField typ=cur->getTypeOfField();
+ if(typ==ON_CELLS)
+ cur->getArray()->writeVTK(coss,8,cur->getName(),byteArr);
+ else if(typ==ON_NODES)
+ cur->getArray()->writeVTK(noss,8,cur->getName(),byteArr);
+ else
+ throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::WriteVTK : only node and cell fields supported for the moment !");
+ }
+ m->writeVTKAdvanced(fileName,coss.str(),noss.str(),byteArr);
+}
+
+void MEDCouplingFieldDouble::reprQuickOverview(std::ostream& stream) const
+{
+ stream << "MEDCouplingFieldDouble C++ instance at " << this << ". Name : \"" << _name << "\"." << std::endl;
+ const char *nat=0;
+ try
+ {
+ nat=MEDCouplingNatureOfField::GetRepr(_nature);
+ stream << "Nature of field : " << nat << ".\n";
+ }
+ catch(INTERP_KERNEL::Exception& /*e*/)
+ { }
+ const MEDCouplingFieldDiscretization *fd(_type);
+ if(!fd)
+ stream << "No spatial discretization set !";
+ else
+ fd->reprQuickOverview(stream);
+ stream << std::endl;
+ if(!_mesh)
+ stream << "\nNo mesh support defined !";
+ else
+ {
+ std::ostringstream oss;
+ _mesh->reprQuickOverview(oss);
+ std::string tmp(oss.str());
+ stream << "\nMesh info : " << tmp.substr(0,tmp.find('\n'));
+ }
+ if(_time_discr)
+ {
+ const DataArrayDouble *arr=_time_discr->getArray();
+ if(arr)
+ {
+ stream << "\n\nArray info : ";
+ arr->reprQuickOverview(stream);
+ }
+ else
+ {
+ stream << "\n\nNo data array set !";
+ }