* \throw If \c this->_mesh is null an exception will be thrown. An exception will also be throw if the spatial discretization is
* NO_TIME.
*/
-void MEDCouplingFieldDouble::synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception)
+void MEDCouplingFieldDouble::synchronizeTimeWithSupport()
{
_time_discr->synchronizeTimeWith(_mesh);
}
return ret.retn();
}
+/*!
+ * This method converts a field on nodes (\a this) to a cell field (returned field). The convertion is a \b non \b conservative remapping !
+ * This method is useful only for users that need a fast convertion from node to cell spatial discretization. The algorithm applied is simply to attach
+ * to each cell the average of values on nodes constituting this cell.
+ *
+ * \return MEDCouplingFieldDouble* - a new instance of MEDCouplingFieldDouble. The
+ * caller is to delete this field using decrRef() as it is no more needed. The returned field will share the same mesh object object than those in \a this.
+ * \throw If \a this spatial discretization is empty or not ON_NODES.
+ * \throw If \a this is not coherent (see MEDCouplingFieldDouble::checkCoherency).
+ *
+ * \warning This method is a \b non \b conservative method of remapping from node spatial discretization to cell spatial discretization.
+ * If a conservative method of interpolation is required ParaMEDMEM::MEDCouplingRemapper class should be used instead with "P1P0" method.
+ */
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::nodeToCellDiscretization() const
+{
+ checkCoherency();
+ TypeOfField tf(getTypeOfField());
+ if(tf!=ON_NODES)
+ throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::nodeToCellDiscretization : this field is expected to be on ON_NODES !");
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret(clone(false));
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDiscretizationP0> nsp(new MEDCouplingFieldDiscretizationP0);
+ ret->setDiscretization(nsp);
+ const MEDCouplingMesh *m(getMesh());//m is non empty thanks to checkCoherency call
+ int nbCells(m->getNumberOfCells()),nbNodes(m->getNumberOfNodes());
+ std::vector<DataArrayDouble *> arrs(getArrays());
+ std::size_t sz(arrs.size());
+ std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > outArrsSafe(sz); std::vector<DataArrayDouble *> outArrs(sz);
+ for(std::size_t j=0;j<sz;j++)
+ {
+ int nbCompo(arrs[j]->getNumberOfComponents());
+ outArrsSafe[j]=DataArrayDouble::New(); outArrsSafe[j]->alloc(nbCells,nbCompo);
+ outArrsSafe[j]->copyStringInfoFrom(*arrs[j]);
+ outArrs[j]=outArrsSafe[j];
+ double *pt(outArrsSafe[j]->getPointer());
+ const double *srcPt(arrs[j]->begin());
+ for(int i=0;i<nbCells;i++,pt+=nbCompo)
+ {
+ std::vector<int> nodeIds;
+ m->getNodeIdsOfCell(i,nodeIds);
+ std::fill(pt,pt+nbCompo,0.);
+ std::size_t nbNodesInCell(nodeIds.size());
+ for(std::size_t k=0;k<nbNodesInCell;k++)
+ std::transform(srcPt+nodeIds[k]*nbCompo,srcPt+(nodeIds[k]+1)*nbCompo,pt,pt,std::plus<double>());
+ if(nbNodesInCell!=0)
+ std::transform(pt,pt+nbCompo,pt,std::bind2nd(std::multiplies<double>(),1./((double)nbNodesInCell)));
+ else
+ {
+ std::ostringstream oss; oss << "MEDCouplingFieldDouble::nodeToCellDiscretization : Cell id #" << i << " has been detected to have no nodes !";
+ throw INTERP_KERNEL::Exception(oss.str().c_str());
+ }
+ }
+ }
+ ret->setArrays(outArrs);
+ return ret.retn();
+}
+
/*!
* Copies tiny info (component names, name and description) from an \a other field to
* \a this one.
* \param [in] other - the field to copy the tiny info from.
* \throw If \a this->getNumberOfComponents() != \a other->getNumberOfComponents()
*/
-void MEDCouplingFieldDouble::copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception)
+void MEDCouplingFieldDouble::copyTinyStringsFrom(const MEDCouplingField *other)
{
MEDCouplingField::copyTinyStringsFrom(other);
const MEDCouplingFieldDouble *otherC=dynamic_cast<const MEDCouplingFieldDouble *>(other);
* \param [in] other - the field to tiny attributes from.
* \throw If \a this->getNumberOfComponents() != \a other->getNumberOfComponents()
*/
-void MEDCouplingFieldDouble::copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception)
+void MEDCouplingFieldDouble::copyTinyAttrFrom(const MEDCouplingFieldDouble *other)
{
if(other)
{
}
-void MEDCouplingFieldDouble::copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception)
+void MEDCouplingFieldDouble::copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other)
{
copyTinyStringsFrom(other);
copyTinyAttrFrom(other);
return ret.str();
}
-void MEDCouplingFieldDouble::writeVTK(const char *fileName, bool isBinary) const throw(INTERP_KERNEL::Exception)
+void MEDCouplingFieldDouble::writeVTK(const char *fileName, bool isBinary) const
{
std::vector<const MEDCouplingFieldDouble *> fs(1,this);
MEDCouplingFieldDouble::WriteVTK(fileName,fs,isBinary);
}
-bool MEDCouplingFieldDouble::isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec, std::string& reason) const throw(INTERP_KERNEL::Exception)
+bool MEDCouplingFieldDouble::isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec, std::string& reason) const
{
if(!other)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::isEqualIfNotWhy : other instance is NULL !");
* \ref cpp_mcfielddouble_renumberCells "Here is a C++ example".<br>
* \ref py_mcfielddouble_renumberCells "Here is a Python example".
*/
-void MEDCouplingFieldDouble::renumberCells(const int *old2NewBg, bool check) throw(INTERP_KERNEL::Exception)
+void MEDCouplingFieldDouble::renumberCells(const int *old2NewBg, bool check)
{
renumberCellsWithoutMesh(old2NewBg,check);
MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> m=_mesh->deepCpy();
* \throw If \a check == \c true and \a old2NewBg contains equal ids.
* \throw If mesh nature does not allow renumbering (e.g. structured mesh).
*/
-void MEDCouplingFieldDouble::renumberCellsWithoutMesh(const int *old2NewBg, bool check) throw(INTERP_KERNEL::Exception)
+void MEDCouplingFieldDouble::renumberCellsWithoutMesh(const int *old2NewBg, bool check)
{
if(!_mesh)
throw INTERP_KERNEL::Exception("Expecting a defined mesh to be able to operate a renumbering !");
* \ref cpp_mcfielddouble_renumberNodes "Here is a C++ example".<br>
* \ref py_mcfielddouble_renumberNodes "Here is a Python example".
*/
-void MEDCouplingFieldDouble::renumberNodes(const int *old2NewBg, double eps) throw(INTERP_KERNEL::Exception)
+void MEDCouplingFieldDouble::renumberNodes(const int *old2NewBg, double eps)
{
const MEDCouplingPointSet *meshC=dynamic_cast<const MEDCouplingPointSet *>(_mesh);
if(!meshC)
* \throw If the spatial discretization of \a this field is NULL.
* \throw If values at merged nodes deffer more than \a eps.
*/
-void MEDCouplingFieldDouble::renumberNodesWithoutMesh(const int *old2NewBg, int newNbOfNodes, double eps) throw(INTERP_KERNEL::Exception)
+void MEDCouplingFieldDouble::renumberNodesWithoutMesh(const int *old2NewBg, int newNbOfNodes, double eps)
{
if(!((const MEDCouplingFieldDiscretization *)_type))
throw INTERP_KERNEL::Exception("Expecting a spatial discretization to be able to operate a renumbering !");
* \throw If the data array is not set.
* \throw If \a this->getNumberOfComponents() != 1.
*/
-DataArrayInt *MEDCouplingFieldDouble::getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception)
+DataArrayInt *MEDCouplingFieldDouble::getIdsInRange(double vmin, double vmax) const
{
if(getArray()==0)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::getIdsInRange : no default array set !");
* \sa MEDCouplingFieldDouble::buildSubPartRange
*/
-MEDCouplingFieldDouble *MEDCouplingFieldDouble::buildSubPart(const DataArrayInt *part) const throw(INTERP_KERNEL::Exception)
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::buildSubPart(const DataArrayInt *part) const
{
if(part==0)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : not empty array must be passed to this method !");
* \ref py_mcfielddouble_subpart1 "Here a Python example."
* \sa ParaMEDMEM::MEDCouplingFieldDouble::buildSubPart(const DataArrayInt *) const, MEDCouplingFieldDouble::buildSubPartRange
*/
-MEDCouplingFieldDouble *MEDCouplingFieldDouble::buildSubPart(const int *partBg, const int *partEnd) const throw(INTERP_KERNEL::Exception)
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::buildSubPart(const int *partBg, const int *partEnd) const
{
if(!((const MEDCouplingFieldDiscretization *)_type))
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : Expecting a not NULL spatial discretization !");
*
* \sa MEDCouplingFieldDouble::buildSubPart
*/
-MEDCouplingFieldDouble *MEDCouplingFieldDouble::buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::buildSubPartRange(int begin, int end, int step) const
{
if(!((const MEDCouplingFieldDiscretization *)_type))
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : Expecting a not NULL spatial discretization !");
* \throw If the temporal discretization data is incorrect.
* \throw If mesh data does not correspond to field data.
*/
-void MEDCouplingFieldDouble::checkCoherency() const throw(INTERP_KERNEL::Exception)
+void MEDCouplingFieldDouble::checkCoherency() const
{
if(!_mesh)
throw INTERP_KERNEL::Exception("Field invalid because no mesh specified !");
* \throw If the data array is not set.
* \throw If there is an empty data array in \a this field.
*/
-double MEDCouplingFieldDouble::getMaxValue() const throw(INTERP_KERNEL::Exception)
+double MEDCouplingFieldDouble::getMaxValue() const
{
std::vector<DataArrayDouble *> arrays;
_time_discr->getArrays(arrays);
* \throw If \a this->getNumberOfComponents() != 1.
* \throw If there is an empty data array in \a this field.
*/
-double MEDCouplingFieldDouble::getMaxValue2(DataArrayInt*& tupleIds) const throw(INTERP_KERNEL::Exception)
+double MEDCouplingFieldDouble::getMaxValue2(DataArrayInt*& tupleIds) const
{
std::vector<DataArrayDouble *> arrays;
_time_discr->getArrays(arrays);
* \throw If the data array is not set.
* \throw If there is an empty data array in \a this field.
*/
-double MEDCouplingFieldDouble::getMinValue() const throw(INTERP_KERNEL::Exception)
+double MEDCouplingFieldDouble::getMinValue() const
{
std::vector<DataArrayDouble *> arrays;
_time_discr->getArrays(arrays);
* \throw If \a this->getNumberOfComponents() != 1.
* \throw If there is an empty data array in \a this field.
*/
-double MEDCouplingFieldDouble::getMinValue2(DataArrayInt*& tupleIds) const throw(INTERP_KERNEL::Exception)
+double MEDCouplingFieldDouble::getMinValue2(DataArrayInt*& tupleIds) const
{
std::vector<DataArrayDouble *> arrays;
_time_discr->getArrays(arrays);
* \throw If \a this->getNumberOfComponents() != 1
* \throw If the data array is not set or it is empty.
*/
-double MEDCouplingFieldDouble::getAverageValue() const throw(INTERP_KERNEL::Exception)
+double MEDCouplingFieldDouble::getAverageValue() const
{
if(getArray()==0)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::getAverageValue : no default array defined !");
* \f]
* \throw If the data array is not set.
*/
-double MEDCouplingFieldDouble::norm2() const throw(INTERP_KERNEL::Exception)
+double MEDCouplingFieldDouble::norm2() const
{
if(getArray()==0)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::norm2 : no default array defined !");
* \f]
* \throw If the data array is not set.
*/
-double MEDCouplingFieldDouble::normMax() const throw(INTERP_KERNEL::Exception)
+double MEDCouplingFieldDouble::normMax() const
{
if(getArray()==0)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::normMax : no default array defined !");
* \throw If the mesh is not set.
* \throw If the data array is not set.
*/
-void MEDCouplingFieldDouble::getWeightedAverageValue(double *res, bool isWAbs) const throw(INTERP_KERNEL::Exception)
+void MEDCouplingFieldDouble::getWeightedAverageValue(double *res, bool isWAbs) const
{
if(getArray()==0)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::getWeightedAverageValue : no default array defined !");
* \throw If \a compId is not valid.
A valid range is ( 0 <= \a compId < \a this->getNumberOfComponents() ).
*/
-double MEDCouplingFieldDouble::getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception)
+double MEDCouplingFieldDouble::getWeightedAverageValue(int compId, bool isWAbs) const
{
int nbComps=getArray()->getNumberOfComponents();
if(compId<0 || compId>=nbComps)
* \throw If \a compId is not valid.
A valid range is ( 0 <= \a compId < \a this->getNumberOfComponents() ).
*/
-double MEDCouplingFieldDouble::normL1(int compId) const throw(INTERP_KERNEL::Exception)
+double MEDCouplingFieldDouble::normL1(int compId) const
{
if(!_mesh)
throw INTERP_KERNEL::Exception("No mesh underlying this field to perform normL1 !");
* \throw If the mesh is not set.
* \throw If the spatial discretization of \a this field is NULL.
*/
-void MEDCouplingFieldDouble::normL1(double *res) const throw(INTERP_KERNEL::Exception)
+void MEDCouplingFieldDouble::normL1(double *res) const
{
if(!_mesh)
throw INTERP_KERNEL::Exception("No mesh underlying this field to perform normL1");
* \throw If \a compId is not valid.
A valid range is ( 0 <= \a compId < \a this->getNumberOfComponents() ).
*/
-double MEDCouplingFieldDouble::normL2(int compId) const throw(INTERP_KERNEL::Exception)
+double MEDCouplingFieldDouble::normL2(int compId) const
{
if(!_mesh)
throw INTERP_KERNEL::Exception("No mesh underlying this field to perform normL2");
* \throw If the mesh is not set.
* \throw If the spatial discretization of \a this field is NULL.
*/
-void MEDCouplingFieldDouble::normL2(double *res) const throw(INTERP_KERNEL::Exception)
+void MEDCouplingFieldDouble::normL2(double *res) const
{
if(!_mesh)
throw INTERP_KERNEL::Exception("No mesh underlying this field to perform normL2");
* \throw If \a compId is not valid.
A valid range is ( 0 <= \a compId < \a this->getNumberOfComponents() ).
*/
-double MEDCouplingFieldDouble::integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception)
+double MEDCouplingFieldDouble::integral(int compId, bool isWAbs) const
{
if(!_mesh)
throw INTERP_KERNEL::Exception("No mesh underlying this field to perform integral");
* \throw If the data array is not set.
* \throw If the spatial discretization of \a this field is NULL.
*/
-void MEDCouplingFieldDouble::integral(bool isWAbs, double *res) const throw(INTERP_KERNEL::Exception)
+void MEDCouplingFieldDouble::integral(bool isWAbs, double *res) const
{
if(!_mesh)
throw INTERP_KERNEL::Exception("No mesh underlying this field to perform integral2");
* \ref cpp_mcfielddouble_getValueOnPos "Here is a C++ example".<br>
* \ref py_mcfielddouble_getValueOnPos "Here is a Python example".
*/
-void MEDCouplingFieldDouble::getValueOnPos(int i, int j, int k, double *res) const throw(INTERP_KERNEL::Exception)
+void MEDCouplingFieldDouble::getValueOnPos(int i, int j, int k, double *res) const
{
const DataArrayDouble *arr=_time_discr->getArray();
if(!_mesh)
* \ref cpp_mcfielddouble_getValueOn "Here is a C++ example".<br>
* \ref py_mcfielddouble_getValueOn "Here is a Python example".
*/
-void MEDCouplingFieldDouble::getValueOn(const double *spaceLoc, double *res) const throw(INTERP_KERNEL::Exception)
+void MEDCouplingFieldDouble::getValueOn(const double *spaceLoc, double *res) const
{
const DataArrayDouble *arr=_time_discr->getArray();
if(!_mesh)
* \ref cpp_mcfielddouble_getValueOnMulti "Here is a C++ example".<br>
* \ref py_mcfielddouble_getValueOnMulti "Here is a Python example".
*/
-DataArrayDouble *MEDCouplingFieldDouble::getValueOnMulti(const double *spaceLoc, int nbOfPoints) const throw(INTERP_KERNEL::Exception)
+DataArrayDouble *MEDCouplingFieldDouble::getValueOnMulti(const double *spaceLoc, int nbOfPoints) const
{
const DataArrayDouble *arr=_time_discr->getArray();
if(!_mesh)
* \ref cpp_mcfielddouble_getValueOn_time "Here is a C++ example".<br>
* \ref py_mcfielddouble_getValueOn_time "Here is a Python example".
*/
-void MEDCouplingFieldDouble::getValueOn(const double *spaceLoc, double time, double *res) const throw(INTERP_KERNEL::Exception)
+void MEDCouplingFieldDouble::getValueOn(const double *spaceLoc, double time, double *res) const
{
std::vector< const DataArrayDouble *> arrs=_time_discr->getArraysForTime(time);
if(!_mesh)
*
* \ref cpp_mcfielddouble_fillFromAnalytic_c_func "Here is a C++ example".
*/
-void MEDCouplingFieldDouble::fillFromAnalytic(int nbOfComp, FunctionToEvaluate func) throw(INTERP_KERNEL::Exception)
+void MEDCouplingFieldDouble::fillFromAnalytic(int nbOfComp, FunctionToEvaluate func)
{
if(!_mesh)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::fillFromAnalytic : no mesh defined !");
* \ref cpp_mcfielddouble_fillFromAnalytic "Here is a C++ example".<br>
* \ref py_mcfielddouble_fillFromAnalytic "Here is a Python example".
*/
-void MEDCouplingFieldDouble::fillFromAnalytic(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception)
+void MEDCouplingFieldDouble::fillFromAnalytic(int nbOfComp, const char *func)
{
if(!_mesh)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::fillFromAnalytic : no mesh defined !");
* \ref cpp_mcfielddouble_fillFromAnalytic2 "Here is a C++ example".<br>
* \ref py_mcfielddouble_fillFromAnalytic2 "Here is a Python example".
*/
-void MEDCouplingFieldDouble::fillFromAnalytic2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception)
+void MEDCouplingFieldDouble::fillFromAnalytic2(int nbOfComp, const char *func)
{
if(!_mesh)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::fillFromAnalytic2 : no mesh defined !");
* \ref cpp_mcfielddouble_fillFromAnalytic3 "Here is a C++ example".<br>
* \ref py_mcfielddouble_fillFromAnalytic3 "Here is a Python example".
*/
-void MEDCouplingFieldDouble::fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception)
+void MEDCouplingFieldDouble::fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func)
{
if(!_mesh)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::fillFromAnalytic2 : no mesh defined !");
* \ref cpp_mcfielddouble_applyFunc "Here is a C++ example".<br>
* \ref py_mcfielddouble_applyFunc "Here is a Python example".
*/
-void MEDCouplingFieldDouble::applyFunc(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception)
+void MEDCouplingFieldDouble::applyFunc(int nbOfComp, const char *func)
{
_time_discr->applyFunc(nbOfComp,func);
}
* \ref cpp_mcfielddouble_applyFunc2 "Here is a C++ example".<br>
* \ref py_mcfielddouble_applyFunc2 "Here is a Python example".
*/
-void MEDCouplingFieldDouble::applyFunc2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception)
+void MEDCouplingFieldDouble::applyFunc2(int nbOfComp, const char *func)
{
_time_discr->applyFunc2(nbOfComp,func);
}
* \ref cpp_mcfielddouble_applyFunc3 "Here is a C++ example".<br>
* \ref py_mcfielddouble_applyFunc3 "Here is a Python example".
*/
-void MEDCouplingFieldDouble::applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception)
+void MEDCouplingFieldDouble::applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func)
{
_time_discr->applyFunc3(nbOfComp,varsOrder,func);
}
* \ref cpp_mcfielddouble_applyFunc_same_nb_comp "Here is a C++ example".<br>
* \ref py_mcfielddouble_applyFunc_same_nb_comp "Here is a Python example".
*/
-void MEDCouplingFieldDouble::applyFunc(const char *func) throw(INTERP_KERNEL::Exception)
+void MEDCouplingFieldDouble::applyFunc(const char *func)
{
_time_discr->applyFunc(func);
}
* The field will contain exactly the same number of components after the call.
* Use is not warranted for the moment !
*/
-void MEDCouplingFieldDouble::applyFuncFast32(const char *func) throw(INTERP_KERNEL::Exception)
+void MEDCouplingFieldDouble::applyFuncFast32(const char *func)
{
_time_discr->applyFuncFast32(func);
}
* The field will contain exactly the same number of components after the call.
* Use is not warranted for the moment !
*/
-void MEDCouplingFieldDouble::applyFuncFast64(const char *func) throw(INTERP_KERNEL::Exception)
+void MEDCouplingFieldDouble::applyFuncFast64(const char *func)
{
_time_discr->applyFuncFast64(func);
}
* \return int - the number of components in the data array.
* \throw If the data array is not set.
*/
-int MEDCouplingFieldDouble::getNumberOfComponents() const throw(INTERP_KERNEL::Exception)
+int MEDCouplingFieldDouble::getNumberOfComponents() const
{
if(getArray()==0)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::getNumberOfComponents : No array specified !");
* \throw If the spatial discretization of \a this field is NULL.
* \throw If the spatial discretization is not fully defined.
*/
-int MEDCouplingFieldDouble::getNumberOfTuples() const throw(INTERP_KERNEL::Exception)
+int MEDCouplingFieldDouble::getNumberOfTuples() const
{
if(!_mesh)
throw INTERP_KERNEL::Exception("Impossible to retrieve number of tuples because no mesh specified !");
* data array.
* \throw If the data array is not set.
*/
-int MEDCouplingFieldDouble::getNumberOfValues() const throw(INTERP_KERNEL::Exception)
+int MEDCouplingFieldDouble::getNumberOfValues() const
{
if(getArray()==0)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::getNumberOfValues : No array specified !");
* Sets \ref NatureOfField.
* \param [in] nat - an item of enum ParaMEDMEM::NatureOfField.
*/
-void MEDCouplingFieldDouble::setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception)
+void MEDCouplingFieldDouble::setNature(NatureOfField nat)
{
MEDCouplingField::setNature(nat);
if(_type)
* This method synchronizes time information (time, iteration, order, time unit) regarding the information in \c this->_mesh.
* \throw If no mesh is set in this. Or if \a this is not compatible with time setting (typically NO_TIME)
*/
-void MEDCouplingFieldDouble::synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception)
+void MEDCouplingFieldDouble::synchronizeTimeWithMesh()
{
if(!_mesh)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::synchronizeTimeWithMesh : no mesh set in this !");
* \throw If number of arrays in \a arrs does not correspond to type of
* \ref MEDCouplingTemporalDisc "temporal discretization" of \a this field.
*/
-void MEDCouplingFieldDouble::setArrays(const std::vector<DataArrayDouble *>& arrs) throw(INTERP_KERNEL::Exception)
+void MEDCouplingFieldDouble::setArrays(const std::vector<DataArrayDouble *>& arrs)
{
_time_discr->setArrays(arrs,this);
}
* \ref cpp_mcfielddouble_changeUnderlyingMesh "Here is a C++ example".<br>
* \ref py_mcfielddouble_changeUnderlyingMesh "Here is a Python example".
*/
-void MEDCouplingFieldDouble::changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps) throw(INTERP_KERNEL::Exception)
+void MEDCouplingFieldDouble::changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps)
{
if(_mesh==0 || other==0)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::changeUnderlyingMesh : is expected to operate on not null meshes !");
* \ref py_mcfielddouble_substractInPlaceDM "Here is a Python example".
* \sa changeUnderlyingMesh().
*/
-void MEDCouplingFieldDouble::substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps) throw(INTERP_KERNEL::Exception)
+void MEDCouplingFieldDouble::substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps)
{
checkCoherency();
if(!f)
* \throw If the data array is not set.
* \throw If field values at merged nodes (if any) deffer more than \a epsOnVals.
*/
-bool MEDCouplingFieldDouble::mergeNodes(double eps, double epsOnVals) throw(INTERP_KERNEL::Exception)
+bool MEDCouplingFieldDouble::mergeNodes(double eps, double epsOnVals)
{
const MEDCouplingPointSet *meshC=dynamic_cast<const MEDCouplingPointSet *>(_mesh);
if(!meshC)
* \throw If the data array is not set.
* \throw If field values at merged nodes (if any) deffer more than \a epsOnVals.
*/
-bool MEDCouplingFieldDouble::mergeNodes2(double eps, double epsOnVals) throw(INTERP_KERNEL::Exception)
+bool MEDCouplingFieldDouble::mergeNodes2(double eps, double epsOnVals)
{
const MEDCouplingPointSet *meshC=dynamic_cast<const MEDCouplingPointSet *>(_mesh);
if(!meshC)
* \throw If the data array is not set.
* \throw If field values at merged nodes (if any) deffer more than \a epsOnVals.
*/
-bool MEDCouplingFieldDouble::zipCoords(double epsOnVals) throw(INTERP_KERNEL::Exception)
+bool MEDCouplingFieldDouble::zipCoords(double epsOnVals)
{
const MEDCouplingPointSet *meshC=dynamic_cast<const MEDCouplingPointSet *>(_mesh);
if(!meshC)
* \throw If the data array is not set.
* \throw If field values at merged cells (if any) deffer more than \a epsOnVals.
*/
-bool MEDCouplingFieldDouble::zipConnectivity(int compType, double epsOnVals) throw(INTERP_KERNEL::Exception)
+bool MEDCouplingFieldDouble::zipConnectivity(int compType, double epsOnVals)
{
const MEDCouplingUMesh *meshC=dynamic_cast<const MEDCouplingUMesh *>(_mesh);
if(!meshC)
*
* \return a newly allocated field double containing the result that the user should deallocate.
*/
-MEDCouplingFieldDouble *MEDCouplingFieldDouble::extractSlice3D(const double *origin, const double *vec, double eps) const throw(INTERP_KERNEL::Exception)
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::extractSlice3D(const double *origin, const double *vec, double eps) const
{
const MEDCouplingMesh *mesh=getMesh();
if(!mesh)
* \throw If the spatial discretization of \a this field is NULL.
* \throw If the data array is not set.
*/
-bool MEDCouplingFieldDouble::simplexize(int policy) throw(INTERP_KERNEL::Exception)
+bool MEDCouplingFieldDouble::simplexize(int policy)
{
if(!_mesh)
throw INTERP_KERNEL::Exception("No underlying mesh on this field to perform simplexize !");
* \throw If \a this->getNumberOfComponents() != 6.
* \throw If the spatial discretization of \a this field is NULL.
*/
-MEDCouplingFieldDouble *MEDCouplingFieldDouble::doublyContractedProduct() const throw(INTERP_KERNEL::Exception)
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::doublyContractedProduct() const
{
if(!((const MEDCouplingFieldDiscretization *)_type))
throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform doublyContractedProduct !");
* \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 throw(INTERP_KERNEL::Exception)
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::determinant() const
{
if(!((const MEDCouplingFieldDiscretization *)_type))
throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform determinant !");
* \throw If \a this->getNumberOfComponents() != 6.
* \throw If the spatial discretization of \a this field is NULL.
*/
-MEDCouplingFieldDouble *MEDCouplingFieldDouble::eigenValues() const throw(INTERP_KERNEL::Exception)
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::eigenValues() const
{
if(!((const MEDCouplingFieldDiscretization *)_type))
throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform eigenValues !");
* \throw If \a this->getNumberOfComponents() != 6.
* \throw If the spatial discretization of \a this field is NULL.
*/
-MEDCouplingFieldDouble *MEDCouplingFieldDouble::eigenVectors() const throw(INTERP_KERNEL::Exception)
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::eigenVectors() const
{
if(!((const MEDCouplingFieldDiscretization *)_type))
throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform eigenVectors !");
* \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 throw(INTERP_KERNEL::Exception)
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::inverse() const
{
if(!((const MEDCouplingFieldDiscretization *)_type))
throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform inverse !");
* \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 throw(INTERP_KERNEL::Exception)
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::trace() const
{
if(!((const MEDCouplingFieldDiscretization *)_type))
throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform trace !");
* \throw If \a this->getNumberOfComponents() != 6.
* \throw If the spatial discretization of \a this field is NULL.
*/
-MEDCouplingFieldDouble *MEDCouplingFieldDouble::deviator() const throw(INTERP_KERNEL::Exception)
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::deviator() const
{
if(!((const MEDCouplingFieldDiscretization *)_type))
throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform deviator !");
* 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 throw(INTERP_KERNEL::Exception)
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::magnitude() const
{
if(!((const MEDCouplingFieldDiscretization *)_type))
throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform magnitude !");
* 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 throw(INTERP_KERNEL::Exception)
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::maxPerTuple() const
{
if(!((const MEDCouplingFieldDiscretization *)_type))
throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform maxPerTuple !");
* \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) throw(INTERP_KERNEL::Exception)
+void MEDCouplingFieldDouble::changeNbOfComponents(int newNbOfComp, double dftValue)
{
_time_discr->changeNbOfComponents(newNbOfComp,dftValue);
}
* \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 throw(INTERP_KERNEL::Exception)
+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 !");
* \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) throw(INTERP_KERNEL::Exception)
+void MEDCouplingFieldDouble::setSelectedComponents(const MEDCouplingFieldDouble *f, const std::vector<int>& compoIds)
{
_time_discr->setSelectedComponents(f->_time_discr,compoIds);
}
* in descending order.
* \throw If a data array is not allocated.
*/
-void MEDCouplingFieldDouble::sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception)
+void MEDCouplingFieldDouble::sortPerTuple(bool asc)
{
_time_discr->sortPerTuple(asc);
}
* \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) throw(INTERP_KERNEL::Exception)
+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 !");
* \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) throw(INTERP_KERNEL::Exception)
+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 !");
* \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) throw(INTERP_KERNEL::Exception)
+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 !");
* \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) throw(INTERP_KERNEL::Exception)
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2)
{
if(!f1)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::DotFields : input field is NULL !");
* \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) throw(INTERP_KERNEL::Exception)
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2)
{
if(!f1)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::CrossProductFields : input field is NULL !");
* \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) throw(INTERP_KERNEL::Exception)
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2)
{
if(!f1)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::MaxFields : input field is NULL !");
* \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) throw(INTERP_KERNEL::Exception)
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2)
{
if(!f1)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::MinFields : input field is NULL !");
* \throw If the spatial discretization of \a this field is NULL.
* \throw If a data array is not allocated.
*/
-MEDCouplingFieldDouble *MEDCouplingFieldDouble::negate() const throw(INTERP_KERNEL::Exception)
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::negate() const
{
if(!((const MEDCouplingFieldDiscretization *)_type))
throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform negate !");
* \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) throw(INTERP_KERNEL::Exception)
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2)
{
if(!f1)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::AddFields : input field 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) throw(INTERP_KERNEL::Exception)
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2)
{
if(!f1)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::SubstractFields : input field 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) throw(INTERP_KERNEL::Exception)
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2)
{
if(!f1)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::MultiplyFields : input field 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) throw(INTERP_KERNEL::Exception)
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2)
{
if(!f1)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::DivideFields : input field is NULL !");
*
* \sa MEDCouplingFieldDouble::operator^
*/
-MEDCouplingFieldDouble *MEDCouplingFieldDouble::PowFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception)
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::PowFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2)
{
if(!f1)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::PowFields : input field is NULL !");
* \ref cpp_mcfielddouble_WriteVTK "Here is a C++ example".<br>
* \ref py_mcfielddouble_WriteVTK "Here is a Python example".
*/
-void MEDCouplingFieldDouble::WriteVTK(const char *fileName, const std::vector<const MEDCouplingFieldDouble *>& fs, bool isBinary) throw(INTERP_KERNEL::Exception)
+void MEDCouplingFieldDouble::WriteVTK(const char *fileName, const std::vector<const MEDCouplingFieldDouble *>& fs, bool isBinary)
{
if(fs.empty())
return;
m->writeVTKAdvanced(fileName,coss.str(),noss.str(),byteArr);
}
-void MEDCouplingFieldDouble::reprQuickOverview(std::ostream& stream) const throw(INTERP_KERNEL::Exception)
+void MEDCouplingFieldDouble::reprQuickOverview(std::ostream& stream) const
{
stream << "MEDCouplingFieldDouble C++ instance at " << this << ". Name : \"" << _name << "\"." << std::endl;
const char *nat=0;