-// Copyright (C) 2017 CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
/*!
* Leaf method of field with profile assignment. This method is the most general one. No optimization is done here.
- * \param [in] pflName input containing name of profile if any. 0 if no profile (except for GAUSS_PT where a no profile can hide a profile when splitted by loc_id).
+ * \param [in] pflName input containing name of profile if any. 0 if no profile (except for GAUSS_PT where a no profile can hide a profile when split by loc_id).
* \param [in] multiTypePfl is the end user profile specified in high level API
* \param [in] idsInPfl is the selection into the \a multiTypePfl whole profile that corresponds to the current geometric type.
* \param [in] locIds is the profile needed to be created for MED file format. It can be null if all cells of current geometric type are fetched in \a multiTypePfl.
* \b WARNING if not null the MED file profile can be subdivided again in case of Gauss points.
- * \param [in] mesh is the mesh coming from the MEDFileMesh instance in correspondance with the MEDFileField. The mesh inside the \a field is simply ignored.
+ * \param [in] mesh is the mesh coming from the MEDFileMesh instance in correspondence with the MEDFileField. The mesh inside the \a field is simply ignored.
*/
void MEDFileFieldPerMeshPerTypePerDisc::assignFieldProfile(bool isPflAlone, int& start, const DataArrayInt *multiTypePfl, const DataArrayInt *idsInPfl, DataArrayInt *locIds, int nbOfEltsInWholeMesh, const MEDCouplingFieldTemplate *field, const DataArray *arrr, const MEDCouplingMesh *mesh, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc)
{
return _end-_start;
}
+void MEDFileFieldPerMeshPerTypePerDisc::incrementNbOfVals(int deltaNbVal)
+{
+ int nbi((_end-_start)/_nval);
+ _nval+=deltaNbVal;
+ _end+=nbi*deltaNbVal;
+}
+
DataArray *MEDFileFieldPerMeshPerTypePerDisc::getOrCreateAndGetArray()
{
return _father->getOrCreateAndGetArray();
/*!
* - \c this->_loc_id mutable attribute is used for elt id in mesh offsets.
- *
+ *
* \param [in] offset the offset id used to take into account that \a result is not compulsory empty in input
* \param [in] entriesOnSameDisc some entries **on same localization** if not the result can be invalid. The _start and _end on them are relative to \a arr parameter.
* \param [in] explicitIdsInMesh ids in mesh of the considered chunk.
* \param [in] locIds is the profile needed to be created for MED file format. It can be null if all cells of current geometric type are fetched in \a multiTypePfl.
* \b WARNING if not null the MED file profile can be subdivided again in case of Gauss points.
* \param [in] nbOfEltsInWholeMesh nb of elts of type \a this->_geo_type in \b WHOLE mesh
- * \param [in] mesh is the mesh coming from the MEDFileMesh instance in correspondance with the MEDFileField. The mesh inside the \a field is simply ignored.
+ * \param [in] mesh is the mesh coming from the MEDFileMesh instance in correspondence with the MEDFileField. The mesh inside the \a field is simply ignored.
*/
void MEDFileFieldPerMeshPerTypeCommon::assignFieldProfile(bool isPflAlone, int& start, const DataArrayInt *multiTypePfl, const DataArrayInt *idsInPfl, DataArrayInt *locIds, int nbOfEltsInWholeMesh, const MEDCouplingFieldTemplate *field, const DataArray *arr, const MEDCouplingMesh *mesh, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc)
{
return static_cast<const MEDFileFieldPerMeshPerTypePerDisc*>(0);
}
+int MEDFileFieldPerMeshPerTypeCommon::locIdOfLeaf(const MEDFileFieldPerMeshPerTypePerDisc *leaf) const
+{
+ int ret(0);
+ for(std::vector< MCAuto<MEDFileFieldPerMeshPerTypePerDisc> >::const_iterator it=_field_pm_pt_pd.begin();it!=_field_pm_pt_pd.end();it++,ret++)
+ {
+ const MEDFileFieldPerMeshPerTypePerDisc *cand(*it);
+ if(cand==leaf)
+ return ret;
+ }
+ throw INTERP_KERNEL::Exception("MEDFileFieldPerMeshPerTypeCommon::locIdOfLeaf : not found such a leaf in this !");
+}
+
void MEDFileFieldPerMeshPerTypeCommon::fillValues(int& startEntryId, std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const
{
int i=0;
}
/*!
- * \param [in,out] globalNum a global numbering counter for the renumbering.
+ * \param [in,out] globalNum a global numbering counter for the renumbering.
* \param [out] its - list of pair (start,stop) kept
* \return bool - false if the type of field \a tof is not contained in \a this.
*/
* \param [in] code2 is the code of the \b WHOLE mesh on the same level. So all types in \a code are in \a code2.
* \param [in] idsInPflPerType is the selection into the \a multiTypePfl whole profile that corresponds to the given geometric type. This vector is always 3 times smaller than \a code.
* \param [in] idsPerType is a vector containing the profiles needed to be created for MED file format. \b WARNING these processed MED file profiles can be subdivided again in case of Gauss points.
- * \param [in] mesh is the mesh coming from the MEDFileMesh instance in correspondance with the MEDFileField. The mesh inside the \a field is simply ignored.
+ * \param [in] mesh is the mesh coming from the MEDFileMesh instance in correspondence with the MEDFileField. The mesh inside the \a field is simply ignored.
*/
void MEDFileFieldPerMesh::assignFieldProfile(int& start, const DataArrayInt *multiTypePfl, const std::vector<int>& code, const std::vector<int>& code2, const std::vector<DataArrayInt *>& idsInPflPerType, const std::vector<DataArrayInt *>& idsPerType, const MEDCouplingFieldTemplate *field, const DataArray *arr, const MEDCouplingMesh *mesh, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc)
{
/*!
* \param [in,out] start - Integer that gives the current position in the final aggregated array
- * \param [in] pms - list of elements to aggregate. integer gives the mesh id
+ * \param [in] pms - list of elements to aggregate. integer gives the mesh id
* \param [in] dts - (Distribution of types) = level 1 : meshes to aggregate. Level 2 : all geo type. Level 3 pair specifying geo type and number of elem in geotype.
* \param [out] extractInfo - Gives information about the where the data comes from. It is a vector of triplet. First element in the triplet the mesh pos. The 2nd one the start pos. The 3rd the end pos.
*/
/*!
* This method is an extension of MEDFileFieldPerMesh::finishField method. It deals with profiles. This method should be called when type is different from ON_NODES.
* 'dads', 'locs' and 'geoTypes' input parameters have the same number of elements.
- * No check of this is performed. 'da' array contains an array in old2New style to be applyied to mesh to obtain the right support.
+ * No check of this is performed. 'da' array contains an array in old2New style to be applied to mesh to obtain the right support.
* The order of cells in the returned field is those imposed by the profile.
* \param [in] mesh is the global mesh.
*/
else
{
std::ostringstream oss; oss << "MEDFileFieldPerMesh::finishFieldNode2 : The field on nodes lies on a node profile so that it is impossible to find a submesh having exactly the same nodes of that profile !!!";
- oss << "So it is impossible to return a well definied MEDCouplingFieldDouble instance on specified mesh on a specified meshDim !" << std::endl;
+ oss << "So it is impossible to return a well defined MEDCouplingFieldDouble instance on specified mesh on a specified meshDim !" << std::endl;
oss << "To retrieve correctly such a field you have 3 possibilities :" << std::endl;
oss << " - use an another meshDim compatible with the field on nodes (MED file does not have such information)" << std::endl;
oss << " - use an another a meshDimRelToMax equal to 1 -> it will return a mesh with artificial cell POINT1 containing the profile !" << std::endl;