};
}
-void MEDCouplingCMesh::getCoordinatesOfNode(int nodeId, std::vector<double>& coo) const
+void MEDCouplingCMesh::getCoordinatesOfNode(int nodeId, std::vector<double>& coo) const throw(INTERP_KERNEL::Exception)
{
int tmp[3];
int spaceDim=getSpaceDimension();
std::set<INTERP_KERNEL::NormalizedCellType> getAllGeoTypes() const;
int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const;
void getNodeIdsOfCell(int cellId, std::vector<int>& conn) const;
- void getCoordinatesOfNode(int nodeId, std::vector<double>& coo) const;
+ void getCoordinatesOfNode(int nodeId, std::vector<double>& coo) const throw(INTERP_KERNEL::Exception);
std::string simpleRepr() const;
std::string advancedRepr() const;
const DataArrayDouble *getCoordsAt(int i) const throw(INTERP_KERNEL::Exception);
conn.insert(conn.end(),tmp2.begin(),tmp2.end());
}
-void MEDCouplingExtrudedMesh::getCoordinatesOfNode(int nodeId, std::vector<double>& coo) const
+void MEDCouplingExtrudedMesh::getCoordinatesOfNode(int nodeId, std::vector<double>& coo) const throw(INTERP_KERNEL::Exception)
{
int nbOfNodes2D=_mesh2D->getNumberOfNodes();
int locId=nodeId%nbOfNodes2D;
std::set<INTERP_KERNEL::NormalizedCellType> getAllGeoTypes() const;
int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const;
void getNodeIdsOfCell(int cellId, std::vector<int>& conn) const;
- void getCoordinatesOfNode(int nodeId, std::vector<double>& coo) const;
+ void getCoordinatesOfNode(int nodeId, std::vector<double>& coo) const throw(INTERP_KERNEL::Exception);
std::string simpleRepr() const;
std::string advancedRepr() const;
void checkCoherency() const throw (INTERP_KERNEL::Exception);
return _type->getEnum();
}
+/*!
+ * This method returns the nature of field. This information is very important during interpolation process using ParaMEDMEM::MEDCouplingRemapper or ParaMEDMEM::InterpKernelDEC.
+ * In other context than the two mentioned before this attribute of the field is not sensitive. This attribute is not store in MED file in MEDLoader.
+ * More information of the semantic, and the behaviour of the interpolation, is explained \ref NatureOfField "here".
+ */
+NatureOfField MEDCouplingField::getNature() const
+{
+ return _nature;
+}
+
+/*!
+ * This method set the nature of field in \b this.This information is very important during interpolation process using ParaMEDMEM::MEDCouplingRemapper or ParaMEDMEM::InterpKernelDEC.
+ * In other context than the two mentioned before this attribute of the field is not sensitive. This attribute is not store in MED file in MEDLoader.
+ * More information of the semantic, and the behaviour of the interpolation, is explained \ref TableNatureOfField "here".
+ */
void MEDCouplingField::setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception)
{
_nature=nat;
void setDescription(const char *desc) { _desc=desc; }
const char *getName() const { return _name.c_str(); }
TypeOfField getTypeOfField() const;
- NatureOfField getNature() const { return _nature; }
+ NatureOfField getNature() const;
virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
virtual std::set<INTERP_KERNEL::NormalizedCellType> getAllGeoTypes() const = 0;
virtual void getNodeIdsOfCell(int cellId, std::vector<int>& conn) const = 0;
virtual DataArrayInt *getCellIdsFullyIncludedInNodeIds(const int *partBg, const int *partEnd) const;
- virtual void getCoordinatesOfNode(int nodeId, std::vector<double>& coo) const = 0;
+ virtual void getCoordinatesOfNode(int nodeId, std::vector<double>& coo) const throw(INTERP_KERNEL::Exception) = 0;
virtual std::string simpleRepr() const = 0;
virtual std::string advancedRepr() const = 0;
// tools
return _coords->isEqualWithoutConsideringStr(*other._coords,prec);
}
+/*!
+ * Returns coordinates of node with id 'nodeId' and append it in 'coo'.
+ */
+void MEDCouplingPointSet::getCoordinatesOfNode(int nodeId, std::vector<double>& coo) const throw(INTERP_KERNEL::Exception)
+{
+ if(!_coords)
+ throw INTERP_KERNEL::Exception("MEDCouplingPointSet::getCoordinatesOfNode : no coordinates array set !");
+ int nbNodes=getNumberOfNodes();
+ if(nodeId>=0 && nodeId<nbNodes)
+ {
+ const double *cooPtr=_coords->getConstPointer();
+ int spaceDim=getSpaceDimension();
+ coo.insert(coo.end(),cooPtr+spaceDim*nodeId,cooPtr+spaceDim*(nodeId+1));
+ }
+ else
+ {
+ std::ostringstream oss; oss << "MEDCouplingPointSet::getCoordinatesOfNode : request of nodeId \"" << nodeId << "\" but it should be in [0,"<< nbNodes << ") !";
+ throw INTERP_KERNEL::Exception(oss.str().c_str());
+ }
+}
+
/*!
* This method is typically the base method used for implementation of mergeNodes. This method computes this permutation array using as input,
* This method is const ! So this method simply computes the array, no permutation of nodes is done.
bool areCoordsEqualWithoutConsideringStr(const MEDCouplingPointSet& other, double prec) const;
virtual DataArrayInt *mergeNodes(double precision, bool& areNodesMerged, int& newNbOfNodes) = 0;
virtual DataArrayInt *mergeNodes2(double precision, bool& areNodesMerged, int& newNbOfNodes) = 0;
+ void getCoordinatesOfNode(int nodeId, std::vector<double>& coo) const throw(INTERP_KERNEL::Exception);
DataArrayInt *buildPermArrayForMergeNode(double precision, int limitNodeId, bool& areNodesMerged, int& newNbOfNodes) const;
std::vector<int> getNodeIdsNearPoint(const double *pos, double eps) const throw(INTERP_KERNEL::Exception);
void getNodeIdsNearPoints(const double *pos, int nbOfNodes, double eps, std::vector<int>& c, std::vector<int>& cI) const throw(INTERP_KERNEL::Exception);
conn.push_back(*w);
}
-/*!
- * Returns coordinates of node with id 'nodeId' and append it in 'coo'.
- */
-void MEDCouplingUMesh::getCoordinatesOfNode(int nodeId, std::vector<double>& coo) const
-{
- const double *cooPtr=_coords->getConstPointer();
- int spaceDim=getSpaceDimension();
- coo.insert(coo.end(),cooPtr+spaceDim*nodeId,cooPtr+spaceDim*(nodeId+1));
-}
-
std::string MEDCouplingUMesh::simpleRepr() const
{
static const char msg0[]="No coordinates specified !";
MEDCOUPLING_EXPORT int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const;
MEDCOUPLING_EXPORT void getNodeIdsOfCell(int cellId, std::vector<int>& conn) const;
MEDCOUPLING_EXPORT DataArrayInt *getCellIdsFullyIncludedInNodeIds(const int *partBg, const int *partEnd) const;
- MEDCOUPLING_EXPORT void getCoordinatesOfNode(int nodeId, std::vector<double>& coo) const;
MEDCOUPLING_EXPORT std::string simpleRepr() const;
MEDCOUPLING_EXPORT std::string advancedRepr() const;
MEDCOUPLING_EXPORT std::string reprConnectivityOfThis() const;
return ret;
}
-/*!
- * not implemented
- */
MEDCouplingMesh *MEDCouplingUMeshDesc::deepCpy() const
{
+ throw INTERP_KERNEL::Exception("Not implemented yet !");
return 0;
}
void MEDCouplingUMeshDesc::getNodeIdsOfCell(int cellId, std::vector<int>& conn) const
{
- //not implemented yet.
-}
-
-void MEDCouplingUMeshDesc::getCoordinatesOfNode(int nodeId, std::vector<double>& coo) const
-{
- //not implemented yet.
+ throw INTERP_KERNEL::Exception("Not implemented yet !");
}
std::string MEDCouplingUMeshDesc::simpleRepr() const
DataArrayInt *MEDCouplingUMeshDesc::mergeNodes(double precision, bool& areNodesMerged, int& newNbOfNodes)
{
- //not implemented yet.
+ throw INTERP_KERNEL::Exception("Not implemented yet !");
areNodesMerged=false;
return 0;
}
DataArrayInt *MEDCouplingUMeshDesc::mergeNodes2(double precision, bool& areNodesMerged, int& newNbOfNodes)
{
- //not implemented yet.
+ throw INTERP_KERNEL::Exception("Not implemented yet !");
areNodesMerged=false;
return 0;
}
MEDCouplingPointSet *MEDCouplingUMeshDesc::buildPartOfMySelf(const int *start, const int *end, bool keepCoords) const
{
- //not implemented yet.
+ throw INTERP_KERNEL::Exception("Not implemented yet !");
return 0;
}
MEDCouplingPointSet *MEDCouplingUMeshDesc::buildPartOfMySelfNode(const int *start, const int *end, bool fullyIn) const
{
- //not implemented yet
+ throw INTERP_KERNEL::Exception("Not implemented yet !");
return 0;
}
MEDCouplingPointSet *MEDCouplingUMeshDesc::buildFacePartOfMySelfNode(const int *start, const int *end, bool fullyIn) const
{
- //not implemented yet
+ throw INTERP_KERNEL::Exception("Not implemented yet !");
return 0;
}
void MEDCouplingUMeshDesc::findBoundaryNodes(std::vector<int>& nodes) const
{
- //not implemented yet
+ throw INTERP_KERNEL::Exception("Not implemented yet !");
}
MEDCouplingPointSet *MEDCouplingUMeshDesc::buildBoundaryMesh(bool keepCoords) const
{
- //not implemented yet
+ throw INTERP_KERNEL::Exception("Not implemented yet !");
return 0;
}
void MEDCouplingUMeshDesc::renumberNodes(const int *newNodeNumbers, int newNbOfNodes)
{
MEDCouplingPointSet::renumberNodes(newNodeNumbers,newNbOfNodes);
- //not implemented yet
+ throw INTERP_KERNEL::Exception("Not implemented yet !");
}
MEDCouplingFieldDouble *MEDCouplingUMeshDesc::getMeasureField(bool isAbs) const
{
- //not implemented yet.
+ throw INTERP_KERNEL::Exception("Not implemented yet !");
return 0;
}
MEDCouplingFieldDouble *MEDCouplingUMeshDesc::getMeasureFieldOnNode(bool isAbs) const
{
- //not implemented yet.
+ throw INTERP_KERNEL::Exception("Not implemented yet !");
return 0;
}
{
if(getMeshDimension()!=2)
throw INTERP_KERNEL::Exception("Expected a cmesh with meshDim == 2 !");
- //not implemented yet !
+ throw INTERP_KERNEL::Exception("Not implemented yet !");
return 0;
}
DataArrayInt *MEDCouplingUMeshDesc::zipCoordsTraducer()
{
- //not implemented yet.
+ throw INTERP_KERNEL::Exception("Not implemented yet !");
return 0;
}
MEDCouplingMesh *MEDCouplingUMeshDesc::mergeMyselfWith(const MEDCouplingMesh *other) const
{
- //not implemented yet.
+ throw INTERP_KERNEL::Exception("Not implemented yet !");
return 0;
}
DataArrayDouble *MEDCouplingUMeshDesc::getBarycenterAndOwner() const
{
- //not implemented yet.
+ throw INTERP_KERNEL::Exception("Not implemented yet !");
return 0;
}
MEDCOUPLING_EXPORT std::set<INTERP_KERNEL::NormalizedCellType> getAllGeoTypes() const;
MEDCOUPLING_EXPORT int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const;
MEDCOUPLING_EXPORT void getNodeIdsOfCell(int cellId, std::vector<int>& conn) const;
- MEDCOUPLING_EXPORT void getCoordinatesOfNode(int nodeId, std::vector<double>& coo) const;
MEDCOUPLING_EXPORT std::string simpleRepr() const;
MEDCOUPLING_EXPORT std::string advancedRepr() const;
MEDCOUPLING_EXPORT MEDCouplingMeshType getType() const { return UNSTRUCTURED_DESC; }